mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-05-28 18:39:31 +02:00
Compare commits
148 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9eb3d44a4 | |||
| b492ffa227 | |||
| cba58c7478 | |||
| 3676862097 | |||
| a45c63b744 | |||
| dfd3fb3ed3 | |||
| f90b4d064f | |||
| f571b1d02f | |||
| 966e889643 | |||
| 30740c73c9 | |||
| 516894b870 | |||
| a8b98bc03e | |||
| b979df91fd | |||
| 0e0ac0237c | |||
| 5f4f663e8b | |||
| 36c56b7d8d | |||
| b82353b513 | |||
| f9a650f352 | |||
| 707192cf81 | |||
| cabdfd8cb7 | |||
| b79cc2faf4 | |||
| 72bd225ca2 | |||
| daa883caf8 | |||
| 292809783d | |||
| d5ef998239 | |||
| 3f7c023251 | |||
| d8268599d8 | |||
| aaef949c99 | |||
| 9ffdbfe068 | |||
| 9424045430 | |||
| 3d93e1b565 | |||
| 1e260e4d17 | |||
| 04aff6d8d8 | |||
| 086c7ad27b | |||
| bb46ed1263 | |||
| e82b5e0770 | |||
| 55efe14c41 | |||
| 0a5f4dacba | |||
| 0667011531 | |||
| 8af056a3ea | |||
| 76883edf0b | |||
| a9c2031aee | |||
| 538dc8954b | |||
| 09c73d9f5e | |||
| f65ecdd821 | |||
| eaa31be821 | |||
| 57a3af6e40 | |||
| 3d8417b4a2 | |||
| 2e0863ae6d | |||
| b0c1301367 | |||
| f68fe49720 | |||
| 59d9601f49 | |||
| 4f2e1e050c | |||
| 98aba2f6da | |||
| 1dbd81e2fa | |||
| 04c2901b5e | |||
| a3b9c43c44 | |||
| b0a6886b31 | |||
| 4873d63ff7 | |||
| 37529429bf | |||
| 906fd006b0 | |||
| 65a07315f2 | |||
| 04dedc9fa9 | |||
| cbfe78f179 | |||
| c9102ead4f | |||
| 26e5a3d12e | |||
| bed0d1acdc | |||
| a2dbd51b2e | |||
| 6f8b0f02fd | |||
| 6c18d36d48 | |||
| cd2e2509bd | |||
| fc6f064a51 | |||
| 5809155f4b | |||
| 3cdb3bb181 | |||
| 18ac49f165 | |||
| 4a76601970 | |||
| bfb970a6d7 | |||
| 8ba3c2713f | |||
| 166a4d0369 | |||
| df7c007de3 | |||
| 7807f789cf | |||
| ed822139ec | |||
| c5b855765e | |||
| e3ba141695 | |||
| 709f56a0c2 | |||
| dbac1b8bd7 | |||
| e2295f350b | |||
| 1efb20f534 | |||
| 23582c25a1 | |||
| 578a845e60 | |||
| 1443cc06de | |||
| eb91c223ff | |||
| 0347b877c4 | |||
| e1981c2e91 | |||
| dd2edb3216 | |||
| a8d6d2e29e | |||
| 0cfc6140b6 | |||
| 6a14d05f5b | |||
| 03007f48bf | |||
| b8f5458ba1 | |||
| aac30d1313 | |||
| 5163067773 | |||
| 57fdf25c46 | |||
| 1f43d47695 | |||
| 7da7eadff5 | |||
| 077203b375 | |||
| 6b978b074d | |||
| af8315a657 | |||
| 6442377d1c | |||
| b81b285d92 | |||
| d393fa707f | |||
| 62c14b3c84 | |||
| 29e9e4cecd | |||
| 2cdb0afe48 | |||
| 19d6cdf416 | |||
| 973c4d27d0 | |||
| 248cf2e86f | |||
| 148da9eecf | |||
| 0ceb810133 | |||
| 137e11e81f | |||
| 8c71e7aade | |||
| 03a14c40fe | |||
| 95b976c171 | |||
| de5b30e92a | |||
| 9a937013d8 | |||
| 1962a582c2 | |||
| 271fad0288 | |||
| 3c1df26fc9 | |||
| c205079d46 | |||
| 49dd2c1b2f | |||
| 669404d2c3 | |||
| e6008a35ad | |||
| 00cab89857 | |||
| 53e6c6d872 | |||
| bbe6ac0fcd | |||
| 54cd7bdcdb | |||
| 735f803c66 | |||
| 378319e4bf | |||
| 15727ea482 | |||
| 3b548b581c | |||
| d2a1bb18eb | |||
| e29f62f228 | |||
| 0013c9d01e | |||
| 07a45af96b | |||
| 3a1eaa589d | |||
| fe599a2143 | |||
| 9915343370 | |||
| b3c91a0e7a |
@@ -0,0 +1,199 @@
|
|||||||
|
# just is a command runner, Justfile is very similar to Makefile, but simpler.
|
||||||
|
|
||||||
|
# use nushell for shell commands
|
||||||
|
set shell := ["nu", "-c"]
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# Nix commands related to the local machine
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
i3 mode="default":
|
||||||
|
use utils.nu *; \
|
||||||
|
nixos-switch ai_i3 {{mode}}
|
||||||
|
|
||||||
|
hypr mode="default":
|
||||||
|
use utils.nu *; \
|
||||||
|
nixos-switch ai_hyprland {{mode}}
|
||||||
|
|
||||||
|
|
||||||
|
s-i3 mode="default":
|
||||||
|
use utils.nu *; \
|
||||||
|
nixos-switch shoukei_i3 {{mode}}
|
||||||
|
|
||||||
|
|
||||||
|
s-hypr mode="default":
|
||||||
|
use utils.nu *; \
|
||||||
|
nixos-switch shoukei_hyprland {{mode}}
|
||||||
|
|
||||||
|
|
||||||
|
up:
|
||||||
|
nix flake update
|
||||||
|
|
||||||
|
# Update specific input
|
||||||
|
# Usage: just upp nixpkgs
|
||||||
|
upp input:
|
||||||
|
nix flake lock --update-input {{input}}
|
||||||
|
|
||||||
|
history:
|
||||||
|
nix profile history --profile /nix/var/nix/profiles/system
|
||||||
|
|
||||||
|
repl:
|
||||||
|
nix repl -f flake:nixpkgs
|
||||||
|
|
||||||
|
clean:
|
||||||
|
# remove all generations older than 7 days
|
||||||
|
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
|
||||||
|
|
||||||
|
gc:
|
||||||
|
# garbage collect all unused nix store entries
|
||||||
|
sudo nix store gc --debug
|
||||||
|
sudo nix-collect-garbage --delete-old
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# Darwin related commands, harmonica is my macbook pro's hostname
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
darwin-set-proxy:
|
||||||
|
sudo python3 scripts/darwin_set_proxy.py
|
||||||
|
sleep 1sec
|
||||||
|
|
||||||
|
darwin-rollback:
|
||||||
|
use utils.nu *; \
|
||||||
|
darwin-rollback
|
||||||
|
|
||||||
|
ha mode="default":
|
||||||
|
use utils.nu *; \
|
||||||
|
darwin-build "harmonica" {{mode}}; \
|
||||||
|
darwin-switch "harmonica" {{mode}}
|
||||||
|
|
||||||
|
fe mode="default": darwin-set-proxy
|
||||||
|
use utils.nu *; \
|
||||||
|
darwin-build "fern" {{mode}}; \
|
||||||
|
darwin-switch "fern" {{mode}}
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# Idols, Commands related to my remote distributed building cluster
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
idols-ssh-key:
|
||||||
|
ssh-add ~/.ssh/ai-idols
|
||||||
|
|
||||||
|
idols: idols-ssh-key
|
||||||
|
colmena apply --on '@dist-build'
|
||||||
|
|
||||||
|
aqua:
|
||||||
|
colmena apply --on '@aqua'
|
||||||
|
|
||||||
|
ruby:
|
||||||
|
colmena apply --on '@ruby'
|
||||||
|
|
||||||
|
kana:
|
||||||
|
colmena apply --on '@kana'
|
||||||
|
|
||||||
|
idols-debug: idols-ssh-key
|
||||||
|
colmena apply --on '@dist-build' --verbose --show-trace
|
||||||
|
|
||||||
|
# only used once to setup the virtual machines
|
||||||
|
idols-image:
|
||||||
|
# take image for idols, and upload the image to proxmox nodes.
|
||||||
|
nom build .#aquamarine
|
||||||
|
scp result root@gtr5:/var/lib/vz/dump/vzdump-qemu-aquamarine.vma.zst
|
||||||
|
|
||||||
|
nom build .#ruby
|
||||||
|
scp result root@s500plus:/var/lib/vz/dump/vzdump-qemu-ruby.vma.zst
|
||||||
|
|
||||||
|
nom build .#kana
|
||||||
|
scp result root@um560:/var/lib/vz/dump/vzdump-qemu-kana.vma.zst
|
||||||
|
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# RISC-V related commands
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
roll: idols-ssh-key
|
||||||
|
colmena apply --on '@riscv'
|
||||||
|
|
||||||
|
roll-debug: idols-ssh-key
|
||||||
|
colmena apply --on '@dist-build' --verbose --show-trace
|
||||||
|
|
||||||
|
nozomi:
|
||||||
|
colmena apply --on '@nozomi'
|
||||||
|
|
||||||
|
yukina:
|
||||||
|
colmena apply --on '@yukina'
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# Aarch64 related commands
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
aarch:
|
||||||
|
colmena apply --on '@aarch'
|
||||||
|
|
||||||
|
suzu:
|
||||||
|
colmena apply --on '@suzu'
|
||||||
|
|
||||||
|
suzu-debug:
|
||||||
|
colmena apply --on '@suzu' --verbose --show-trace
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# Misc, other useful commands
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
# format the nix files in this repo
|
||||||
|
nix fmt
|
||||||
|
|
||||||
|
nvim-test:
|
||||||
|
rm -rf $"($env.HOME)/.config/astronvim/lua/user"
|
||||||
|
rsync -avz --copy-links --chmod=D2755,F744 home/base/desktop/editors/neovim/astronvim_user/ $"($env.HOME)/.config/astronvim/lua/user"
|
||||||
|
|
||||||
|
nvim-clean:
|
||||||
|
rm -rf $"($env.HOME)/.config/astronvim/lua/user"
|
||||||
|
|
||||||
|
# =================================================
|
||||||
|
# Emacs related commands
|
||||||
|
# =================================================
|
||||||
|
|
||||||
|
emacs-plist-path := "~/Library/LaunchAgents/org.nix-community.home.emacs.plist"
|
||||||
|
|
||||||
|
reload-emacs-cmd := if os() == "macos" {
|
||||||
|
"launchctl unload " + emacs-plist-path
|
||||||
|
+ "\n"
|
||||||
|
+ "launchctl load " + emacs-plist-path
|
||||||
|
+ "\n"
|
||||||
|
+ "tail -f ~/Library/Logs/emacs-daemon.stderr.log"
|
||||||
|
} else {
|
||||||
|
"systemctl --user restart emacs.service"
|
||||||
|
+ "\n"
|
||||||
|
+ "systemctl --user status emacs.service"
|
||||||
|
}
|
||||||
|
|
||||||
|
emacs-test:
|
||||||
|
rm -rf $"($env.HOME)/.config/doom"
|
||||||
|
rsync -avz --copy-links --chmod=D2755,F744 home/base/desktop/editors/emacs/doom/ $"($env.HOME)/.config/doom"
|
||||||
|
doom clean
|
||||||
|
doom sync
|
||||||
|
|
||||||
|
emacs-clean:
|
||||||
|
rm -rf $"($env.HOME)/.config/doom/"
|
||||||
|
|
||||||
|
emacs-purge:
|
||||||
|
doom purge
|
||||||
|
doom clean
|
||||||
|
doom sync
|
||||||
|
|
||||||
|
emacs-reload:
|
||||||
|
doom sync
|
||||||
|
{{reload-emacs-cmd}}
|
||||||
@@ -1,161 +0,0 @@
|
|||||||
#
|
|
||||||
# NOTE: Makefile's target name should not be the same as one of the file or directory in the current directory,
|
|
||||||
# otherwise the target will not be executed!
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
#
|
|
||||||
# Nix commands related to the local machine
|
|
||||||
#
|
|
||||||
############################################################################
|
|
||||||
|
|
||||||
i3:
|
|
||||||
nixos-rebuild switch --flake .#ai_i3 --use-remote-sudo
|
|
||||||
|
|
||||||
s-i3:
|
|
||||||
nixos-rebuild switch --flake .#shoukei_i3 --use-remote-sudo
|
|
||||||
|
|
||||||
hypr:
|
|
||||||
nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo
|
|
||||||
|
|
||||||
s-hypr:
|
|
||||||
nixos-rebuild switch --flake .#shoukei_hyprland --use-remote-sudo
|
|
||||||
|
|
||||||
i3-debug:
|
|
||||||
nixos-rebuild switch --flake .#ai_i3 --use-remote-sudo --show-trace --verbose
|
|
||||||
|
|
||||||
hypr-debug:
|
|
||||||
nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo --show-trace --verbose
|
|
||||||
|
|
||||||
up:
|
|
||||||
nix flake update
|
|
||||||
|
|
||||||
# Update specific input
|
|
||||||
# usage: make upp i=wallpapers
|
|
||||||
upp:
|
|
||||||
nix flake lock --update-input $(i)
|
|
||||||
|
|
||||||
history:
|
|
||||||
nix profile history --profile /nix/var/nix/profiles/system
|
|
||||||
|
|
||||||
repl:
|
|
||||||
nix repl -f flake:nixpkgs
|
|
||||||
|
|
||||||
gc:
|
|
||||||
# remove all generations older than 7 days
|
|
||||||
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
|
|
||||||
|
|
||||||
# garbage collect all unused nix store entries
|
|
||||||
# sudo nix store gc --debug
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
#
|
|
||||||
# Darwin related commands, harmonica is my macbook pro's hostname
|
|
||||||
#
|
|
||||||
############################################################################
|
|
||||||
|
|
||||||
darwin-set-proxy:
|
|
||||||
sudo python3 scripts/darwin_set_proxy.py
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
darwin-rollback:
|
|
||||||
./result/sw/bin/darwin-rebuild rollback
|
|
||||||
|
|
||||||
ha: darwin-set-proxy
|
|
||||||
nix build .#darwinConfigurations.harmonica.system
|
|
||||||
./result/sw/bin/darwin-rebuild switch --flake .#harmonica
|
|
||||||
|
|
||||||
ha-debug: darwin-set-proxy
|
|
||||||
nom build .#darwinConfigurations.harmonica.system --show-trace --verbose
|
|
||||||
./result/sw/bin/darwin-rebuild switch --flake .#harmonica --show-trace --verbose
|
|
||||||
|
|
||||||
fe: darwin-set-proxy
|
|
||||||
nix build .#darwinConfigurations.fern.system
|
|
||||||
./result/sw/bin/darwin-rebuild switch --flake .#fern
|
|
||||||
|
|
||||||
fe-debug: darwin-set-proxy
|
|
||||||
nom build .#darwinConfigurations.fern.system --show-trace --verbose
|
|
||||||
./result/sw/bin/darwin-rebuild switch --flake .#fern --show-trace --verbose
|
|
||||||
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
#
|
|
||||||
# Idols, Commands related to my remote distributed building cluster
|
|
||||||
#
|
|
||||||
############################################################################
|
|
||||||
|
|
||||||
add-idols-ssh-key:
|
|
||||||
ssh-add ~/.ssh/ai-idols
|
|
||||||
|
|
||||||
idols: add-idols-ssh-key
|
|
||||||
colmena apply --on '@dist-build'
|
|
||||||
|
|
||||||
aqua:
|
|
||||||
colmena apply --on '@aqua'
|
|
||||||
|
|
||||||
ruby:
|
|
||||||
colmena apply --on '@ruby'
|
|
||||||
|
|
||||||
kana:
|
|
||||||
colmena apply --on '@kana'
|
|
||||||
|
|
||||||
idols-debug: add-idols-ssh-key
|
|
||||||
colmena apply --on '@dist-build' --verbose --show-trace
|
|
||||||
|
|
||||||
# only used once to setup the virtual machines
|
|
||||||
idols-image:
|
|
||||||
# take image for idols, and upload the image to proxmox nodes.
|
|
||||||
nom build .#aquamarine
|
|
||||||
scp result root@gtr5:/var/lib/vz/dump/vzdump-qemu-aquamarine.vma.zst
|
|
||||||
|
|
||||||
nom build .#ruby
|
|
||||||
scp result root@s500plus:/var/lib/vz/dump/vzdump-qemu-ruby.vma.zst
|
|
||||||
|
|
||||||
nom build .#kana
|
|
||||||
scp result root@um560:/var/lib/vz/dump/vzdump-qemu-kana.vma.zst
|
|
||||||
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
#
|
|
||||||
# RISC-V related commands
|
|
||||||
#
|
|
||||||
############################################################################
|
|
||||||
|
|
||||||
roll: add-idols-ssh-key
|
|
||||||
colmena apply --on '@riscv'
|
|
||||||
|
|
||||||
roll-debug: add-idols-ssh-key
|
|
||||||
colmena apply --on '@dist-build' --verbose --show-trace
|
|
||||||
|
|
||||||
nozomi:
|
|
||||||
colmena apply --on '@nozomi'
|
|
||||||
|
|
||||||
yukina:
|
|
||||||
colmena apply --on '@yukina'
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
#
|
|
||||||
# Aarch64 related commands
|
|
||||||
#
|
|
||||||
############################################################################
|
|
||||||
|
|
||||||
aarch:
|
|
||||||
colmena apply --on '@aarch'
|
|
||||||
|
|
||||||
suzu:
|
|
||||||
colmena apply --on '@suzu'
|
|
||||||
|
|
||||||
suzu-debug:
|
|
||||||
colmena apply --on '@suzu' --verbose --show-trace
|
|
||||||
|
|
||||||
############################################################################
|
|
||||||
#
|
|
||||||
# Misc, other useful commands
|
|
||||||
#
|
|
||||||
############################################################################
|
|
||||||
|
|
||||||
fmt:
|
|
||||||
# format the nix files in this repo
|
|
||||||
nix fmt
|
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ This repository is home to the nix code that builds my systems.
|
|||||||
|
|
||||||
## Why NixOS & Flakes?
|
## Why NixOS & Flakes?
|
||||||
|
|
||||||
Nix allows for easy-to-manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works (almost) forever. If someone else shares their configuration, anyone can make use of it(if you really understand what you're copying/refering now).
|
Nix allows for easy-to-manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works (almost) forever. If someone else shares their configuration, anyone else can just use it (if you really understand what you're copying/refering now).
|
||||||
|
|
||||||
As for Flakes, refer to [Introduction to Flakes - NixOS & Nix Flakes Book](https://nixos-and-flakes.thiscute.world/nixos-with-flakes/introduction-to-flakes)
|
As for Flakes, refer to [Introduction to Flakes - NixOS & Nix Flakes Book](https://nixos-and-flakes.thiscute.world/nixos-with-flakes/introduction-to-flakes)
|
||||||
|
|
||||||
@@ -31,8 +31,8 @@ As for Flakes, refer to [Introduction to Flakes - NixOS & Nix Flakes Book](https
|
|||||||
| | NixOS(Wayland) | NixOS(Xorg) |
|
| | NixOS(Wayland) | NixOS(Xorg) |
|
||||||
| --------------------------- | :---------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- |
|
| --------------------------- | :---------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- |
|
||||||
| **Window Manager** | [Hyprland][Hyprland] | [i3][i3] |
|
| **Window Manager** | [Hyprland][Hyprland] | [i3][i3] |
|
||||||
| **Terminal Emulator** | [Kitty][Kitty] | [Kitty][Kitty] |
|
| **Terminal Emulator** | [Zellij][Zellij] + [Kitty][Kitty] | [Zellij][Zellij] + [Kitty][Kitty] |
|
||||||
| **Bar** | [Waybar][Waybar] | [i3block][i3block] |
|
| **Bar** | [Waybar][Waybar] | [polybar][polybar] |
|
||||||
| **Application Launcher** | [anyrun][anyrun] | [rofi][rofi] |
|
| **Application Launcher** | [anyrun][anyrun] | [rofi][rofi] |
|
||||||
| **Notification Daemon** | [Mako][Mako] | [Dunst][Dunst] |
|
| **Notification Daemon** | [Mako][Mako] | [Dunst][Dunst] |
|
||||||
| **Display Manager** | [GDM][GDM] | [GDM][GDM] |
|
| **Display Manager** | [GDM][GDM] | [GDM][GDM] |
|
||||||
@@ -40,11 +40,11 @@ As for Flakes, refer to [Introduction to Flakes - NixOS & Nix Flakes Book](https
|
|||||||
| **network management tool** | [NetworkManager][NetworkManager] | [NetworkManager][NetworkManager] |
|
| **network management tool** | [NetworkManager][NetworkManager] | [NetworkManager][NetworkManager] |
|
||||||
| **Input method framework** | [Fcitx5][Fcitx5] | [Fcitx5][Fcitx5] |
|
| **Input method framework** | [Fcitx5][Fcitx5] | [Fcitx5][Fcitx5] |
|
||||||
| **System resource monitor** | [Btop][Btop] | [Btop][Btop] |
|
| **System resource monitor** | [Btop][Btop] | [Btop][Btop] |
|
||||||
| **File Manager** | [ranger][ranger] + [thunar][thunar] | [ranger][ranger] + [thunar][thunar] |
|
| **File Manager** | [Yazi][Yazi] + [thunar][thunar] | [Yazi][Yazi] + [thunar][thunar] |
|
||||||
| **Shell** | [Nushell][Nushell] + [Starship][Starship] | [Nushell][Nushell] + [Starship][Starship] |
|
| **Shell** | [Nushell][Nushell] + [Starship][Starship] | [Nushell][Nushell] + [Starship][Starship] |
|
||||||
| **Music Player** | [mpd][mpd], [ncmpcpp][ncmpcpp], [mpc][mpc], [Netease-cloud-music-gtk][netease-cloud-music-gtk] | [Netease-cloud-music-gtk][netease-cloud-music-gtk] |
|
| **Music Player** | [mpd][mpd], [ncmpcpp][ncmpcpp], [mpc][mpc], [Netease-cloud-music-gtk][netease-cloud-music-gtk] | [Netease-cloud-music-gtk][netease-cloud-music-gtk] |
|
||||||
| **Media Player** | [mpv][mpv] | [mpv][mpv] |
|
| **Media Player** | [mpv][mpv] | [mpv][mpv] |
|
||||||
| **Text Editor** | [Neovim][Neovim] | [Neovim][Neovim] |
|
| **Text Editor** | [Neovim][Neovim] + [DoomEmacs][DoomEmacs] | [Neovim][Neovim] + [DoomEmacs][DoomEmacs] |
|
||||||
| **Fonts** | [Nerd fonts][Nerd fonts] | [Nerd fonts][Nerd fonts] |
|
| **Fonts** | [Nerd fonts][Nerd fonts] | [Nerd fonts][Nerd fonts] |
|
||||||
| **Image Viewer** | [imv][imv] | [imv][imv] |
|
| **Image Viewer** | [imv][imv] | [imv][imv] |
|
||||||
| **Screenshot Software** | [grim][grim] | [flameshot](https://github.com/flameshot-org/flameshot) |
|
| **Screenshot Software** | [grim][grim] | [flameshot](https://github.com/flameshot-org/flameshot) |
|
||||||
@@ -67,7 +67,11 @@ Wallpapers: https://github.com/ryan4yin/wallpapers
|
|||||||
|
|
||||||
## Neovim
|
## Neovim
|
||||||
|
|
||||||
See [./home/base/desktop/neovim](./home/base/desktop/neovim) for details.
|
See [./home/base/desktop/editors/neovim/](./home/base/desktop/editors/neovim/) for details.
|
||||||
|
|
||||||
|
## Emacs
|
||||||
|
|
||||||
|
See [./home/base/desktop/editors/emacs/](./home/base/desktop/editors/emacs/) for details.
|
||||||
|
|
||||||
## Hosts
|
## Hosts
|
||||||
|
|
||||||
@@ -92,27 +96,27 @@ For NixOS:
|
|||||||
sudo nixos-rebuild switch --flake .#ai_i3
|
sudo nixos-rebuild switch --flake .#ai_i3
|
||||||
# sudo nixos-rebuild switch --flake .#ai_hyprland
|
# sudo nixos-rebuild switch --flake .#ai_hyprland
|
||||||
|
|
||||||
# we can also deploy using `make`, which is defined in Makefile
|
# deploy via `just`(a command runner with similar syntax to make) & Justfile
|
||||||
make i3 # deploy my pc with i3 window manager
|
just i3 # deploy my pc with i3 window manager
|
||||||
# make hypr # deploy my pc with hyprland compositor
|
# just hypr # deploy my pc with hyprland compositor
|
||||||
|
|
||||||
# or we can deploy with details
|
# or we can deploy with details
|
||||||
make i3-debug
|
just i3 debug
|
||||||
# make hypr-debug
|
# just hypr-debug
|
||||||
```
|
```
|
||||||
|
|
||||||
For macOS:
|
For macOS:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# deploy harmonicia's configuration(macOS Intel)
|
# deploy harmonicia's configuration(macOS Intel)
|
||||||
make ha
|
just ha
|
||||||
|
|
||||||
# deploy fern's configuration(Apple Silicon)
|
# deploy fern's configuration(Apple Silicon)
|
||||||
make fe
|
just fe
|
||||||
|
|
||||||
# deploy with details
|
# deploy with details
|
||||||
make ha-debug
|
just ha debug
|
||||||
# make fe
|
# just fe debug
|
||||||
```
|
```
|
||||||
|
|
||||||
> [What y'all will need when Nix drives you to drink.](https://www.youtube.com/watch?v=Eni9PPPPBpg) (copy from hlissner's dotfiles, it really matches my feelings when I first started using NixOS...)
|
> [What y'all will need when Nix drives you to drink.](https://www.youtube.com/watch?v=Eni9PPPPBpg) (copy from hlissner's dotfiles, it really matches my feelings when I first started using NixOS...)
|
||||||
@@ -180,15 +184,17 @@ Other dotfiles that inspired me:
|
|||||||
[Nushell]: https://github.com/nushell/nushell
|
[Nushell]: https://github.com/nushell/nushell
|
||||||
[Starship]: https://github.com/starship/starship
|
[Starship]: https://github.com/starship/starship
|
||||||
[Waybar]: https://github.com/Alexays/Waybar
|
[Waybar]: https://github.com/Alexays/Waybar
|
||||||
[i3block]: https://github.com/vivien/i3blocks
|
[polybar]: https://github.com/polybar/polybar
|
||||||
[rofi]: https://github.com/davatorium/rofi
|
[rofi]: https://github.com/davatorium/rofi
|
||||||
[anyrun]: https://github.com/Kirottu/anyrun
|
[anyrun]: https://github.com/Kirottu/anyrun
|
||||||
[Dunst]: https://github.com/dunst-project/dunst
|
[Dunst]: https://github.com/dunst-project/dunst
|
||||||
[Fcitx5]: https://github.com/fcitx/fcitx5
|
[Fcitx5]: https://github.com/fcitx/fcitx5
|
||||||
[Btop]: https://github.com/aristocratos/btop
|
[Btop]: https://github.com/aristocratos/btop
|
||||||
[mpv]: https://github.com/mpv-player/mpv
|
[mpv]: https://github.com/mpv-player/mpv
|
||||||
|
[Zellij]: https://github.com/zellij-org/zellij
|
||||||
[Neovim]: https://github.com/neovim/neovim
|
[Neovim]: https://github.com/neovim/neovim
|
||||||
[AstroNvim]: https://github.com/AstroNvim/AstroNvim
|
[AstroNvim]: https://github.com/AstroNvim/AstroNvim
|
||||||
|
[DoomEmacs]: https://github.com/doomemacs/doomemacs
|
||||||
[flameshot]: https://github.com/flameshot-org/flameshot
|
[flameshot]: https://github.com/flameshot-org/flameshot
|
||||||
[grim]: https://github.com/emersion/grim
|
[grim]: https://github.com/emersion/grim
|
||||||
[imv]: https://sr.ht/~exec64/imv/
|
[imv]: https://sr.ht/~exec64/imv/
|
||||||
@@ -204,7 +210,7 @@ Other dotfiles that inspired me:
|
|||||||
[wl-clipboard]: https://github.com/bugaevc/wl-clipboard
|
[wl-clipboard]: https://github.com/bugaevc/wl-clipboard
|
||||||
[GDM]: https://wiki.archlinux.org/title/GDM
|
[GDM]: https://wiki.archlinux.org/title/GDM
|
||||||
[thunar]: https://gitlab.xfce.org/xfce/thunar
|
[thunar]: https://gitlab.xfce.org/xfce/thunar
|
||||||
[ranger]: https://github.com/ranger/ranger
|
[Yazi]: https://github.com/sxyazi/yazi
|
||||||
[Catppuccin]: https://github.com/catppuccin/catppuccin
|
[Catppuccin]: https://github.com/catppuccin/catppuccin
|
||||||
[Btrfs]: https://btrfs.readthedocs.io
|
[Btrfs]: https://btrfs.readthedocs.io
|
||||||
[LUKS]: https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system
|
[LUKS]: https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system
|
||||||
|
|||||||
Generated
+124
-19
@@ -116,6 +116,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"doomemacs": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1702066305,
|
||||||
|
"narHash": "sha256-PdQD6f+TGgu0Nf/zvmJOHzrfLC50d4pWjK2dIQIizlw=",
|
||||||
|
"owner": "doomemacs",
|
||||||
|
"repo": "doomemacs",
|
||||||
|
"rev": "03d692f129633e3bf0bd100d91b3ebf3f77db6d1",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "doomemacs",
|
||||||
|
"repo": "doomemacs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -230,6 +246,24 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems_4"
|
"systems": "systems_4"
|
||||||
},
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681202837,
|
||||||
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_4": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_5"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1685518550,
|
"lastModified": 1685518550,
|
||||||
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
|
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
|
||||||
@@ -463,10 +497,10 @@
|
|||||||
"mysecrets": {
|
"mysecrets": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703047359,
|
"lastModified": 1703697935,
|
||||||
"narHash": "sha256-Wx4rpa+oTPMRgUcUkhUq4oKBvvPZR+4U1YMnRB6rAQU=",
|
"narHash": "sha256-tRwFFk6ICMlVAv8Ko4MV7FObX/cSeiZis2FcIFlw8uQ=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "4126e1894fbc8a2ce260def885dcc6ad558a52ca",
|
"rev": "a5143705420a687ad535fdcff4765ee409d6e494",
|
||||||
"shallow": true,
|
"shallow": true,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@github.com/ryan4yin/nix-secrets.git"
|
"url": "ssh://git@github.com/ryan4yin/nix-secrets.git"
|
||||||
@@ -702,6 +736,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1701436327,
|
||||||
|
"narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=",
|
||||||
|
"rev": "91050ea1e57e50388fa87a3302ba12d188ef723a",
|
||||||
|
"revCount": 555097,
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.555097%2Brev-91050ea1e57e50388fa87a3302ba12d188ef723a/018c3450-2363-7c34-883b-4ba70b1eb7ae/source.tar.gz"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_5": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702921762,
|
"lastModified": 1702921762,
|
||||||
"narHash": "sha256-O/rP7gulApQAB47u6szEd8Pn8Biw0d84j5iuP2tcxzY=",
|
"narHash": "sha256-O/rP7gulApQAB47u6szEd8Pn8Biw0d84j5iuP2tcxzY=",
|
||||||
@@ -717,16 +765,35 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nur-ryan4yin": {
|
"nuenv": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4",
|
||||||
|
"rust-overlay": "rust-overlay_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703077061,
|
"lastModified": 1701856726,
|
||||||
"narHash": "sha256-6jmjEXJe9mXLiGj/KpuyWp3AIxIh7uM/bIwmm9BHKEU=",
|
"narHash": "sha256-GIQWtr5dVjhiZ2EpIenB6igu6OrsScbLsNzlUd3KIJg=",
|
||||||
|
"owner": "DeterminateSystems",
|
||||||
|
"repo": "nuenv",
|
||||||
|
"rev": "6072a3a9b9fdb27a3d15e916c92b5bb4a3a5dac9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "DeterminateSystems",
|
||||||
|
"repo": "nuenv",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nur-ryan4yin": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_5"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1703782686,
|
||||||
|
"narHash": "sha256-nZ8eWb4NYAHn02eUF+PUgdx77vWOmtVxYHKC3eai0FM=",
|
||||||
"owner": "ryan4yin",
|
"owner": "ryan4yin",
|
||||||
"repo": "nur-packages",
|
"repo": "nur-packages",
|
||||||
"rev": "ad8927476f57f35db0e18ef0d80a4e6589582e0c",
|
"rev": "189eb3df8734c698edc5664f0a3bae68ece2a8dd",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -735,20 +802,19 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nushell-scripts": {
|
"polybar-themes": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702558950,
|
"lastModified": 1702566076,
|
||||||
"narHash": "sha256-pai3qeD2hmpx2r/lDfGpUY3mkl0gRN6j72gplz9DQD4=",
|
"narHash": "sha256-n5UcGHU/DQYezIma9w3zAQ2QZ7q6TmnbWYghT0EIETU=",
|
||||||
"owner": "nushell",
|
"owner": "adi1090x",
|
||||||
"repo": "nu_scripts",
|
"repo": "polybar-themes",
|
||||||
"rev": "6f1c0dfef203fa07449718b76d31580e8458c8b7",
|
"rev": "2a0e6ba8dd946de6d4e6a29a2d8e945a5e80c216",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nushell",
|
"owner": "adi1090x",
|
||||||
"ref": "main",
|
"repo": "polybar-themes",
|
||||||
"repo": "nu_scripts",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -819,7 +885,7 @@
|
|||||||
"pre-commit-hooks_2": {
|
"pre-commit-hooks_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat_2",
|
||||||
"flake-utils": "flake-utils_3",
|
"flake-utils": "flake-utils_4",
|
||||||
"gitignore": "gitignore_3",
|
"gitignore": "gitignore_3",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
@@ -845,6 +911,7 @@
|
|||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"anyrun": "anyrun",
|
"anyrun": "anyrun",
|
||||||
"astronvim": "astronvim",
|
"astronvim": "astronvim",
|
||||||
|
"doomemacs": "doomemacs",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"hyprland": "hyprland",
|
"hyprland": "hyprland",
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
@@ -858,8 +925,9 @@
|
|||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_3",
|
||||||
"nixpkgs-darwin": "nixpkgs-darwin",
|
"nixpkgs-darwin": "nixpkgs-darwin",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
|
"nuenv": "nuenv",
|
||||||
"nur-ryan4yin": "nur-ryan4yin",
|
"nur-ryan4yin": "nur-ryan4yin",
|
||||||
"nushell-scripts": "nushell-scripts",
|
"polybar-themes": "polybar-themes",
|
||||||
"pre-commit-hooks": "pre-commit-hooks_2",
|
"pre-commit-hooks": "pre-commit-hooks_2",
|
||||||
"wallpapers": "wallpapers"
|
"wallpapers": "wallpapers"
|
||||||
}
|
}
|
||||||
@@ -889,6 +957,28 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"rust-overlay_2": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils_3",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nuenv",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1701397143,
|
||||||
|
"narHash": "sha256-nYUJxZXwCWWVBYZXPgRxGDuQcZRhKTtD/Jp5Jl+9EWU=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "bb71557c93cad40f5921b2342d7fd69f9e6497ab",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689347949,
|
"lastModified": 1689347949,
|
||||||
@@ -949,6 +1039,21 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_5": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"thead-kernel": {
|
"thead-kernel": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|||||||
@@ -154,6 +154,8 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nuenv.url = "github:DeterminateSystems/nuenv";
|
||||||
|
|
||||||
######################## Some non-flake repositories #########################################
|
######################## Some non-flake repositories #########################################
|
||||||
|
|
||||||
# AstroNvim is an aesthetic and feature-rich neovim config.
|
# AstroNvim is an aesthetic and feature-rich neovim config.
|
||||||
@@ -161,10 +163,14 @@
|
|||||||
url = "github:AstroNvim/AstroNvim/v3.40.3";
|
url = "github:AstroNvim/AstroNvim/v3.40.3";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
# doom-emacs is a configuration framework for GNU Emacs.
|
||||||
|
doomemacs = {
|
||||||
|
url = "github:doomemacs/doomemacs";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
# useful nushell scripts, such as auto_completion
|
polybar-themes = {
|
||||||
nushell-scripts = {
|
url = "github:adi1090x/polybar-themes";
|
||||||
url = "github:nushell/nu_scripts/main";
|
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
# Home Manager's Base Submodules
|
# Home Manager's Base Submodules
|
||||||
|
|
||||||
2. `server`: Configuration which is suitable for both servers and desktops.
|
1. `server`: Configuration which is suitable for both servers and desktops.
|
||||||
1. `desktop`: Configuration for desktop environments, such as Hyprland, I3, etc.
|
1. `desktop`: Configuration for desktop environments, such as Hyprland, I3, etc.
|
||||||
1. it import `server` as its submodule.
|
1. `base.nix`: Common configuration for both servers and desktops.
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
home = {
|
home = {
|
||||||
inherit username;
|
inherit username;
|
||||||
|
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
# when a new Home Manager release introduces backwards
|
# when a new Home Manager release introduces backwards
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# general tools
|
# general tools
|
||||||
pulumi
|
pulumi
|
||||||
pulumictl
|
pulumictl
|
||||||
# istioctl
|
packer # machine image builder
|
||||||
|
|
||||||
# aws
|
# aws
|
||||||
awscli2
|
awscli2
|
||||||
|
|||||||
@@ -16,22 +16,6 @@
|
|||||||
|
|
||||||
home.packages = with pkgs;
|
home.packages = with pkgs;
|
||||||
[
|
[
|
||||||
(python3.withPackages (
|
|
||||||
ps:
|
|
||||||
with ps; [
|
|
||||||
ipython
|
|
||||||
pandas
|
|
||||||
requests
|
|
||||||
pyquery
|
|
||||||
pyyaml
|
|
||||||
]
|
|
||||||
))
|
|
||||||
|
|
||||||
cargo # rust package manager
|
|
||||||
go
|
|
||||||
jdk17
|
|
||||||
guile # scheme language
|
|
||||||
|
|
||||||
# db related
|
# db related
|
||||||
dbeaver
|
dbeaver
|
||||||
mycli
|
mycli
|
||||||
@@ -50,10 +34,10 @@
|
|||||||
glow # markdown previewer
|
glow # markdown previewer
|
||||||
fzf
|
fzf
|
||||||
gdu # disk usage analyzer, required by AstroNvim
|
gdu # disk usage analyzer, required by AstroNvim
|
||||||
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
|
|
||||||
bfg-repo-cleaner # remove large files from git history
|
bfg-repo-cleaner # remove large files from git history
|
||||||
k6 # load testing tool
|
k6 # load testing tool
|
||||||
protobuf # protocol buffer compiler
|
protobuf # protocol buffer compiler
|
||||||
|
nix-init # generate nix package from url
|
||||||
]
|
]
|
||||||
++ (
|
++ (
|
||||||
if pkgs.stdenv.isLinux
|
if pkgs.stdenv.isLinux
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
# Editors Glossary
|
||||||
|
|
||||||
|
### LSP - Language Server Protocol
|
||||||
|
|
||||||
|
> https://en.wikipedia.org/wiki/Language_Server_Protocol
|
||||||
|
|
||||||
|
> https://langserver.org/
|
||||||
|
|
||||||
|
The Language Server Protocol (LSP) is an open, JSON-RPC-based protocol for use between source code editors or integrated development environments (IDEs) and servers that provide programming language-specific features like:
|
||||||
|
|
||||||
|
- **code completion**
|
||||||
|
- **marking of warnings and errors**
|
||||||
|
- **refactoring routines**
|
||||||
|
- syntax highlighting (use Tree-sitter instead)
|
||||||
|
- code formatting (use a dedicated formatter instead)
|
||||||
|
|
||||||
|
The goal of the protocol is to allow programming language support to be implemented and distributed independently of any given editor or IDE.
|
||||||
|
|
||||||
|
LSP was originally developed for Microsoft Visual Studio Code and is now an open standard.
|
||||||
|
In the early 2020s LSP quickly became a "norm" for language intelligence tools providers.
|
||||||
|
|
||||||
|
### Tree-sitter
|
||||||
|
|
||||||
|
> https://tree-sitter.github.io/tree-sitter/
|
||||||
|
|
||||||
|
> https://www.reddit.com/r/neovim/comments/1109wgr/treesitter_vs_lsp_differences_ans_overlap/
|
||||||
|
|
||||||
|
Tree-sitter is a parser generator tool and an **incremental parsing** library. It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited.
|
||||||
|
|
||||||
|
It is used by many editors and IDEs to provide:
|
||||||
|
|
||||||
|
- **syntax highlighting**
|
||||||
|
- **indentation**
|
||||||
|
- **creating foldable code regions**
|
||||||
|
- **Incremental selection**
|
||||||
|
- **simple refactoring in a single file**
|
||||||
|
- such as join/split lines, structural editing, cursor motion, etc.
|
||||||
|
|
||||||
|
**Treesitter process each file independently**, and it is not aware of the semantics of your code.
|
||||||
|
For example, it does not know does a function/variable really exist, or what is the type/return-type of a variable. This is where LSP comes in.
|
||||||
|
|
||||||
|
The LSP server parses the code much more deeply and it **not only parses a single file but your whole project**.
|
||||||
|
So, the LSP server will know whether a function/variable does exist with the same type/return-type. If it does not, it will mark it as an error.
|
||||||
|
|
||||||
|
**LSP does understand the code semantically, while Treesitter only cares about correct syntax**.
|
||||||
|
|
||||||
|
#### LSP vs Tree-sitter
|
||||||
|
|
||||||
|
- Tree-sitter: lightweight, fast, but limited knowledge of your code. mainly used for **syntax highlighting, indentation, and folding/refactoring in a single file**.
|
||||||
|
- LSP: heavy and slow on large projects, but it has a deep understanding of your code. mainly used for **code completion, refactoring in the projects, errors/warnings, and other semantic-aware features**.
|
||||||
|
|
||||||
|
### Formatter vs Linter
|
||||||
|
|
||||||
|
Linting is distinct from Formatting because:
|
||||||
|
|
||||||
|
1. **formatting** only restructures how code appears.
|
||||||
|
1. `prettier` is a popular formatter.
|
||||||
|
1. **linting** analyzes how the code runs and detects errors, it may also suggest improvements such as replace `var` with `let` or `const`.
|
||||||
|
|
||||||
|
Formatters and Linters process each file independently, they do not need to know about other files in the project.
|
||||||
|
* [ ]
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
# Editors
|
||||||
|
|
||||||
|
My editors:
|
||||||
|
|
||||||
|
1. Neovim
|
||||||
|
2. Emacs
|
||||||
|
3. Helix
|
||||||
|
|
||||||
|
And `Zellij` for a smooth and stable terminal experience.
|
||||||
|
|
||||||
|
## Tutorial
|
||||||
|
|
||||||
|
Type `:tutor`(`:Tutor` in Neovim) to learn the basics usage of vim/neovim.
|
||||||
|
|
||||||
|
## VIM's Cheetsheet
|
||||||
|
|
||||||
|
> Here only record my commonly used keyboard keys, to see **a more comprehensive cheetsheet**: <https://github.com/rtorr/vim-cheat-sheet>
|
||||||
|
|
||||||
|
Both Emacs-Evil & Neovim are compatible with vim, sothe key-bindings described here are common in both Emacs-Evil, Neovim & vim.
|
||||||
|
|
||||||
|
### Terminal Related
|
||||||
|
|
||||||
|
I mainly use Zellij for terminal related operations, here is its terminal shortcuts I use frequently now:
|
||||||
|
|
||||||
|
| Action | Zellij's Shortcut |
|
||||||
|
| ------------------------- | ----------------- |
|
||||||
|
| Floating Terminal | `Ctrl + p + w` |
|
||||||
|
| Horizontal Split Terminal | `Ctrl + p + d` |
|
||||||
|
| Vertical Split Terminal | `Ctrl + p + n` |
|
||||||
|
|
||||||
|
### File Management
|
||||||
|
|
||||||
|
| Action | |
|
||||||
|
| --------------------------------- | -------------------------------------------- |
|
||||||
|
| Save selected text to a file | `:w filename` (Will show `:'<,'>w filename`) |
|
||||||
|
| Save and close the current buffer | `:wq` |
|
||||||
|
| Save all buffers | `:wa` |
|
||||||
|
| Save and close all buffers | `:wqa` |
|
||||||
|
|
||||||
|
### Text Manipulation
|
||||||
|
|
||||||
|
Basics:
|
||||||
|
|
||||||
|
| Action | |
|
||||||
|
| --------------------------------------------------- | ------------------------------ |
|
||||||
|
| Move to the start/end of the buffer | `gg`/`G` |
|
||||||
|
| Move the line number 5 | `5gg` / `5G` |
|
||||||
|
| Move left/down/up/right | h/j/k/l or `5h`/`5j`/`5k`/`5l` |
|
||||||
|
| Move to the matchpairs, default to `()`, `{}`, `[]` | `%` |
|
||||||
|
| Delete the current character | `x` |
|
||||||
|
| Delete the selection | `d` |
|
||||||
|
| Undo the last change | `u` |
|
||||||
|
| Redo the last change | `Ctrl + r` |
|
||||||
|
|
||||||
|
Convert Text Cases:
|
||||||
|
|
||||||
|
| Toggle text's case | `~` |
|
||||||
|
| Convert to uppercase | `U` |
|
||||||
|
| Convert to lowercase | `u` |
|
||||||
|
|
||||||
|
Misc:
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ----------------------------- | ---------------------------------------- |
|
||||||
|
| Toggle visual mode | `v` (lower case v) |
|
||||||
|
| Select the current line | `V` (upper case v) |
|
||||||
|
| Toggle visual block mode | `<Ctrl> + v` (select a block vertically) |
|
||||||
|
| Fold the current code block | `zc` |
|
||||||
|
| Unfold the current code block | `zo` |
|
||||||
|
| Jump to Definition | `gd` |
|
||||||
|
| Jump to References | `gD` |
|
||||||
|
| (Un)Comment the current line | `gcc` |
|
||||||
|
|
||||||
|
| Action | |
|
||||||
|
| ------------------------------------------------------------------------- | -------------- |
|
||||||
|
| Join Selection of Lines With Space | `:join` or `J` |
|
||||||
|
| Join without spaces | `:join!` |
|
||||||
|
| Move to the start/end of the line | `0` / `$` |
|
||||||
|
| Enter Insert mode at the start/end of the line | `I` / `A` |
|
||||||
|
| Delete from the cursor to the end of the line | `D` |
|
||||||
|
| Delete from the cursor to the end of the line, and then enter insert mode | `C` |
|
||||||
|
|
||||||
|
Advance Techs:
|
||||||
|
|
||||||
|
- Add at the end of multiple lines: `:normal A<text>`
|
||||||
|
|
||||||
|
- Execublock: `:A<text>`
|
||||||
|
- visual block mode(ctrl + v)
|
||||||
|
- Append text at the end of each line in the selected block
|
||||||
|
- If position exceeds line end, neovim adds spaces automatically
|
||||||
|
|
||||||
|
- Delete the last char of multivle lines: `:normal $x`
|
||||||
|
|
||||||
|
- Execute `$x` on each line
|
||||||
|
- visual mode(v)
|
||||||
|
- `$` moves cursor to the end of line
|
||||||
|
- `x` deletes the character under the cursor
|
||||||
|
|
||||||
|
- Delete the last word of multiple lines: `:normal $bD`
|
||||||
|
- Execute `$bD` on each line
|
||||||
|
- visual mode(v)
|
||||||
|
- `$` moves cursor to the end of line
|
||||||
|
- `b` moves cursor to the beginning of the last word
|
||||||
|
|
||||||
|
### Search
|
||||||
|
|
||||||
|
| Action | Command |
|
||||||
|
| ----------------------------------------------------- | --------- |
|
||||||
|
| Search forward/backword for a pattern | `/` / `?` |
|
||||||
|
| Repeat the last search in the same/opposite direction | `n` / `N` |
|
||||||
|
|
||||||
|
### Find and Replace
|
||||||
|
|
||||||
|
| Action | Command |
|
||||||
|
| ------------------------ | ----------------------------------- |
|
||||||
|
| Replace in selected area | `:s/old/new/g` |
|
||||||
|
| Replace in current line | Same as above |
|
||||||
|
| Replace in whole file | `:% s/old/new/g` |
|
||||||
|
| Replace with regex | `:% s@\vhttp://(\w+)@https://\1@gc` |
|
||||||
|
|
||||||
|
1. `\v` means means that in the regex pattern after it can be used without backslash escaping(similar to python's raw string).
|
||||||
|
2. `\1` means the first matched group in the pattern.
|
||||||
|
|
||||||
|
### Replace in the specific lines
|
||||||
|
|
||||||
|
| Action | Command |
|
||||||
|
| ----------------------------------------- | -------------------------------------- |
|
||||||
|
| From the 10th line to the end of the file | `:10,$ s/old/new/g` or `:10,$ s@^@#@g` |
|
||||||
|
| From the 10th line to the 20th line | `:10,20 s/old/new/g` |
|
||||||
|
|
||||||
|
The postfix(flags) in the above commands:
|
||||||
|
|
||||||
|
1. `g` means replace all the matched strings in the current line/file.
|
||||||
|
2. `c` means ask for confirmation before replacing.
|
||||||
|
3. `i` means ignore case.
|
||||||
|
|
||||||
|
### Buffers, Windows and Tabs
|
||||||
|
|
||||||
|
- A buffer is the in-memory text of a file.
|
||||||
|
- A window is a viewport on a buffer.
|
||||||
|
- A tab page is a collection of windows.
|
||||||
|
|
||||||
|
| Action | Command |
|
||||||
|
| ----------------------------------- | ----------------------------------- |
|
||||||
|
| Show all buffers | `:ls` |
|
||||||
|
| show next/previous buffer | `]b`/`[b` or `:bn[ext]` / `bp[rev]` |
|
||||||
|
| Split the window horizontally | `:sp[lit]` |
|
||||||
|
| Split the window horizontally | `:vs[plit]` |
|
||||||
|
| New Tab(New Workspace in DoomEmacs) | `:tabnew` |
|
||||||
|
| Next/Previews Tab | `gt`/`gT` |
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# Structured Editing
|
||||||
|
|
||||||
|
## S-expression data(Lisp)
|
||||||
|
|
||||||
|
- paredit/[lispy](https://github.com/doomemacs/doomemacs/tree/master/modules/editor/lispy): too complex.
|
||||||
|
- [evil-cleverparens](https://github.com/emacs-evil/evil-cleverparens): simple and useful.
|
||||||
|
- [parinfer(par-in-fer)](https://shaunlebron.github.io/parinfer/): morden, simple, elegant and useful, but works not well with some other completion plugins...
|
||||||
|
- to make parinfer works, you should disable sexp & smartparens in any lisp mode.
|
||||||
|
|
||||||
|
Some plugins:
|
||||||
|
|
||||||
|
- Emacs
|
||||||
|
- [parinfer-rust-mode](https://github.com/justinbarclay/parinfer-rust-mode)
|
||||||
|
- Neovim
|
||||||
|
- [parinfer-rust](https://github.com/eraserhd/parinfer-rust)
|
||||||
|
- <https://github.com/Olical/conjure>
|
||||||
|
- Helix
|
||||||
|
- [parinfer #4090 - Helix](https://github.com/helix-editor/helix/discussions/4090)
|
||||||
|
|
||||||
|
## Other Languages
|
||||||
|
|
||||||
|
1. treesitter
|
||||||
|
1. ...
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{mylib, ...}: {
|
||||||
|
imports = mylib.scanPaths ./.;
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
# Emacs Editor
|
||||||
|
|
||||||
|
- Framework: <https://github.com/doomemacs/doomemacs>
|
||||||
|
- key bindings:
|
||||||
|
- source code: <https://github.com/doomemacs/doomemacs/blob/master/modules/config/default/%2Bevil-bindings.el>
|
||||||
|
- docs: <https://github.com/doomemacs/doomemacs/blob/master/modules/editor/evil/README.org>
|
||||||
|
- module index: <https://github.com/doomemacs/doomemacs/blob/master/docs/modules.org>
|
||||||
|
- Chinese(rime) support: <https://github.com/DogLooksGood/emacs-rime>
|
||||||
|
- modal editing:
|
||||||
|
- <https://github.com/emacs-evil/evil>: evil mode, enabled by default in doom-emacs.
|
||||||
|
- <https://github.com/meow-edit/meow>
|
||||||
|
- LSP Client: <https://github.com/manateelazycat/lsp-bridge>
|
||||||
|
- Emacs Wiki: <https://www.emacswiki.org/emacs/SiteMap>
|
||||||
|
- Awesome Emacs: <https://github.com/emacs-tw/awesome-emacs#lsp-client>
|
||||||
|
|
||||||
|
## Why emacs?
|
||||||
|
|
||||||
|
1. Explore the unknown, just for fun!
|
||||||
|
2. Org Mode
|
||||||
|
3. Lisp Coding
|
||||||
|
|
||||||
|
## Install or Update
|
||||||
|
|
||||||
|
After deploying this nix flake, run the following command to install or update emacs:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
doom sync
|
||||||
|
```
|
||||||
|
|
||||||
|
when in doubt, run `doom sync`!
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
> via `Justfile` located at the root of this repo.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# testing
|
||||||
|
just emacs-test
|
||||||
|
jsut emacs-purge
|
||||||
|
just emacs-reload
|
||||||
|
|
||||||
|
# clear test data
|
||||||
|
just emacs-clear
|
||||||
|
```
|
||||||
|
|
||||||
|
## Cheetsheet
|
||||||
|
|
||||||
|
Here is the cheetsheet related to my DoomEmacs configs. Please read vim's common cheetsheet at [../README.md](../README.md) before reading the following.
|
||||||
|
|
||||||
|
### Basics
|
||||||
|
|
||||||
|
> Terminal(vterm) is useful in GUI mode, I use Zellij instead in terminal mode.
|
||||||
|
|
||||||
|
> We can run any emacs command via `M-x`(Alt + x).
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ---------------------- | ------------- |
|
||||||
|
| Popup Terminal(vterm) | `SPC + o + t` |
|
||||||
|
| Open Terminal | `SPC + o + T` |
|
||||||
|
| Open file tree sidebar | `SPC + o + p` |
|
||||||
|
| Exit | `M-x C-c` |
|
||||||
|
|
||||||
|
### Window Navigation
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ------------------------------------------ | --------------------------------------------------------------------- |
|
||||||
|
| Split a window vertically and horizontally | `SPC w v/s` |
|
||||||
|
| Move to a window in a specific direction | `Ctrl-w + h/j/k/l` |
|
||||||
|
| Move a window to a specific direction | `Ctrl-w + H/J/K/L` |
|
||||||
|
| Move to the next window | `SPC w w` |
|
||||||
|
| Close the current window | `SPC w q` |
|
||||||
|
| Rebalance all windows | `SPC w =` |
|
||||||
|
| Set window's width(columns) | `80 SPC w \|` (the Vertical line is escaped due to markdown's limits) |
|
||||||
|
| Set window's height | `30 SPC w _ ` |
|
||||||
|
|
||||||
|
### File Tree
|
||||||
|
|
||||||
|
- treemacs: <https://github.com/Alexander-Miller/treemacs/blob/master/src/elisp/treemacs-mode.el>
|
||||||
|
- treemacs-evil: <https://github.com/Alexander-Miller/treemacs/blob/master/src/extra/treemacs-evil.el>
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ------------------------------------- | --------- |
|
||||||
|
| Resize Treemacs's window | `>` & `<` |
|
||||||
|
| Extra Wide Window | `W` |
|
||||||
|
| Rename | `R` |
|
||||||
|
| Delete File/Direcoty | `d` |
|
||||||
|
| New File | `cf` |
|
||||||
|
| New Directory | `cd` |
|
||||||
|
| Go to parent | `u` |
|
||||||
|
| Run shell command in for current node | `!` |
|
||||||
|
| Refresh file tree | `gr` |
|
||||||
|
| Copy project-path into pasteboard | `yp` |
|
||||||
|
| Copy absolute-path into pasteboard | `ya` |
|
||||||
|
| Copy relative-path into pasteboard | `yr` |
|
||||||
|
| Copy file to another location | `yf` |
|
||||||
|
| Move file to another location | `m` |
|
||||||
|
| quit | `q` |
|
||||||
|
|
||||||
|
And bookmarks:
|
||||||
|
|
||||||
|
- Add bookmarks in treemacs: `b`
|
||||||
|
- Show Bookmark List: `SPC s m`
|
||||||
|
|
||||||
|
### Splitting and Buffers
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ----------------------- | ----------------- |
|
||||||
|
| Buffer List | `<Space> + ,` |
|
||||||
|
| Save all buffers(Tab) | `<Space> + b + S` |
|
||||||
|
| Kill the current buffer | `<Space> + b + k` |
|
||||||
|
| Kill all buffers | `<Space> + b + K` |
|
||||||
|
|
||||||
|
### Editing and Formatting
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ------------------------------------------ | ------------------- |
|
||||||
|
| Format Document | `<Space> + cf` |
|
||||||
|
| Code Actions | `<Space> + ca` |
|
||||||
|
| Rename | `<Space> + cr` |
|
||||||
|
| Opening LSP symbols | `<Space> + cS` |
|
||||||
|
| Show all LSP Errors | `<Space> + c + x/X` |
|
||||||
|
| Show infinite undo history(really useful!) | `<Space> + s + u` |
|
||||||
|
| Open filepath/URL at cursor | `gf` |
|
||||||
|
| Find files by keyword in path | `<Space> + <Space>` |
|
||||||
|
| Grep string in files (vertico + ripgrep) | `<Space> + sd` |
|
||||||
|
|
||||||
|
### Image Preview(GUI mode only)
|
||||||
|
|
||||||
|
Use `-`, `+` to resize the image, `r` to rotate the image.
|
||||||
|
|
||||||
|
### Search & replace
|
||||||
|
|
||||||
|
```bash
|
||||||
|
SPC s p foo C-; E C-c C-p :%s/foo/bar/g RET Z Z
|
||||||
|
```
|
||||||
|
|
||||||
|
1. `SPC s p`: search in project
|
||||||
|
1. `foo`: the keyword to search
|
||||||
|
1. `C-; E`: exports what you’re looking at into a new buffer in grep-mode
|
||||||
|
1. `C-c C-p` to run wgrep-change-to-wgrep-mode to make the search results writable.
|
||||||
|
1. `:%s/foo/bar/g RET`: replace in the current buffer(just like neovim/vim)
|
||||||
|
1. `Z Z`: to write all the changes to their respective files
|
||||||
|
|
||||||
|
### Projects
|
||||||
|
|
||||||
|
> easily switch between projects without exit emacs!
|
||||||
|
|
||||||
|
| Action | |
|
||||||
|
| -------------------------- | ------------- |
|
||||||
|
| Switch between projects | `SPC + p + p` |
|
||||||
|
| Browse the current project | `SPC + p + .` |
|
||||||
|
| Add new project | `SPC + p + a` |
|
||||||
|
|
||||||
|
### Workspaces
|
||||||
|
|
||||||
|
> Very useful when run emacs in daemon/client modes
|
||||||
|
|
||||||
|
| Action | |
|
||||||
|
| --------------------------- | --------------------------- |
|
||||||
|
| Switch between workspaces | `M-1/2/3/...`(Alt-1/2/3/..) |
|
||||||
|
| New Workspace | `SPC + TAB + n` |
|
||||||
|
| New Named Workspace | `SPC + TAB + N` |
|
||||||
|
| Delete Workspace | `SPC + TAB + d` |
|
||||||
|
| Display Workspaces bar blow | `SPC + TAB + TAB` |
|
||||||
@@ -0,0 +1,136 @@
|
|||||||
|
# ==============================================
|
||||||
|
# Based on doomemacs's auther's config:
|
||||||
|
# https://github.com/hlissner/dotfiles/blob/master/modules/editors/emacs.nix
|
||||||
|
#
|
||||||
|
# Emacs Tutorials:
|
||||||
|
# 1. Official: <https://www.gnu.org/software/emacs/tour/index.html>
|
||||||
|
# 2. Doom Emacs: <https://github.com/doomemacs/doomemacs/blob/master/docs/index.org>
|
||||||
|
#
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
doomemacs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.modules.editors.emacs;
|
||||||
|
envExtra = ''
|
||||||
|
export PATH="${config.xdg.configHome}/emacs/bin:$PATH"
|
||||||
|
'';
|
||||||
|
shellAliases = {
|
||||||
|
e = "emacsclient --create-frame"; # gui
|
||||||
|
et = "emacsclient --create-frame --tty"; # termimal
|
||||||
|
};
|
||||||
|
librime-dir = "${config.xdg.dataHome}/emacs/librime";
|
||||||
|
parinfer-rust-lib-dir = "${config.xdg.dataHome}/emacs/parinfer-rust";
|
||||||
|
in {
|
||||||
|
options.modules.editors.emacs = {
|
||||||
|
enable = mkEnableOption "Emacs Editor";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
{
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
## Doom dependencies
|
||||||
|
git
|
||||||
|
(ripgrep.override {withPCRE2 = true;})
|
||||||
|
gnutls # for TLS connectivity
|
||||||
|
|
||||||
|
## Optional dependencies
|
||||||
|
fd # faster projectile indexing
|
||||||
|
imagemagick # for image-dired
|
||||||
|
zstd # for undo-fu-session/undo-tree compression
|
||||||
|
|
||||||
|
# go-mode
|
||||||
|
gocode
|
||||||
|
|
||||||
|
## Module dependencies
|
||||||
|
# :checkers spell
|
||||||
|
(aspellWithDicts (ds: with ds; [en en-computers en-science]))
|
||||||
|
# :tools editorconfig
|
||||||
|
editorconfig-core-c # per-project style config
|
||||||
|
# :tools lookup & :lang org +roam
|
||||||
|
sqlite
|
||||||
|
# :lang latex & :lang org (latex previews)
|
||||||
|
texlive.combined.scheme-medium
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.bash.bashrcExtra = envExtra;
|
||||||
|
programs.zsh.envExtra = envExtra;
|
||||||
|
home.shellAliases = shellAliases;
|
||||||
|
programs.nushell.shellAliases = shellAliases;
|
||||||
|
|
||||||
|
# allow fontconfig to discover fonts and configurations installed through `home.packages`
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
|
xdg.configFile."doom" = {
|
||||||
|
source = ./doom;
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."emacs/lsp-bridge-user-langserver" = {
|
||||||
|
source = ./lsp-bridge-user-langserver;
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.activation.installDoomEmacs = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
|
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${doomemacs}/ ${config.xdg.configHome}/emacs/
|
||||||
|
|
||||||
|
# librime for emacs-rime
|
||||||
|
mkdir -p ${librime-dir}
|
||||||
|
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${pkgs.librime}/ ${librime-dir}/
|
||||||
|
|
||||||
|
# libparinfer_rust for emacs' parinfer-rust-mode
|
||||||
|
mkdir -p ${parinfer-rust-lib-dir}
|
||||||
|
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${pkgs.vimPlugins.parinfer-rust}/lib/libparinfer_rust.* ${parinfer-rust-lib-dir}/parinfer-rust.so
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
(mkIf pkgs.stdenv.isLinux (
|
||||||
|
let
|
||||||
|
# Do not use emacs-nox here, which makes the mouse wheel work abnormally in terminal mode.
|
||||||
|
# pgtk (pure gtk) build add native support for wayland.
|
||||||
|
# https://www.gnu.org/savannah-checkouts/gnu/emacs/emacs.html#Releases
|
||||||
|
emacsPkg = (pkgs.emacsPackagesFor pkgs.emacs29-pgtk).emacsWithPackages (epkgs: [epkgs.vterm]);
|
||||||
|
in {
|
||||||
|
home.packages = [emacsPkg];
|
||||||
|
services.emacs = {
|
||||||
|
enable = true;
|
||||||
|
package = emacsPkg;
|
||||||
|
client = {
|
||||||
|
enable = true;
|
||||||
|
arguments = [" --create-frame"];
|
||||||
|
};
|
||||||
|
startWithUserSession = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
))
|
||||||
|
|
||||||
|
(mkIf pkgs.stdenv.isDarwin (
|
||||||
|
let
|
||||||
|
# macport adds some native features based on GNU Emacs 29
|
||||||
|
# https://bitbucket.org/mituharu/emacs-mac/src/master/README-mac
|
||||||
|
emacsPkg = (pkgs.emacsPackagesFor pkgs.emacs29-macport).emacsWithPackages (epkgs: [epkgs.vterm]);
|
||||||
|
in {
|
||||||
|
home.packages = [emacsPkg];
|
||||||
|
launchd.enable = true;
|
||||||
|
launchd.agents.emacs = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
ProgramArguments = [
|
||||||
|
"${pkgs.bash}/bin/bash"
|
||||||
|
"-l"
|
||||||
|
"-c"
|
||||||
|
"${emacsPkg}/bin/emacs --fg-daemon"
|
||||||
|
];
|
||||||
|
StandardErrorPath = "${config.home.homeDirectory}/Library/Logs/emacs-daemon.stderr.log";
|
||||||
|
StandardOutPath = "${config.home.homeDirectory}/Library/Logs/emacs-daemon.stdout.log";
|
||||||
|
RunAtLoad = true;
|
||||||
|
KeepAlive = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
))
|
||||||
|
]);
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Place your private configuration here! Remember, you do not need to run 'doom
|
||||||
|
;; sync' after modifying this file!
|
||||||
|
|
||||||
|
|
||||||
|
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
||||||
|
;; clients, file templates and snippets. It is optional.
|
||||||
|
;; (setq user-full-name "John Doe"
|
||||||
|
;; user-mail-address "john@doe.com")
|
||||||
|
|
||||||
|
;; Doom exposes five (optional) variables for controlling fonts in Doom:
|
||||||
|
;;
|
||||||
|
;; - `doom-font' -- the primary font to use
|
||||||
|
;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable)
|
||||||
|
;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for
|
||||||
|
;; presentations or streaming.
|
||||||
|
;; - `doom-symbol-font' -- for symbols
|
||||||
|
;; - `doom-serif-font' -- for the `fixed-pitch-serif' face
|
||||||
|
;;
|
||||||
|
;; See 'C-h v doom-font' for documentation and more examples of what they
|
||||||
|
;; accept. For example:
|
||||||
|
;;
|
||||||
|
(setq doom-font (font-spec :family "JetBrainsMono Nerd Font" :size 18 :weight 'normal)
|
||||||
|
doom-variable-pitch-font (font-spec :family "DejaVu Sans")
|
||||||
|
doom-symbol-font (font-spec :family "Symbols Nerd Font Mono")
|
||||||
|
doom-big-font (font-spec :family "JetBrainsMono Nerd Font" :size 28))
|
||||||
|
|
||||||
|
;; Users should inject their own font logic in `after-setting-font-hook'
|
||||||
|
;; Add font for CJK charset
|
||||||
|
(defun init-cjk-fonts()
|
||||||
|
(dolist (charset '(kana han cjk-misc bopomofo))
|
||||||
|
(set-fontset-font (frame-parameter nil 'font)
|
||||||
|
charset (font-spec :family "Source Han Sans SC"))))
|
||||||
|
(add-hook 'after-setting-font-hook 'init-cjk-fonts)
|
||||||
|
|
||||||
|
|
||||||
|
;; If you or Emacs can't find your font, use 'M-x describe-font' to look them
|
||||||
|
;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to
|
||||||
|
;; refresh your font settings. If Emacs still can't find your font, it likely
|
||||||
|
;; wasn't installed correctly. Font issues are rarely Doom issues!
|
||||||
|
|
||||||
|
;; There are two ways to load a theme. Both assume the theme is installed and
|
||||||
|
;; available. You can either set `doom-theme' or manually load a theme with the
|
||||||
|
;; `load-theme' function. This is the default:
|
||||||
|
;; other doom's official themes:
|
||||||
|
;; https://github.com/doomemacs/themes
|
||||||
|
(setq doom-theme 'doom-dracula) ;; doom-one doom-dracula doom-nord
|
||||||
|
;; Transparent Background
|
||||||
|
(set-frame-parameter nil 'alpha-background 93) ; For current frame
|
||||||
|
(add-to-list 'default-frame-alist '(alpha-background . 93)); For all new frames henceforth
|
||||||
|
;; This determines the style of line numbers in effect. If set to `nil', line
|
||||||
|
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
||||||
|
(setq display-line-numbers-type t)
|
||||||
|
(setq warning-minimum-level :error)
|
||||||
|
;; If you use `org' and don't want your org files in the default location below,
|
||||||
|
;; change `org-directory'. It must be set before org loads!
|
||||||
|
(setq org-directory "~/org/")
|
||||||
|
;; Whenever you reconfigure a package, make sure to wrap your config in an
|
||||||
|
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
|
||||||
|
;;
|
||||||
|
;; (after! PACKAGE
|
||||||
|
;; (setq x y))
|
||||||
|
;;
|
||||||
|
;; The exceptions to this rule:
|
||||||
|
;;
|
||||||
|
;; - Setting file/directory variables (like `org-directory')
|
||||||
|
;; - Setting variables which explicitly tell you to set them before their
|
||||||
|
;; package is loaded (see 'C-h v VARIABLE' to look up their documentation).
|
||||||
|
;; - Setting doom variables (which start with 'doom-' or '+').
|
||||||
|
;;
|
||||||
|
;; Here are some additional functions/macros that will help you configure Doom.
|
||||||
|
;;
|
||||||
|
;; - `load!' for loading external *.el files relative to this one
|
||||||
|
;; - `use-package!' for configuring packages
|
||||||
|
;; - `after!' for running code after a package has loaded
|
||||||
|
;; - `add-load-path!' for adding directories to the `load-path', relative to
|
||||||
|
;; this file. Emacs searches the `load-path' when you load packages with
|
||||||
|
;; `require' or `use-package'.
|
||||||
|
;; - `map!' for binding new keys
|
||||||
|
;;
|
||||||
|
;; To get information about any of these functions/macros, move the cursor over
|
||||||
|
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
|
||||||
|
;; This will open documentation for it, including demos of how they are used.
|
||||||
|
;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces,
|
||||||
|
;; etc).
|
||||||
|
;;
|
||||||
|
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
||||||
|
;; they are implemented.
|
||||||
|
|
||||||
|
(use-package! lsp-bridge
|
||||||
|
:config
|
||||||
|
(setq lsp-bridge-enable-log nil) ;; disabled for performance
|
||||||
|
;; for user's custom langserver file
|
||||||
|
(setq lsp-bridge-user-langserver-dir "~/.config/emacs/lsp-bridge-user-langserver")
|
||||||
|
(setq lsp-bridge-enable-auto-format-code 1)
|
||||||
|
(global-lsp-bridge-mode))
|
||||||
|
|
||||||
|
(use-package! wakatime-mode :ensure t)
|
||||||
|
;; fully enable tree-sitter highlighting
|
||||||
|
(after! tree-sitter
|
||||||
|
(setq +tree-sitter-hl-enabled-modes t))
|
||||||
|
;; fix: https://github.com/jrblevin/markdown-mode/issues/380
|
||||||
|
;; even add this one, editing a large markdown table is still very slow.
|
||||||
|
;; so avoid editing large markdown file in emacs, use neovim instead...
|
||||||
|
(after! markdown-mode
|
||||||
|
(global-font-lock-mode 0))
|
||||||
|
|
||||||
|
;; use alejandra to format nix files
|
||||||
|
;; (use-package! lsp-nix
|
||||||
|
;; :ensure lsp-mode
|
||||||
|
;; :after
|
||||||
|
;; (lsp-mode)
|
||||||
|
;; :demand t
|
||||||
|
;; :custom
|
||||||
|
;; (lsp-nix-nil-formatter
|
||||||
|
;; ["alejandra"]))
|
||||||
|
(use-package! nushell-mode
|
||||||
|
:config
|
||||||
|
(setq nushell-enable-auto-indent 1))
|
||||||
|
|
||||||
|
;; emacs-rime
|
||||||
|
(use-package! rime
|
||||||
|
:custom
|
||||||
|
(default-input-method "rime")
|
||||||
|
(rime-librime-root "~/.local/share/emacs/librime"))
|
||||||
|
|
||||||
|
;; use parinfer for lisp editing
|
||||||
|
(use-package! parinfer-rust-mode
|
||||||
|
:hook ((emacs-lisp-mode
|
||||||
|
clojure-mode
|
||||||
|
scheme-mode
|
||||||
|
lisp-mode
|
||||||
|
racket-mode
|
||||||
|
fennel-mode
|
||||||
|
hy-mode) . parinfer-rust-mode)
|
||||||
|
:init
|
||||||
|
;; parinfer-rust library do not provide a apple silicon binary.
|
||||||
|
;; fix: https://github.com/doomemacs/doomemacs/issues/6163
|
||||||
|
(setq parinfer-rust-auto-download 0)
|
||||||
|
;; we need to download it manually and put it in this path
|
||||||
|
(setq parinfer-rust-library "~/.local/share/emacs/parinfer-rust/parinfer-rust.so")
|
||||||
|
:config
|
||||||
|
(map! :map parinfer-rust-mode-map
|
||||||
|
:localleader
|
||||||
|
"p" #'parinfer-rust-switch-mode
|
||||||
|
"P" #'parinfer-rust-toggle-disable))
|
||||||
|
|
||||||
|
;; disable smatparens-mode here to void conflict with parinfer
|
||||||
|
;; https://discourse.doomemacs.org/t/disable-smartparens-or-parenthesis-completion/134
|
||||||
|
(add-hook 'clojure-mode-hook #'turn-off-smartparens-mode)
|
||||||
|
(add-hook 'scheme-mode-hook #'turn-off-smartparens-mode)
|
||||||
|
(add-hook 'lisp-mode-hook #'turn-off-smartparens-mode)
|
||||||
|
(add-hook 'racket-mode-hook #'turn-off-smartparens-mode)
|
||||||
|
(add-hook 'fennel-mode-hook #'turn-off-smartparens-mode)
|
||||||
|
(add-hook 'hy-mode-hook #'turn-off-smartparens-mode)
|
||||||
|
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
;;; init.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; This file controls what Doom modules are enabled and what order they load
|
||||||
|
;; in. Remember to run 'doom sync' after modifying it!
|
||||||
|
|
||||||
|
;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's
|
||||||
|
;; documentation. There you'll find a link to Doom's Module Index where all
|
||||||
|
;; of our modules are listed, including what flags they support.
|
||||||
|
|
||||||
|
;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or
|
||||||
|
;; 'C-c c k' for non-vim users) to view its documentation. This works on
|
||||||
|
;; flags as well (those symbols that start with a plus).
|
||||||
|
;;
|
||||||
|
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
|
||||||
|
;; directory (for easy access to its source code).
|
||||||
|
|
||||||
|
|
||||||
|
(doom! :input
|
||||||
|
;;bidi ; (tfel ot) thgir etirw uoy gnipleh
|
||||||
|
chinese
|
||||||
|
;;japanese
|
||||||
|
;;layout ; auie,ctsrnm is the superior home row
|
||||||
|
|
||||||
|
:completion
|
||||||
|
;; (company +childframe) ; conflict with lsp-bridge
|
||||||
|
; the ultimate code completion backend
|
||||||
|
;;helm ; the *other* search engine for love and life
|
||||||
|
;;ido ; the other *other* search engine...
|
||||||
|
;;ivy ; a search engine for love and life
|
||||||
|
vertico ; the search engine of the future
|
||||||
|
|
||||||
|
:ui
|
||||||
|
;;deft ; notational velocity for Emacs
|
||||||
|
doom ; what makes DOOM look the way it does
|
||||||
|
doom-dashboard ; a nifty splash screen for Emacs
|
||||||
|
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
|
||||||
|
(emoji +unicode)
|
||||||
|
; 🙂
|
||||||
|
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
||||||
|
indent-guides ; highlighted indent columns
|
||||||
|
ligatures ; ligatures and symbols to make your code pretty again
|
||||||
|
modeline ; snazzy, Atom-inspired modeline, plus API
|
||||||
|
ophints ; highlight the region an operation acts on
|
||||||
|
(popup +defaults)
|
||||||
|
; tame sudden yet inevitable temporary windows
|
||||||
|
tabs ; a tab bar for Emacs
|
||||||
|
treemacs ; a project drawer, like neotree but cooler
|
||||||
|
unicode ; extended unicode support for various languages
|
||||||
|
(vc-gutter +pretty)
|
||||||
|
; vcs diff in the fringe
|
||||||
|
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||||
|
;;window-select ; visually switch windows
|
||||||
|
workspaces ; tab emulation, persistence & separate workspaces
|
||||||
|
;;zen ; distraction-free coding or writing
|
||||||
|
|
||||||
|
:editor
|
||||||
|
(evil +everywhere)
|
||||||
|
; come to the dark side, we have cookies
|
||||||
|
file-templates ; auto-snippets for empty files
|
||||||
|
fold ; (nigh) universal code folding
|
||||||
|
(format +onsave)
|
||||||
|
; automated prettiness
|
||||||
|
;; multiple-cursors ; editing in many places at once
|
||||||
|
;; objed ; text object editing for the innocent
|
||||||
|
parinfer ; turn lisp into python, sort of, conflict with copilot/objed/smartparens
|
||||||
|
;;rotate-text ; cycle region at point between text candidates
|
||||||
|
snippets ; my elves. They type so I don't have to
|
||||||
|
word-wrap ; soft wrapping with language-aware indent
|
||||||
|
|
||||||
|
:emacs
|
||||||
|
dired ; making dired pretty [functional]
|
||||||
|
electric ; smarter, keyword-based electric-indent
|
||||||
|
ibuffer ; interactive buffer management
|
||||||
|
undo ; persistent, smarter undo for your inevitable mistakes
|
||||||
|
vc ; version-control and Emacs, sitting in a tree
|
||||||
|
|
||||||
|
:term
|
||||||
|
;;eshell ; the elisp shell that works everywhere
|
||||||
|
;;shell ; simple shell REPL for Emacs
|
||||||
|
;;term ; basic terminal emulator for Emacs
|
||||||
|
vterm ; the best terminal emulation in Emacs
|
||||||
|
|
||||||
|
:checkers
|
||||||
|
syntax ; tasing you for every semicolon you forget
|
||||||
|
(spell +flyspell)
|
||||||
|
; tasing you for misspelling mispelling
|
||||||
|
grammar ; tasing grammar mistake every you make
|
||||||
|
|
||||||
|
:tools
|
||||||
|
;;ansible
|
||||||
|
;;biblio ; Writes a PhD for you (citation needed)
|
||||||
|
;;collab ; buffers with friends
|
||||||
|
;;debugger ; FIXME stepping through code, to help you add bugs
|
||||||
|
;;direnv
|
||||||
|
(docker)
|
||||||
|
editorconfig ; let someone else argue about tabs vs spaces
|
||||||
|
;;ein ; tame Jupyter notebooks with emacs
|
||||||
|
(eval +overlay)
|
||||||
|
; run code, run (also, repls)
|
||||||
|
lookup ; navigate your code and its documentation
|
||||||
|
;; lsp ; lsp-mode, conflict with lsp-bridge
|
||||||
|
magit ; a git porcelain for Emacs
|
||||||
|
;;make ; run make tasks from Emacs
|
||||||
|
;;pass ; password manager for nerds
|
||||||
|
pdf ; pdf enhancements
|
||||||
|
;;prodigy ; FIXME managing external services & code builders
|
||||||
|
(terraform)
|
||||||
|
; infrastructure as code
|
||||||
|
tree-sitter ; syntax and parsing, sitting in a tree...
|
||||||
|
;;upload ; map local to remote projects via ssh/ftp
|
||||||
|
|
||||||
|
:os
|
||||||
|
(:if IS-MAC macos)
|
||||||
|
; improve compatibility with macOS
|
||||||
|
tty ; improve the terminal Emacs experience
|
||||||
|
|
||||||
|
:lang
|
||||||
|
;;agda ; types of types of types of types...
|
||||||
|
;;beancount ; mind the GAAP
|
||||||
|
(cc +tree-sitter)
|
||||||
|
; C > C++ == 1
|
||||||
|
;;clojure ; java with a lisp
|
||||||
|
;;common-lisp ; if you've seen one lisp, you've seen them all
|
||||||
|
;;coq ; proofs-as-programs
|
||||||
|
;;crystal ; ruby at the speed of c
|
||||||
|
;;csharp ; unity, .NET, and mono shenanigans
|
||||||
|
data ; config/data formats
|
||||||
|
;;(dart +flutter) ; paint ui and not much else
|
||||||
|
;;dhall
|
||||||
|
;;elixir ; erlang done right
|
||||||
|
;;elm ; care for a cup of TEA?
|
||||||
|
emacs-lisp ; drown in parentheses
|
||||||
|
;;erlang ; an elegant language for a more civilized age
|
||||||
|
;;ess ; emacs speaks statistics
|
||||||
|
;;factor
|
||||||
|
;;faust ; dsp, but you get to keep your soul
|
||||||
|
;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER)
|
||||||
|
;;fsharp ; ML stands for Microsoft's Language
|
||||||
|
;;fstar ; (dependent) types and (monadic) effects and Z3
|
||||||
|
;;gdscript ; the language you waited for
|
||||||
|
(go +tree-sitter) ;; disable go-mode, use lsp-bridge instead
|
||||||
|
; the hipster dialect
|
||||||
|
;;(graphql) ; Give queries a REST
|
||||||
|
;;(haskell) ; a language that's lazier than I am
|
||||||
|
;;hy ; readability of scheme w/ speed of python
|
||||||
|
;;idris ; a language you can depend on
|
||||||
|
(json +tree-sitter)
|
||||||
|
; At least it ain't XML
|
||||||
|
(java +tree-sitter)
|
||||||
|
; the poster child for carpal tunnel syndrome
|
||||||
|
(javascript +tree-sitter)
|
||||||
|
; all(hope(abandon(ye(who(enter(here))))))
|
||||||
|
;;julia ; a better, faster MATLAB
|
||||||
|
;;kotlin ; a better, slicker Java(Script)
|
||||||
|
(latex)
|
||||||
|
; writing papers in Emacs has never been so fun
|
||||||
|
;;lean ; for folks with too much to prove
|
||||||
|
;;ledger ; be audit you can be
|
||||||
|
(lua +tree-sitter)
|
||||||
|
; one-based indices? one-based indices
|
||||||
|
(markdown +grip)
|
||||||
|
; writing docs for people to ignore
|
||||||
|
;;nim ; python + lisp at the speed of c
|
||||||
|
(nix +tree-sitter)
|
||||||
|
; I hereby declare "nix geht mehr!"
|
||||||
|
;;ocaml ; an objective camel
|
||||||
|
org ; organize your plain life in plain text
|
||||||
|
;;php ; perl's insecure younger brother
|
||||||
|
;;plantuml ; diagrams for confusing people more
|
||||||
|
;;purescript ; javascript, but functional
|
||||||
|
(python +tree-sitter +pyright)
|
||||||
|
; beautiful is better than ugly
|
||||||
|
;;qt ; the 'cutest' gui framework ever
|
||||||
|
racket ; a DSL for DSLs
|
||||||
|
;;raku ; the artist formerly known as perl6
|
||||||
|
;;rest ; Emacs as a REST client
|
||||||
|
;;rst ; ReST in peace
|
||||||
|
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
|
||||||
|
(rust +tree-sitter)
|
||||||
|
; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||||
|
;;scala ; java, but good
|
||||||
|
(scheme +guile)
|
||||||
|
; a fully conniving family of lisps
|
||||||
|
(sh +tree-sitter)
|
||||||
|
; she sells {ba,z,fi}sh shells on the C xor
|
||||||
|
;;sml
|
||||||
|
;;solidity ; do you need a blockchain? No.
|
||||||
|
;;swift ; who asked for emoji variables?
|
||||||
|
;;terra ; Earth and Moon in alignment for performance.
|
||||||
|
(web +tree-sitter)
|
||||||
|
; support for various web languages, including HTML5, CSS, SASS/SCSS, Pug/Jade/Slim, and more
|
||||||
|
(yaml +tree-sitter)
|
||||||
|
; JSON, but readable
|
||||||
|
;;zig ; C, but simpler
|
||||||
|
|
||||||
|
:email
|
||||||
|
;;(mu4e +org +gmail)
|
||||||
|
;;notmuch
|
||||||
|
;;(wanderlust +gmail)
|
||||||
|
|
||||||
|
:app
|
||||||
|
;;calendar
|
||||||
|
;;emms
|
||||||
|
;;everywhere ; *leave* Emacs!? You must be joking
|
||||||
|
;;irc ; how neckbeards socialize
|
||||||
|
;;(rss +org) ; emacs as an RSS reader
|
||||||
|
;;twitter ; twitter client https://twitter.com/vnought
|
||||||
|
|
||||||
|
:config
|
||||||
|
;;literate
|
||||||
|
(default +bindings +smartparens))
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
;; -*- no-byte-compile: t; -*-
|
||||||
|
;;; $DOOMDIR/packages.el
|
||||||
|
|
||||||
|
;; To install a package with Doom you must declare them here and run 'doom sync'
|
||||||
|
;; on the command line, then restart Emacs for the changes to take effect -- or
|
||||||
|
;; use 'M-x doom/reload'.
|
||||||
|
|
||||||
|
(package! nerd-icons)
|
||||||
|
(package! rime)
|
||||||
|
(package! wakatime-mode
|
||||||
|
:recipe
|
||||||
|
(:host github :repo "wakatime/wakatime-mode" :files
|
||||||
|
("*.el" "dist")))
|
||||||
|
|
||||||
|
(package! nushell-mode :recipe
|
||||||
|
(:host github :repo "mrkkrp/nushell-mode"))
|
||||||
|
|
||||||
|
(when (package! lsp-bridge
|
||||||
|
:recipe (:host github
|
||||||
|
:repo "manateelazycat/lsp-bridge"
|
||||||
|
:branch "master"
|
||||||
|
:files ("*.el" "*.py" "acm" "core" "langserver" "multiserver" "resources")
|
||||||
|
;; do not perform byte compilation or native compilation for lsp-bridge
|
||||||
|
:build (:not compile)))
|
||||||
|
(package! markdown-mode)
|
||||||
|
(package! yasnippet))
|
||||||
|
|
||||||
|
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
||||||
|
;; (package! some-package)
|
||||||
|
|
||||||
|
;; To install a package directly from a remote git repo, you must specify a
|
||||||
|
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
|
||||||
|
;; https://github.com/radian-software/straight.el#the-recipe-format
|
||||||
|
;; (package! another-package
|
||||||
|
;; :recipe (:host github :repo "username/repo"))
|
||||||
|
|
||||||
|
;; If the package you are trying to install does not contain a PACKAGENAME.el
|
||||||
|
;; file, or is located in a subdirectory of the repo, you'll need to specify
|
||||||
|
;; `:files' in the `:recipe':
|
||||||
|
;; (package! this-package
|
||||||
|
;; :recipe (:host github :repo "username/repo"
|
||||||
|
;; :files ("some-file.el" "src/lisp/*.el")))
|
||||||
|
|
||||||
|
;; If you'd like to disable a package included with Doom, you can do so here
|
||||||
|
;; with the `:disable' property:
|
||||||
|
;; (package! builtin-package :disable t)
|
||||||
|
|
||||||
|
;; You can override the recipe of a built in package without having to specify
|
||||||
|
;; all the properties for `:recipe'. These will inherit the rest of its recipe
|
||||||
|
;; from Doom or MELPA/ELPA/Emacsmirror:
|
||||||
|
;; (package! builtin-package :recipe (:nonrecursive t))
|
||||||
|
;; (package! builtin-package-2 :recipe (:repo "myfork/package"))
|
||||||
|
|
||||||
|
;; Specify a `:branch' to install a package from a particular branch or tag.
|
||||||
|
;; This is required for some packages whose default branch isn't 'master' (which
|
||||||
|
;; our package manager can't deal with; see radian-software/straight.el#279)
|
||||||
|
;; (package! builtin-package :recipe (:branch "develop"))
|
||||||
|
|
||||||
|
;; Use `:pin' to specify a particular commit to install.
|
||||||
|
;; (package! builtin-package :pin "1a2b3c4d5e")
|
||||||
|
|
||||||
|
|
||||||
|
;; Doom's packages are pinned to a specific commit and updated from release to
|
||||||
|
;; release. The `unpin!' macro allows you to unpin single packages...
|
||||||
|
;; (unpin! pinned-package)
|
||||||
|
;; ...or multiple packages
|
||||||
|
;; (unpin! pinned-package another-pinned-package)
|
||||||
|
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
||||||
|
;; (unpin! t)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name": "nil",
|
||||||
|
"languageId": "nix",
|
||||||
|
"command": ["nil"],
|
||||||
|
"settings": {
|
||||||
|
"nil": {
|
||||||
|
"formatting": { "command": ["alejandra"] }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Helix Editor
|
||||||
|
|
||||||
|
Neovim is really powerful, and have a very active community. I use it as my main editor, and I'm very happy with it. I use it for everything, from writing code to writing this document.
|
||||||
|
|
||||||
|
But its configuration is a bit complex, and finding the right plugins, writing configurations, and keeping everything up to date is not easy.
|
||||||
|
|
||||||
|
That's why I'm interested in Helix, Helix is similar to Neovim, but it's more opinionated, and it's batteries included.
|
||||||
|
Whether I'll switch my main editor to Helix or not, it gives me a lot of ideas on how to improve my Neovim workflow.
|
||||||
|
|
||||||
|
## Differences between Neovim and Helixer
|
||||||
|
|
||||||
|
1. Neovim have a very activate plugin ecosystem, and it's easy to find plugins for almost everything.
|
||||||
|
1. Helix is still new, and it even do have a stable plugin system yet. A PR to add a plugin system is still envolving: <https://github.com/helix-editor/helix/pull/8675>
|
||||||
|
2. Neovim has intergrated terminal, and it's very powerful. It's quite similar to VSCode's intergrated terminal. I use it a lot.
|
||||||
|
1. Helix doesn't have a intergrated terminal yet, as it's complicated to implement. Users are recommended to use tmux/Zellij or Wezterm/Kitty to implement this feature instead.
|
||||||
|
1. <https://github.com/helix-editor/helix/issues/1976#issuecomment-1091074719>
|
||||||
|
1. <https://github.com/helix-editor/helix/pull/4649>
|
||||||
|
1. **My Neovim often gets stuck when I switch to [toggleterm.nvim](https://github.com/akinsho/toggleterm.nvim), this Helix issue made me consider to switch from this Neovim plugin to Zellij**.
|
||||||
|
1. Helix do not have a tree-view panel, it's recommended to use Yazi/ranger/Broot instead, and open Helix in them.
|
||||||
|
1. a tree-view plugin may be added after the plugin system is stable, but no one knows when it will be.
|
||||||
|
2. and some Helix users stated that they don't need a tree-view plugin, Helix's file picker is useful and good enough.
|
||||||
|
1. It seems Helix lacks a substitution command, you should run it in another window(via wm or Zellij).
|
||||||
|
1. Neovim's substitution command allow you to preview the changes before you apply it, and it's very useful. if I switch to Helix, I'll need to find some other tools with similar feature(such as https://github.com/ms-jpq/sad).
|
||||||
|
2. The downside of Neovim's substitution command is that it's unable to save the command we just typed. If I made some things wrong, I have to type the whole substitution command again.
|
||||||
|
|
||||||
|
I think Use Helix/Neovim within a terminal file manager(Yazi/ranger/Broot) and Zellij is a good idea.
|
||||||
|
It's quite different from the workflow I migrated from VSCode/JetBrains before, I'm very interested in it.
|
||||||
|
|
||||||
|
In Neovim I can make the workflow similar to VSCode/JetBrains by using some plugins, but Helix forces me to get out of my comfort zone, and try something new.
|
||||||
@@ -1,10 +1,15 @@
|
|||||||
# AstroNvim Configuration and Shortcuts
|
# Neovim Editor
|
||||||
|
|
||||||
My Neovim config based on [AstroNvim](https://github.com/AstroNvim/AstroNvim).
|
My Neovim config based on [AstroNvim](https://github.com/AstroNvim/AstroNvim).
|
||||||
For more details, visit the [AstroNvim website](https://astronvim.com/).
|
For more details, visit the [AstroNvim website](https://astronvim.com/).
|
||||||
|
|
||||||
This document outlines neovim's configuration structure and various shortcuts/commands for efficient usage.
|
This document outlines neovim's configuration structure and various shortcuts/commands for efficient usage.
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
## Configuration Structure
|
## Configuration Structure
|
||||||
|
|
||||||
| Description | Standard Location | My Location |
|
| Description | Standard Location | My Location |
|
||||||
@@ -28,19 +33,23 @@ Remove all unused plugins:
|
|||||||
:Lazy clean
|
:Lazy clean
|
||||||
```
|
```
|
||||||
|
|
||||||
## Screenshots
|
## Testing
|
||||||
|
|
||||||

|
> via `Justfile` located at the root of this repo.
|
||||||

|
|
||||||
|
|
||||||
## Visual Modes
|
```bash
|
||||||
|
# testing
|
||||||
|
just nvim-test
|
||||||
|
|
||||||
| Action | Shortcut |
|
# clear test data
|
||||||
| ------------------------ | ---------------------------------------- |
|
just nvim-clear
|
||||||
| Toggle visual mode | `v` |
|
```
|
||||||
| Toggle visual block mode | `<Ctrl> + v` (select a block vertically) |
|
|
||||||
|
|
||||||
## Incremental Selection
|
## Cheetsheet
|
||||||
|
|
||||||
|
Here is the cheetsheet related to my Neovim configs. Please read vim's common cheetsheet at [../README.md](../README.md) before reading the following.
|
||||||
|
|
||||||
|
### Incremental Selection
|
||||||
|
|
||||||
Provided by nvim-treesitter.
|
Provided by nvim-treesitter.
|
||||||
|
|
||||||
@@ -51,7 +60,7 @@ Provided by nvim-treesitter.
|
|||||||
| scope incremental | `<Alt-Space>` |
|
| scope incremental | `<Alt-Space>` |
|
||||||
| node decremental | `Backspace` |
|
| node decremental | `Backspace` |
|
||||||
|
|
||||||
## Search and Jump
|
### Search and Jump
|
||||||
|
|
||||||
Provided by [flash.nvim](https://github.com/folke/flash.nvim), it's a intelligent search and jump plugin.
|
Provided by [flash.nvim](https://github.com/folke/flash.nvim), it's a intelligent search and jump plugin.
|
||||||
|
|
||||||
@@ -63,65 +72,34 @@ Provided by [flash.nvim](https://github.com/folke/flash.nvim), it's a intelligen
|
|||||||
| Treesitter Search | `yR`,`dR`, `cR`, `vR`, `ctrl+v+R`(arround your matches, all the surrounding Treesitter nodes will be labeled) |
|
| Treesitter Search | `yR`,`dR`, `cR`, `vR`, `ctrl+v+R`(arround your matches, all the surrounding Treesitter nodes will be labeled) |
|
||||||
| Remote Flash | `yr`, `dr`, `cr`, (arround your matches, all the surrounding Treesitter nodes will be labeled) |
|
| Remote Flash | `yr`, `dr`, `cr`, (arround your matches, all the surrounding Treesitter nodes will be labeled) |
|
||||||
|
|
||||||
## Text Manipulation
|
### Commands & Shortcuts
|
||||||
|
|
||||||
- Add at the end of multiple lines: `:normal A<text>`
|
|
||||||
|
|
||||||
- Execublock: `:A<text>`
|
|
||||||
|
|
||||||
- visual block mode(ctrl + v)
|
|
||||||
- Append text at the end of each line in the selected block
|
|
||||||
- If position exceeds line end, neovim adds spaces automatically
|
|
||||||
|
|
||||||
- Delete the last char of multivle lines: `:normal $x`
|
|
||||||
|
|
||||||
- Execute `$x` on each line
|
|
||||||
- visual mode(v)
|
|
||||||
- `$` moves cursor to the end of line
|
|
||||||
- `x` deletes the character under the cursor
|
|
||||||
|
|
||||||
- Delete the last word of multiple lines: `:normal $bD`
|
|
||||||
- Execute `$bD` on each line
|
|
||||||
- visual mode(v)
|
|
||||||
- `$` moves cursor to the end of line
|
|
||||||
- `b` moves cursor to the beginning of the last word
|
|
||||||
- `D` deletes from cursor to the end of line
|
|
||||||
|
|
||||||
## Commands & Shortcuts
|
|
||||||
|
|
||||||
| Action | Shortcut |
|
| Action | Shortcut |
|
||||||
| ----------------------------- | -------------- |
|
| ----------------------------- | -------------- |
|
||||||
| Learn Neovim's Basics | `:Tutor` |
|
|
||||||
| Open file explorer | `<Space> + e` |
|
| Open file explorer | `<Space> + e` |
|
||||||
| Focus Neotree to current file | `<Space> + o` |
|
| Focus Neotree to current file | `<Space> + o` |
|
||||||
| Floating Terminal | `<Space> + tf` |
|
|
||||||
| Horizontal Split Terminal | `<Space> + th` |
|
|
||||||
| Vertical Split Terminal | `<Space> + tv` |
|
|
||||||
| Open IPython REPL | `<Space> + tp` |
|
|
||||||
| Toggle line wrap | `<Space> + uw` |
|
| Toggle line wrap | `<Space> + uw` |
|
||||||
| Show line diagnostics | `gl` |
|
| Show line diagnostics | `gl` |
|
||||||
| Show function/variable info | `K` |
|
| Show function/variable info | `K` |
|
||||||
| Go to definition | `gd` |
|
|
||||||
| References of a symbol | `gr` |
|
| References of a symbol | `gr` |
|
||||||
|
|
||||||
## Window Navigation
|
### Window Navigation
|
||||||
|
|
||||||
- Switch between windows: `<Ctrl> + h/j/k/l`
|
- Switch between windows: `<Ctrl> + h/j/k/l`
|
||||||
- Resize windows: `<Ctrl> + Up/Down/Left/Right`
|
- Resize windows: `<Ctrl> + Up/Down/Left/Right`
|
||||||
- Note: On macOS, conflicts with system shortcuts
|
- Note: On macOS, conflicts with system shortcuts
|
||||||
- Disable in System Preferences -> Keyboard -> Shortcuts -> Mission Control
|
- Disable in System Preferences -> Keyboard -> Shortcuts -> Mission Control
|
||||||
|
|
||||||
## Splitting and Buffers
|
### Splitting and Buffers
|
||||||
|
|
||||||
|
|
|
||||||
| Action | Shortcut |
|
| Action | Shortcut |
|
||||||
| --------------------- | ------------- |
|
| --------------------- | ------------- |
|
||||||
| Horizontal Split | `\` |
|
| Horizontal Split | `\` |
|
||||||
| Vertical Split | `\|` |
|
| Vertical Split | `\|` |
|
||||||
| Next Buffer (Tab) | `]b` |
|
|
||||||
| Previous Buffer (Tab) | `[b` |
|
|
||||||
| Close Buffer | `<Space> + c` |
|
| Close Buffer | `<Space> + c` |
|
||||||
|
|
||||||
## Editing and Formatting
|
### Editing and Formatting
|
||||||
|
|
||||||
| Action | Shortcut |
|
| Action | Shortcut |
|
||||||
| ----------------------------------------------------- | -------------- |
|
| ----------------------------------------------------- | -------------- |
|
||||||
@@ -135,7 +113,7 @@ Provided by [flash.nvim](https://github.com/folke/flash.nvim), it's a intelligen
|
|||||||
| Find files by name (fzf) | `<Space> + ff` |
|
| Find files by name (fzf) | `<Space> + ff` |
|
||||||
| Grep string in files (ripgrep) | `<Space> + fw` |
|
| Grep string in files (ripgrep) | `<Space> + fw` |
|
||||||
|
|
||||||
## Sessions
|
### Sessions
|
||||||
|
|
||||||
| Action | Shortcut |
|
| Action | Shortcut |
|
||||||
| ------------------------------ | -------------- |
|
| ------------------------------ | -------------- |
|
||||||
@@ -145,43 +123,18 @@ Provided by [flash.nvim](https://github.com/folke/flash.nvim), it's a intelligen
|
|||||||
| Search Session | `<Space> + Sf` |
|
| Search Session | `<Space> + Sf` |
|
||||||
| Load Current Directory Session | `<Space> + S.` |
|
| Load Current Directory Session | `<Space> + S.` |
|
||||||
|
|
||||||
## Debugging
|
### Debugging
|
||||||
|
|
||||||
Press `<Space> + D` to view available bindings and options.
|
Press `<Space> + D` to view available bindings and options.
|
||||||
|
|
||||||
## Find and Replace
|
### Search and Replace Globally
|
||||||
|
|
||||||
| Action | Command |
|
|
||||||
| ------------------------ | ----------------------------------- |
|
|
||||||
| Replace in selected area | `:s/old/new/g` |
|
|
||||||
| Replace in current line | Same as above |
|
|
||||||
| Replace in whole file | `:% s/old/new/g` |
|
|
||||||
| Replace with regex | `:% s@\vhttp://(\w+)@https://\1@gc` |
|
|
||||||
|
|
||||||
1. `\v` means means that in the regex pattern after it can be used without backslash escaping(similar to python's raw string).
|
|
||||||
2. `\1` means the first matched group in the pattern.
|
|
||||||
|
|
||||||
## Replace in the specific lines
|
|
||||||
|
|
||||||
| Action | Command |
|
|
||||||
| ----------------------------------------- | -------------------------------------- |
|
|
||||||
| From the 10th line to the end of the file | `:10,$ s/old/new/g` or `:10,$ s@^@#@g` |
|
|
||||||
| From the 10th line to the 20th line | `:10,20 s/old/new/g` |
|
|
||||||
|
|
||||||
The postfix(flags) in the above commands:
|
|
||||||
|
|
||||||
1. `g` means replace all the matched strings in the current line/file.
|
|
||||||
2. `c` means ask for confirmation before replacing.
|
|
||||||
3. `i` means ignore case.
|
|
||||||
|
|
||||||
## Search and Replace Globally
|
|
||||||
|
|
||||||
| Description | Shortcut |
|
| Description | Shortcut |
|
||||||
| ------------------------------------------------------------ | ---------------------------------------------------------------- |
|
| ------------------------------------------------------------ | ---------------------------------------------------------------- |
|
||||||
| Open spectre.nvim search and replace panel | `<Space> + ss` |
|
| Open spectre.nvim search and replace panel | `<Space> + ss` |
|
||||||
| Search and replace in command line(need install `sad` first) | `find -name "*.nix" \| sad '<pattern>' '<replacement>' \| delta` |
|
| Search and replace in command line(need install `sad` first) | `find -name "*.nix" \| sad '<pattern>' '<replacement>' \| delta` |
|
||||||
|
|
||||||
## Surrounding Characters
|
### Surrounding Characters
|
||||||
|
|
||||||
Provided by mini.surround plugin.
|
Provided by mini.surround plugin.
|
||||||
|
|
||||||
@@ -194,28 +147,17 @@ Provided by mini.surround plugin.
|
|||||||
| Replace surrounding characters | `gzr'"` | Replace `'` by `"` around the word under cursor |
|
| Replace surrounding characters | `gzr'"` | Replace `'` by `"` around the word under cursor |
|
||||||
| Highlight surrounding | `gzh'` | Highlight `'` around the word under cursor |
|
| Highlight surrounding | `gzh'` | Highlight `'` around the word under cursor |
|
||||||
|
|
||||||
## Text Manipulation
|
### Text Manipulation
|
||||||
|
|
||||||
| Action | |
|
| Action | |
|
||||||
| -------------------------------------- | ------------- |
|
| -------------------------------------- | ------------- |
|
||||||
| Join Selection of Lines With Space | `:join` |
|
|
||||||
| Join without spaces | `:join!` |
|
|
||||||
| Join with LSP intelligence(treesj) | `<Space> + j` |
|
| Join with LSP intelligence(treesj) | `<Space> + j` |
|
||||||
| Split Line into Multiple Lines(treesj) | `<Space> + s` |
|
| Split Line into Multiple Lines(treesj) | `<Space> + s` |
|
||||||
|
|
||||||
## Convert Text Case
|
### Miscellaneous
|
||||||
|
|
||||||
| Action | |
|
| Action | |
|
||||||
| -------------------- | --- |
|
| --------------------- | --------------- |
|
||||||
| Toggle text's case | `~` |
|
|
||||||
| Convert to uppercase | `U` |
|
|
||||||
| Convert to lowercase | `u` |
|
|
||||||
|
|
||||||
## Miscellaneous
|
|
||||||
|
|
||||||
| Action | |
|
|
||||||
| ---------------------------- | -------------------------------------------- |
|
|
||||||
| Save selected text to a file | `:w filename` (Will show `:'<,'>w filename`) |
|
|
||||||
| Show all Yank History | `:<Space> + yh` |
|
| Show all Yank History | `:<Space> + yh` |
|
||||||
| Show undo history | `:<Space> + uh` |
|
| Show undo history | `:<Space> + uh` |
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
.clj-kondo/
|
||||||
|
.nrepl-port
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{:source-file-patterns ["*.fnl" "**/*.fnl"]}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
column_width = 120
|
||||||
|
line_endings = "Unix"
|
||||||
|
indent_type = "Spaces"
|
||||||
|
indent_width = 2
|
||||||
|
quote_style = "AutoPreferDouble"
|
||||||
|
call_parentheses = "None"
|
||||||
|
collapse_simple_statement = "Always"
|
||||||
+182
-62
@@ -8,13 +8,23 @@ return {
|
|||||||
spell = false, -- Spell checking
|
spell = false, -- Spell checking
|
||||||
swapfile = false, -- Swapfile
|
swapfile = false, -- Swapfile
|
||||||
smartindent = false, -- fix https://github.com/ryan4yin/nix-config/issues/4
|
smartindent = false, -- fix https://github.com/ryan4yin/nix-config/issues/4
|
||||||
|
title = true, -- Set the title of window to `filename [+=-] (path) - NVIM`
|
||||||
|
-- The percentage of 'columns' to use for the title
|
||||||
|
-- When the title is longer, only the end of the path name is shown.
|
||||||
|
titlelen = 20,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
plugins = {
|
plugins = {
|
||||||
"AstroNvim/astrocommunity",
|
"AstroNvim/astrocommunity",
|
||||||
-- colorscheme - catppuccin
|
-- Motion
|
||||||
{ import = "astrocommunity.colorscheme.catppuccin" },
|
{ import = "astrocommunity.motion.mini-surround" },
|
||||||
|
-- https://github.com/echasnovski/mini.ai
|
||||||
|
{ import = "astrocommunity.motion.mini-ai" },
|
||||||
|
{ import = "astrocommunity.motion.flash-nvim" },
|
||||||
|
-- diable toggleterm.nvim, zellij's terminal is far better than neovim's one
|
||||||
|
{ "akinsho/toggleterm.nvim", enabled = false },
|
||||||
|
{ "folke/flash.nvim", vscode = false },
|
||||||
-- Highly experimental plugin that completely replaces
|
-- Highly experimental plugin that completely replaces
|
||||||
-- the UI for messages, cmdline and the popupmenu.
|
-- the UI for messages, cmdline and the popupmenu.
|
||||||
-- { import = "astrocommunity.utility.noice-nvim" },
|
-- { import = "astrocommunity.utility.noice-nvim" },
|
||||||
@@ -37,26 +47,154 @@ return {
|
|||||||
{ import = "astrocommunity.pack.json" },
|
{ import = "astrocommunity.pack.json" },
|
||||||
{ import = "astrocommunity.pack.yaml" },
|
{ import = "astrocommunity.pack.yaml" },
|
||||||
{ import = "astrocommunity.pack.toml" },
|
{ import = "astrocommunity.pack.toml" },
|
||||||
---- Backend
|
---- Backend / System
|
||||||
{ import = "astrocommunity.pack.lua" },
|
{ import = "astrocommunity.pack.lua" },
|
||||||
{ import = "astrocommunity.pack.go" },
|
{ import = "astrocommunity.pack.go" },
|
||||||
{ import = "astrocommunity.pack.rust" },
|
{ import = "astrocommunity.pack.rust" },
|
||||||
{ import = "astrocommunity.pack.python" },
|
{ import = "astrocommunity.pack.python" },
|
||||||
{ import = "astrocommunity.pack.java" },
|
{ import = "astrocommunity.pack.java" },
|
||||||
|
{ import = "astrocommunity.pack.cmake" },
|
||||||
|
{ import = "astrocommunity.pack.cpp" },
|
||||||
-- { import = "astrocommunity.pack.nix" }, -- manually add config for nix, comment this one.
|
-- { import = "astrocommunity.pack.nix" }, -- manually add config for nix, comment this one.
|
||||||
{ import = "astrocommunity.pack.proto" },
|
{ import = "astrocommunity.pack.proto" },
|
||||||
|
|
||||||
---- Operation & Cloud Native
|
---- Operation & Cloud Native
|
||||||
{ import = "astrocommunity.pack.terraform" },
|
{ import = "astrocommunity.pack.terraform" },
|
||||||
{ import = "astrocommunity.pack.bash" },
|
{ import = "astrocommunity.pack.bash" },
|
||||||
{ import = "astrocommunity.pack.cmake" },
|
|
||||||
{ import = "astrocommunity.pack.cpp" },
|
|
||||||
{ import = "astrocommunity.pack.docker" },
|
{ import = "astrocommunity.pack.docker" },
|
||||||
-- Motion
|
{ import = "astrocommunity.pack.helm" },
|
||||||
{ import = "astrocommunity.motion.mini-surround" },
|
|
||||||
-- https://github.com/echasnovski/mini.ai
|
-- colorscheme
|
||||||
{ import = "astrocommunity.motion.mini-ai" },
|
{ import = "astrocommunity.colorscheme.catppuccin" },
|
||||||
{ import = "astrocommunity.motion.flash-nvim" },
|
{
|
||||||
{ "folke/flash.nvim", vscode = false },
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.flavour = "mocha" -- latte, frappe, macchiato, mocha
|
||||||
|
opts.transparent_background = true -- setting the background color.
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
-- Language Parser for syntax highlighting / indentation / folding / Incremental selection
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local utils = require("astronvim.utils")
|
||||||
|
opts.incremental_selection = {
|
||||||
|
enable = true,
|
||||||
|
keymaps = {
|
||||||
|
init_selection = "<C-space>", -- Ctrl + Space
|
||||||
|
node_incremental = "<C-space>",
|
||||||
|
scope_incremental = "<A-space>", -- Alt + Space
|
||||||
|
node_decremental = "<bs>", -- Backspace
|
||||||
|
},
|
||||||
|
}
|
||||||
|
opts.ignore_install = { "gotmpl" }
|
||||||
|
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, {
|
||||||
|
-- neovim
|
||||||
|
"vim",
|
||||||
|
"lua",
|
||||||
|
-- operation & cloud native
|
||||||
|
"dockerfile",
|
||||||
|
"hcl",
|
||||||
|
"jsonnet",
|
||||||
|
"regex",
|
||||||
|
"terraform",
|
||||||
|
"nix",
|
||||||
|
"csv",
|
||||||
|
-- other programming language
|
||||||
|
"diff",
|
||||||
|
"gitignore",
|
||||||
|
"gitcommit",
|
||||||
|
"latex",
|
||||||
|
"sql",
|
||||||
|
-- Lisp like
|
||||||
|
"fennel",
|
||||||
|
"clojure",
|
||||||
|
"commonlisp",
|
||||||
|
-- customized languages:
|
||||||
|
"scheme",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- add support for scheme
|
||||||
|
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||||
|
parser_config.scheme = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/6cdh/tree-sitter-scheme", -- local path or git repo
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
-- optional entries:
|
||||||
|
branch = "main", -- default branch in case of git repo if different from master
|
||||||
|
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
|
||||||
|
requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
|
||||||
|
},
|
||||||
|
}
|
||||||
|
-- use scheme parser for filetypes: scm
|
||||||
|
vim.treesitter.language.register("scheme", "scm")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"eraserhd/parinfer-rust",
|
||||||
|
build = "cargo build --release",
|
||||||
|
ft = { "scm", "scheme" },
|
||||||
|
},
|
||||||
|
{ "Olical/nfnl", ft = "fennel" },
|
||||||
|
{
|
||||||
|
"Olical/conjure",
|
||||||
|
ft = { "clojure", "fennel", "python", "scheme" }, -- etc
|
||||||
|
-- [Optional] cmp-conjure for cmp
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"PaterJason/cmp-conjure",
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local config = cmp.get_config()
|
||||||
|
table.insert(config.sources, {
|
||||||
|
name = "buffer",
|
||||||
|
option = {
|
||||||
|
sources = {
|
||||||
|
{ name = "conjure" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
cmp.setup(config)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("conjure.main").main()
|
||||||
|
require("conjure.mapping")["on-filetype"]()
|
||||||
|
end,
|
||||||
|
init = function()
|
||||||
|
-- Set configuration options here
|
||||||
|
vim.g["conjure#debug"] = true
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-orgmode/orgmode",
|
||||||
|
dependencies = {
|
||||||
|
{ "nvim-treesitter/nvim-treesitter", lazy = true },
|
||||||
|
},
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function()
|
||||||
|
-- Load treesitter grammar for org
|
||||||
|
require("orgmode").setup_ts_grammar()
|
||||||
|
|
||||||
|
-- Setup treesitter
|
||||||
|
require("nvim-treesitter.configs").setup({
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = { "org" },
|
||||||
|
},
|
||||||
|
ensure_installed = { "org" },
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Setup orgmode
|
||||||
|
require("orgmode").setup({
|
||||||
|
org_agenda_files = "~/org/**/*",
|
||||||
|
org_default_notes_file = "~/org/refile.org",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- Lua implementation of CamelCaseMotion, with extra consideration of punctuation.
|
-- Lua implementation of CamelCaseMotion, with extra consideration of punctuation.
|
||||||
{ import = "astrocommunity.motion.nvim-spider" },
|
{ import = "astrocommunity.motion.nvim-spider" },
|
||||||
-- AI Assistant
|
-- AI Assistant
|
||||||
@@ -213,38 +351,8 @@ return {
|
|||||||
|
|
||||||
-- full signature help, docs and completion for the nvim lua API.
|
-- full signature help, docs and completion for the nvim lua API.
|
||||||
{ "folke/neodev.nvim", opts = {} },
|
{ "folke/neodev.nvim", opts = {} },
|
||||||
|
-- automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
|
||||||
{ "RRethy/vim-illuminate", config = function() end },
|
{ "RRethy/vim-illuminate", config = function() end },
|
||||||
|
|
||||||
-- Language Parser for syntax highlighting / indentation / folding / Incremental selection
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
opts = function(_, opts)
|
|
||||||
local utils = require("astronvim.utils")
|
|
||||||
opts.incremental_selection = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
init_selection = "<C-space>", -- Ctrl + Space
|
|
||||||
node_incremental = "<C-space>",
|
|
||||||
scope_incremental = "<A-space>", -- Alt + Space
|
|
||||||
node_decremental = "<bs>", -- Backspace
|
|
||||||
},
|
|
||||||
}
|
|
||||||
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, {
|
|
||||||
-- neovim
|
|
||||||
"vim",
|
|
||||||
"lua",
|
|
||||||
-- operation & cloud native
|
|
||||||
"dockerfile",
|
|
||||||
"hcl",
|
|
||||||
"jsonnet",
|
|
||||||
"regex",
|
|
||||||
"terraform",
|
|
||||||
"nix",
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- implementation/definition preview
|
-- implementation/definition preview
|
||||||
{
|
{
|
||||||
"rmagatti/goto-preview",
|
"rmagatti/goto-preview",
|
||||||
@@ -260,22 +368,34 @@ return {
|
|||||||
-- LSP installations
|
-- LSP installations
|
||||||
{
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
-- overwrite ensure_installed to install lsp via home manager(except emmet_ls)
|
-- mason is unusable on NixOS, disable it.
|
||||||
opts = function(_, opts)
|
|
||||||
opts.ensure_installed = {
|
|
||||||
"emmet_ls", -- not exist in nixpkgs, so install it via mason
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
-- Formatters/Linter installation
|
|
||||||
{
|
|
||||||
"jay-babu/mason-null-ls.nvim",
|
|
||||||
-- ensure_installed nothing
|
-- ensure_installed nothing
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
opts.ensure_installed = nil
|
opts.ensure_installed = nil
|
||||||
opts.automatic_installation = false
|
opts.automatic_installation = false
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
-- Formatters/Linter installation
|
||||||
|
{
|
||||||
|
"jay-babu/mason-null-ls.nvim",
|
||||||
|
-- mason is unusable on NixOS, disable it.
|
||||||
|
-- ensure_installed nothing
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.ensure_installed = nil
|
||||||
|
opts.automatic_installation = false
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
-- Debugger installation
|
||||||
|
{
|
||||||
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
|
-- mason is unusable on NixOS, disable it.
|
||||||
|
-- ensure_installed nothing
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.ensure_installed = nil
|
||||||
|
opts.automatic_installation = false
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
@@ -320,20 +440,13 @@ return {
|
|||||||
extra_args = { "--dialect", "postgres" }, -- change to your dialect
|
extra_args = { "--dialect", "postgres" }, -- change to your dialect
|
||||||
}),
|
}),
|
||||||
formatting.nginx_beautifier, -- Nginx formatter
|
formatting.nginx_beautifier, -- Nginx formatter
|
||||||
null_ls.builtins.formatting.verible_verilog_format, -- Verilog formatter
|
formatting.verible_verilog_format, -- Verilog formatter
|
||||||
|
formatting.emacs_scheme_mode, -- using emacs in batch mode to format scheme files.
|
||||||
|
formatting.fnlfmt, -- Format Fennel code
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- Debugger installation
|
|
||||||
{
|
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
|
||||||
-- overrides `require("mason-nvim-dap").setup(...)`
|
|
||||||
opts = function(_, opts)
|
|
||||||
opts.ensure_installed = nil
|
|
||||||
opts.automatic_installation = false
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
@@ -408,6 +521,10 @@ return {
|
|||||||
offsetEncoding = "utf-8",
|
offsetEncoding = "utf-8",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
scheme_langserver = {
|
||||||
|
filetypes = { "scheme", "scm" },
|
||||||
|
single_file_support = true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
-- enable servers that installed by home-manager instead of mason
|
-- enable servers that installed by home-manager instead of mason
|
||||||
servers = {
|
servers = {
|
||||||
@@ -442,6 +559,8 @@ return {
|
|||||||
"dockerls", -- dockerfile
|
"dockerls", -- dockerfile
|
||||||
"jsonnet_ls", -- jsonnet language server
|
"jsonnet_ls", -- jsonnet language server
|
||||||
"terraformls", -- terraform hcl
|
"terraformls", -- terraform hcl
|
||||||
|
"nushell", -- nushell language server
|
||||||
|
"scheme_langserver", -- scheme language server
|
||||||
},
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
disabled = {},
|
disabled = {},
|
||||||
@@ -452,6 +571,7 @@ return {
|
|||||||
"jsonnet",
|
"jsonnet",
|
||||||
"rust",
|
"rust",
|
||||||
"terraform",
|
"terraform",
|
||||||
|
"nu",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-2
@@ -22,8 +22,6 @@ return {
|
|||||||
-- NOTE: https://neovim.io/doc/user/builtin.html#jobstart()
|
-- NOTE: https://neovim.io/doc/user/builtin.html#jobstart()
|
||||||
-- 1. If {cmd} is a List it runs directly (no 'shell')
|
-- 1. If {cmd} is a List it runs directly (no 'shell')
|
||||||
-- 2. If {cmd} is a String it runs in the 'shell'
|
-- 2. If {cmd} is a String it runs in the 'shell'
|
||||||
["<leader>tp"] = { function() utils.toggle_term_cmd({ cmd = "ipython" }) end, desc = "ToggleTerm python" },
|
|
||||||
|
|
||||||
-- search and replace globally
|
-- search and replace globally
|
||||||
['<leader>ss'] = {'<cmd>lua require("spectre").toggle()<CR>', desc = "Toggle Spectre" },
|
['<leader>ss'] = {'<cmd>lua require("spectre").toggle()<CR>', desc = "Toggle Spectre" },
|
||||||
['<leader>sw'] = {'<cmd>lua require("spectre").open_visual({select_word=true})<CR>', desc = "Search current word" },
|
['<leader>sw'] = {'<cmd>lua require("spectre").open_visual({select_word=true})<CR>', desc = "Search current word" },
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
astronvim,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
###############################################################################
|
||||||
|
#
|
||||||
|
# AstroNvim's configuration and all its dependencies(lsp, formatter, etc.)
|
||||||
|
#
|
||||||
|
#e#############################################################################
|
||||||
|
let
|
||||||
|
shellAliases = {
|
||||||
|
v = "nvim";
|
||||||
|
vdiff = "nvim -d";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
xdg.configFile = {
|
||||||
|
# astronvim's config
|
||||||
|
"nvim" = {
|
||||||
|
source = astronvim;
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# my custom astronvim config, astronvim will load it after base config
|
||||||
|
# https://github.com/AstroNvim/AstroNvim/blob/v3.32.0/lua/astronvim/bootstrap.lua#L15-L16
|
||||||
|
"astronvim/lua/user" = {
|
||||||
|
source = ./astronvim_user;
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home.shellAliases = shellAliases;
|
||||||
|
programs.nushell.shellAliases = shellAliases;
|
||||||
|
|
||||||
|
nixpkgs.config = {
|
||||||
|
programs.npm.npmrc = ''
|
||||||
|
prefix = ''${HOME}/.npm-global
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
neovim = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
defaultEditor = true;
|
||||||
|
viAlias = true;
|
||||||
|
vimAlias = true;
|
||||||
|
|
||||||
|
# currently we use lazy.nvim as neovim's package manager, so comment this one.
|
||||||
|
# Install packages that will compile locally or download FHS binaries via Nix!
|
||||||
|
# and use lazy.nvim's `dir` option to specify the package directory in nix store.
|
||||||
|
# so that these plugins can work on NixOS.
|
||||||
|
#
|
||||||
|
# related project:
|
||||||
|
# https://github.com/b-src/lazy-nix-helper.nvim
|
||||||
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
# search all the plugins using https://search.nixos.org/packages
|
||||||
|
telescope-fzf-native-nvim
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
home.packages = with pkgs;
|
||||||
|
[
|
||||||
|
#-- c/c++
|
||||||
|
cmake
|
||||||
|
cmake-language-server
|
||||||
|
gnumake
|
||||||
|
checkmake
|
||||||
|
llvmPackages.clang-unwrapped # c/c++ tools with clang-tools such as clanvimPlugins.nvim-treesitter-parsers.vuegd
|
||||||
|
lldb
|
||||||
|
# c/c++ compiler, required by nvim-treesitter!
|
||||||
|
# gcc has to be installed after clang, so that `cc` will be gcc instead of clang(on macOS)
|
||||||
|
gcc
|
||||||
|
|
||||||
|
#-- python
|
||||||
|
nodePackages.pyright # python language server
|
||||||
|
(python310.withPackages (
|
||||||
|
ps:
|
||||||
|
with ps; [
|
||||||
|
ruff-lsp
|
||||||
|
black # python formatter
|
||||||
|
|
||||||
|
ipython
|
||||||
|
pandas
|
||||||
|
requests
|
||||||
|
pyquery
|
||||||
|
pyyaml
|
||||||
|
|
||||||
|
## emacs's lsp-bridge dependenciesge
|
||||||
|
epc
|
||||||
|
orjson
|
||||||
|
sexpdata
|
||||||
|
six
|
||||||
|
setuptools
|
||||||
|
paramiko
|
||||||
|
rapidfuzz
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
|
#-- rust
|
||||||
|
rust-analyzer
|
||||||
|
cargo # rust package manager
|
||||||
|
rustfmt
|
||||||
|
|
||||||
|
#-- zig
|
||||||
|
zls
|
||||||
|
|
||||||
|
#-- nix
|
||||||
|
nil
|
||||||
|
rnix-lsp
|
||||||
|
# nixd
|
||||||
|
statix # Lints and suggestions for the nix programming language
|
||||||
|
deadnix # Find and remove unused code in .nix source files
|
||||||
|
alejandra # Nix Code Formatter
|
||||||
|
|
||||||
|
#-- golang
|
||||||
|
go
|
||||||
|
gomodifytags
|
||||||
|
iferr # generate error handling code for go
|
||||||
|
impl # generate function implementation for go
|
||||||
|
gotools # contains tools like: godoc, goimports, etc.
|
||||||
|
gopls # go language server
|
||||||
|
delve # go debugger
|
||||||
|
|
||||||
|
# -- java
|
||||||
|
jdk17
|
||||||
|
gradle
|
||||||
|
maven
|
||||||
|
spring-boot-cli
|
||||||
|
|
||||||
|
#-- lua
|
||||||
|
stylua
|
||||||
|
lua-language-server
|
||||||
|
|
||||||
|
#-- bash
|
||||||
|
nodePackages.bash-language-server
|
||||||
|
shellcheck
|
||||||
|
shfmt
|
||||||
|
|
||||||
|
#-- javascript/typescript --#
|
||||||
|
nodePackages.nodejs
|
||||||
|
nodePackages.typescript
|
||||||
|
nodePackages.typescript-language-server
|
||||||
|
# HTML/CSS/JSON/ESLint language servers extracted from vscode
|
||||||
|
nodePackages.vscode-langservers-extracted
|
||||||
|
nodePackages."@tailwindcss/language-server"
|
||||||
|
emmet-ls
|
||||||
|
|
||||||
|
#-- CloudNative
|
||||||
|
nodePackages.dockerfile-language-server-nodejs
|
||||||
|
# terraform # install via brew on macOS
|
||||||
|
terraform-ls
|
||||||
|
jsonnet
|
||||||
|
jsonnet-language-server
|
||||||
|
hadolint # Dockerfile linter
|
||||||
|
|
||||||
|
# -- Lisp like Languages
|
||||||
|
guile
|
||||||
|
racket-minimal
|
||||||
|
fnlfmt # fennel
|
||||||
|
|
||||||
|
#-- Others
|
||||||
|
taplo # TOML language server / formatter / validator
|
||||||
|
nodePackages.yaml-language-server
|
||||||
|
sqlfluff # SQL linter
|
||||||
|
actionlint # GitHub Actions linter
|
||||||
|
buf # protoc plugin for linting and formatting
|
||||||
|
proselint # English prose linter
|
||||||
|
|
||||||
|
#-- Misc
|
||||||
|
tree-sitter # common language parser/highlighter
|
||||||
|
nodePackages.prettier # common code formatter
|
||||||
|
marksman # language server for markdown
|
||||||
|
glow # markdown previewer
|
||||||
|
fzf
|
||||||
|
|
||||||
|
#-- Optional Requirements:
|
||||||
|
gdu # disk usage analyzer, required by AstroNvim
|
||||||
|
(ripgrep.override {withPCRE2 = true;}) # recursively searches directories for a regex pattern
|
||||||
|
]
|
||||||
|
++ (
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then []
|
||||||
|
else [
|
||||||
|
#-- verilog / systemverilog
|
||||||
|
verible
|
||||||
|
gdb
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,160 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
astronvim,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
###############################################################################
|
|
||||||
#
|
|
||||||
# AstroNvim's configuration and all its dependencies(lsp, formatter, etc.)
|
|
||||||
#
|
|
||||||
#e#############################################################################
|
|
||||||
{
|
|
||||||
xdg.configFile = {
|
|
||||||
# astronvim's config
|
|
||||||
"nvim" = {
|
|
||||||
source = astronvim;
|
|
||||||
force = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# my custom astronvim config, astronvim will load it after base config
|
|
||||||
# https://github.com/AstroNvim/AstroNvim/blob/v3.32.0/lua/astronvim/bootstrap.lua#L15-L16
|
|
||||||
"astronvim/lua/user".source = ./astronvim_user;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs.config = {
|
|
||||||
programs.npm.npmrc = ''
|
|
||||||
prefix = ''${HOME}/.npm-global
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
neovim = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
defaultEditor = true;
|
|
||||||
viAlias = true;
|
|
||||||
vimAlias = true;
|
|
||||||
|
|
||||||
# currently we use lazy.nvim as neovim's package manager, so comment this one.
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
|
||||||
# search all the plugins using https://search.nixos.org/packages
|
|
||||||
telescope-fzf-native-nvim
|
|
||||||
];
|
|
||||||
|
|
||||||
# Extra packages only available to nvim(won't pollute the global home environment)
|
|
||||||
extraPackages = with pkgs;
|
|
||||||
[
|
|
||||||
#-- c/c++
|
|
||||||
cmake
|
|
||||||
cmake-language-server
|
|
||||||
gnumake
|
|
||||||
checkmake
|
|
||||||
gcc # c/c++ compiler, required by nvim-treesitter!
|
|
||||||
llvmPackages.clang-unwrapped # c/c++ tools with clang-tools such as clangd
|
|
||||||
lldb
|
|
||||||
|
|
||||||
#-- python
|
|
||||||
nodePackages.pyright # python language server
|
|
||||||
python3Packages.black # python formatter
|
|
||||||
python3Packages.ruff-lsp
|
|
||||||
(python3.withPackages (
|
|
||||||
ps:
|
|
||||||
with ps; [
|
|
||||||
pynvim # Python client and plugin host for Nvim
|
|
||||||
|
|
||||||
ipython
|
|
||||||
pandas
|
|
||||||
requests
|
|
||||||
pyquery
|
|
||||||
pyyaml
|
|
||||||
]
|
|
||||||
))
|
|
||||||
|
|
||||||
#-- rust
|
|
||||||
rust-analyzer
|
|
||||||
cargo # rust package manager
|
|
||||||
rustfmt
|
|
||||||
|
|
||||||
#-- zig
|
|
||||||
zls
|
|
||||||
|
|
||||||
#-- nix
|
|
||||||
nil
|
|
||||||
rnix-lsp
|
|
||||||
# nixd
|
|
||||||
statix # Lints and suggestions for the nix programming language
|
|
||||||
deadnix # Find and remove unused code in .nix source files
|
|
||||||
alejandra # Nix Code Formatter
|
|
||||||
|
|
||||||
#-- golang
|
|
||||||
go
|
|
||||||
gomodifytags
|
|
||||||
iferr # generate error handling code for go
|
|
||||||
impl # generate function implementation for go
|
|
||||||
gotools # contains tools like: godoc, goimports, etc.
|
|
||||||
gopls # go language server
|
|
||||||
delve # go debugger
|
|
||||||
|
|
||||||
# -- java
|
|
||||||
jdk17
|
|
||||||
gradle
|
|
||||||
maven
|
|
||||||
spring-boot-cli
|
|
||||||
|
|
||||||
#-- lua
|
|
||||||
stylua
|
|
||||||
lua-language-server
|
|
||||||
|
|
||||||
#-- bash
|
|
||||||
nodePackages.bash-language-server
|
|
||||||
shellcheck
|
|
||||||
shfmt
|
|
||||||
|
|
||||||
#-- javascript/typescript --#
|
|
||||||
nodePackages.nodejs
|
|
||||||
nodePackages.typescript
|
|
||||||
nodePackages.typescript-language-server
|
|
||||||
# HTML/CSS/JSON/ESLint language servers extracted from vscode
|
|
||||||
nodePackages.vscode-langservers-extracted
|
|
||||||
nodePackages."@tailwindcss/language-server"
|
|
||||||
|
|
||||||
#-- CloudNative
|
|
||||||
nodePackages.dockerfile-language-server-nodejs
|
|
||||||
# terraform # install via brew on macOS
|
|
||||||
terraform-ls
|
|
||||||
jsonnet
|
|
||||||
jsonnet-language-server
|
|
||||||
hadolint # Dockerfile linter
|
|
||||||
|
|
||||||
#-- Others
|
|
||||||
taplo # TOML language server / formatter / validator
|
|
||||||
nodePackages.yaml-language-server
|
|
||||||
sqlfluff # SQL linter
|
|
||||||
actionlint # GitHub Actions linter
|
|
||||||
buf # protoc plugin for linting and formatting
|
|
||||||
proselint # English prose linter
|
|
||||||
guile # scheme language
|
|
||||||
|
|
||||||
#-- Misc
|
|
||||||
tree-sitter # common language parser/highlighter
|
|
||||||
nodePackages.prettier # common code formatter
|
|
||||||
marksman # language server for markdown
|
|
||||||
glow # markdown previewer
|
|
||||||
fzf
|
|
||||||
|
|
||||||
#-- Optional Requirements:
|
|
||||||
gdu # disk usage analyzer, required by AstroNvim
|
|
||||||
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
|
|
||||||
]
|
|
||||||
++ (
|
|
||||||
if pkgs.stdenv.isDarwin
|
|
||||||
then []
|
|
||||||
else [
|
|
||||||
#-- verilog / systemverilog
|
|
||||||
verible
|
|
||||||
gdb
|
|
||||||
]
|
|
||||||
);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
{nushell-scripts, ...}: {
|
{pkgs-unstable, ...}: let
|
||||||
|
nu_scripts = pkgs-unstable.nu_scripts;
|
||||||
|
in {
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
# load the alias file for work
|
# load the alias file for work
|
||||||
bashrcExtra = ''
|
bashrcExtra = ''
|
||||||
@@ -19,13 +21,19 @@
|
|||||||
# https://github.com/nushell/nushell/issues/8214
|
# https://github.com/nushell/nushell/issues/8214
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
source /etc/agenix/alias-for-work.nushell
|
source /etc/agenix/alias-for-work.nushell
|
||||||
use ${nushell-scripts}/custom-completions/git/git-completions.nu *
|
# completion
|
||||||
use ${nushell-scripts}/custom-completions/glow/glow-completions.nu *
|
use ${nu_scripts}/share/nu_scripts/custom-completions/git/git-completions.nu *
|
||||||
use ${nushell-scripts}/custom-completions/make/make-completions.nu *
|
use ${nu_scripts}/share/nu_scripts/custom-completions/glow/glow-completions.nu *
|
||||||
use ${nushell-scripts}/custom-completions/nix/nix-completions.nu *
|
use ${nu_scripts}/share/nu_scripts/custom-completions/just/just-completions.nu *
|
||||||
use ${nushell-scripts}/custom-completions/man/man-completions.nu *
|
use ${nu_scripts}/share/nu_scripts/custom-completions/make/make-completions.nu *
|
||||||
use ${nushell-scripts}/custom-completions/cargo/cargo-completions.nu *
|
use ${nu_scripts}/share/nu_scripts/custom-completions/man/man-completions.nu *
|
||||||
use ${nushell-scripts}/custom-completions/zellij/zellij-completions.nu *
|
use ${nu_scripts}/share/nu_scripts/custom-completions/nix/nix-completions.nu *
|
||||||
|
use ${nu_scripts}/share/nu_scripts/custom-completions/cargo/cargo-completions.nu *
|
||||||
|
use ${nu_scripts}/share/nu_scripts/custom-completions/zellij/zellij-completions.nu *
|
||||||
|
# alias
|
||||||
|
use ${nu_scripts}/share/nu_scripts/aliases/git/git-aliases.nu *
|
||||||
|
use ${nu_scripts}/share/nu_scripts/aliases/eza/eza-aliases.nu *
|
||||||
|
# use ${nu_scripts}/share/nu_scripts/aliases/bat/bat-aliases.nu *
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
_: {
|
{mysecrets, ...}: {
|
||||||
|
home.file.".ssh/romantic.pub".source = "${mysecrets}/public/romantic.pub";
|
||||||
|
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
@@ -18,7 +20,7 @@ _: {
|
|||||||
# It has the same effect as adding cli option `ssh -A user@host`
|
# It has the same effect as adding cli option `ssh -A user@host`
|
||||||
ForwardAgent yes
|
ForwardAgent yes
|
||||||
# romantic holds my homelab~
|
# romantic holds my homelab~
|
||||||
IdentityFile ~/.ssh/romantic
|
IdentityFile /etc/agenix/ssh-key-romantic
|
||||||
# Specifies that ssh should only use the identity file explicitly configured above
|
# Specifies that ssh should only use the identity file explicitly configured above
|
||||||
# required to prevent sending default identity files first.
|
# required to prevent sending default identity files first.
|
||||||
IdentitiesOnly yes
|
IdentitiesOnly yes
|
||||||
@@ -38,20 +40,14 @@ _: {
|
|||||||
Host k8s-main
|
Host k8s-main
|
||||||
HostName 192.168.5.181
|
HostName 192.168.5.181
|
||||||
ForwardAgent yes
|
ForwardAgent yes
|
||||||
IdentityFile ~/.ssh/romantic
|
|
||||||
IdentitiesOnly yes
|
|
||||||
|
|
||||||
Host k8s-data1
|
Host k8s-data1
|
||||||
HostName 192.168.5.182
|
HostName 192.168.5.182
|
||||||
ForwardAgent yes
|
ForwardAgent yes
|
||||||
IdentityFile ~/.ssh/romantic
|
|
||||||
IdentitiesOnly yes
|
|
||||||
|
|
||||||
Host k8s-data2
|
Host k8s-data2
|
||||||
HostName 192.168.5.183
|
HostName 192.168.5.183
|
||||||
ForwardAgent yes
|
ForwardAgent yes
|
||||||
IdentityFile ~/.ssh/romantic
|
|
||||||
IdentitiesOnly yes
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,21 @@
|
|||||||
# Termianl Emulators
|
# Termianl Emulators
|
||||||
|
|
||||||
1. kitty: My main terminal emulator.
|
I used to spend a lot of time on terminal emulators, to make them match my taste,
|
||||||
2. wezterm: My secondary terminal emulator.
|
but now I found that it's not worth it, **Zellij can provide a user-friendly and unified user experience for all terminal emulators! without any pain**!
|
||||||
3. alacritty: Standby terminal.
|
|
||||||
|
|
||||||
|
Currently, I only use the most basic features of terminal emulators, such as true color, graphics protocol, etc.
|
||||||
|
Other features such as tabs, scrollback buffer, select/search/copy, etc, are all provided by zellij!
|
||||||
|
|
||||||
|
My current terminal emulators are:
|
||||||
|
|
||||||
|
1. kitty: My main terminal emulator.
|
||||||
|
1. to select/copy a large mount of text, We should do some tricks via kitty's `scrollback_pager` with neovim, it's really painful: <https://github.com/kovidgoyal/kitty/issues/719>
|
||||||
|
2. wezterm: My secondary terminal emulator.
|
||||||
|
1. its search ability is very basic, and it's not easy to use.
|
||||||
|
1. its scrollback buffer's copy mode is very like vim, which is nice, but zellij's even better, it can use neovim as its default scrollback buffer's editor without any pain!
|
||||||
|
3. foot: a fast, lightweight and minimalistic Wayland terminal emulator.
|
||||||
|
1. foot only do the things a terminal emulator should do, no more, no less.
|
||||||
|
1. It's really suitable for tiling window manager or zellij users!
|
||||||
|
|
||||||
## 'xterm-kitty': unknown terminal type when `ssh` into a remote host or `sudo xxx`
|
## 'xterm-kitty': unknown terminal type when `ssh` into a remote host or `sudo xxx`
|
||||||
|
|
||||||
|
|||||||
@@ -1,113 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
nur-ryan4yin,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
###########################################################
|
|
||||||
#
|
|
||||||
# Alacritty Configuration
|
|
||||||
#
|
|
||||||
# Useful Hot Keys for macOS:
|
|
||||||
# 1. Multi-Window: `command + N`
|
|
||||||
# 2. Increase Font Size: `command + =` | `command + +`
|
|
||||||
# 3. Decrease Font Size: `command + -` | `command + _`
|
|
||||||
# 4. Search Text: `command + F`
|
|
||||||
# 5. And Other common shortcuts such as Copy, Paste, Cursor Move, etc.
|
|
||||||
#
|
|
||||||
# Useful Hot Keys for Linux:
|
|
||||||
# 1. Increase Font Size: `ctrl + shift + =` | `ctrl + shift + +`
|
|
||||||
# 2. Decrease Font Size: `ctrl + shift + -` | `ctrl + shift + _`
|
|
||||||
# 3. Search Text: `ctrl + shift + N`
|
|
||||||
# 4. And Other common shortcuts such as Copy, Paste, Cursor Move, etc.
|
|
||||||
#
|
|
||||||
# Note: Alacritty do not have support for Tabs, and any graphic protocol.
|
|
||||||
#
|
|
||||||
###########################################################
|
|
||||||
{
|
|
||||||
xdg.configFile."alacritty/theme_catppuccin.yml".source = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-alacritty}/catppuccin-mocha.yml";
|
|
||||||
programs.alacritty = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.configFile."alacritty/alacritty.yml".text =
|
|
||||||
''
|
|
||||||
import:
|
|
||||||
# all alacritty themes can be found at
|
|
||||||
# https://github.com/alacritty/alacritty-theme
|
|
||||||
- ~/.config/alacritty/theme_catppuccin.yml
|
|
||||||
|
|
||||||
window:
|
|
||||||
# Background opacity
|
|
||||||
#
|
|
||||||
# Window opacity as a floating point number from `0.0` to `1.0`.
|
|
||||||
# The value `0.0` is completely transparent and `1.0` is opaque.
|
|
||||||
opacity: 0.93
|
|
||||||
|
|
||||||
# Startup Mode (changes require restart)
|
|
||||||
#
|
|
||||||
# Values for `startup_mode`:
|
|
||||||
# - Windowed
|
|
||||||
# - Maximized
|
|
||||||
# - Fullscreen
|
|
||||||
#
|
|
||||||
# Values for `startup_mode` (macOS only):
|
|
||||||
# - SimpleFullscreen
|
|
||||||
startup_mode: Maximized
|
|
||||||
|
|
||||||
# Allow terminal applications to change Alacritty's window title.
|
|
||||||
dynamic_title: true
|
|
||||||
|
|
||||||
# Make `Option` key behave as `Alt` (macOS only):
|
|
||||||
# - OnlyLeft
|
|
||||||
# - OnlyRight
|
|
||||||
# - Both
|
|
||||||
# - None (default)
|
|
||||||
option_as_alt: Both
|
|
||||||
|
|
||||||
scrolling:
|
|
||||||
# Maximum number of lines in the scrollback buffer.
|
|
||||||
# Specifying '0' will disable scrolling.
|
|
||||||
history: 10000
|
|
||||||
|
|
||||||
# Scrolling distance multiplier.
|
|
||||||
#multiplier: 3
|
|
||||||
|
|
||||||
# Font configuration
|
|
||||||
font:
|
|
||||||
# Normal (roman) font face
|
|
||||||
bold:
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
italic:
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
normal:
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
bold_italic:
|
|
||||||
# Font family
|
|
||||||
#
|
|
||||||
# If the bold italic family is not specified, it will fall back to the
|
|
||||||
# value specified for the normal font.
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
shell:
|
|
||||||
# To resolve issues:
|
|
||||||
# 1. https://github.com/ryan4yin/nix-config/issues/26
|
|
||||||
# 2. https://github.com/ryan4yin/nix-config/issues/8
|
|
||||||
# Spawn a nushell in login mode via `bash`
|
|
||||||
program: ${pkgs.bash}/bin/bash
|
|
||||||
args:
|
|
||||||
- --login
|
|
||||||
- -c
|
|
||||||
- 'nu --login --interactive'
|
|
||||||
''
|
|
||||||
+ (
|
|
||||||
if pkgs.stdenv.isDarwin
|
|
||||||
then ''
|
|
||||||
# Point size
|
|
||||||
size: 14
|
|
||||||
''
|
|
||||||
else ''
|
|
||||||
# holder identation
|
|
||||||
# Point size
|
|
||||||
size: 13
|
|
||||||
''
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -7,24 +7,10 @@
|
|||||||
#
|
#
|
||||||
# Kitty Configuration
|
# Kitty Configuration
|
||||||
#
|
#
|
||||||
# Useful Hot Keys for macOS:
|
# Useful Hot Keys for Linux(replace `ctrl + shift` with `cmd` on macOS)):
|
||||||
# 1. New Tab: `command + t`
|
# 1. Increase Font Size: `ctrl + shift + =` | `ctrl + shift + +`
|
||||||
# 2. Close Tab: `command + w`
|
# 2. Decrease Font Size: `ctrl + shift + -` | `ctrl + shift + _`
|
||||||
# 3. Switch Tab: `shift + command + [` | `shift + command + ]`
|
# 3. And Other common shortcuts such as Copy, Paste, Cursor Move, etc.
|
||||||
# 4. Increase Font Size: `command + =` | `command + +`
|
|
||||||
# 5. Decrease Font Size: `command + -` | `command + _`
|
|
||||||
# 6. And Other common shortcuts such as Copy, Paste, Cursor Move, etc.
|
|
||||||
# 7. Search in the current window(show_scrollback): `ctrl + shift + h`
|
|
||||||
# This will open a pager, it's defined by `scrollback_pager`, default is `less`
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Useful Hot Keys for Linux:
|
|
||||||
# 1. New Tab: `ctrl + shift + t`
|
|
||||||
# 2. Close Tab: `ctrl + shift + q`
|
|
||||||
# 3. Switch Tab: `ctrl + shift + right` | `ctrl + shift + left`
|
|
||||||
# 4. Increase Font Size: `ctrl + shift + =` | `ctrl + shift + +`
|
|
||||||
# 5. Decrease Font Size: `ctrl + shift + -` | `ctrl + shift + _`
|
|
||||||
# 6. And Other common shortcuts such as Copy, Paste, Cursor Move, etc.
|
|
||||||
#
|
#
|
||||||
###########################################################
|
###########################################################
|
||||||
{
|
{
|
||||||
@@ -43,14 +29,15 @@
|
|||||||
else 13;
|
else 13;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# consistent with wezterm
|
||||||
keybindings = {
|
keybindings = {
|
||||||
"ctrl+shift+m" = "toggle_maximized";
|
"ctrl+shift+m" = "toggle_maximized";
|
||||||
|
"ctrl+shift+f" = "show_scrollback"; # search in the current window
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
background_opacity = "0.93";
|
background_opacity = "0.93";
|
||||||
macos_option_as_alt = true; # Option key acts as Alt on macOS
|
macos_option_as_alt = true; # Option key acts as Alt on macOS
|
||||||
scrollback_lines = 10000;
|
|
||||||
enable_audio_bell = false;
|
enable_audio_bell = false;
|
||||||
tab_bar_edge = "top"; # tab bar on top
|
tab_bar_edge = "top"; # tab bar on top
|
||||||
# To resolve issues:
|
# To resolve issues:
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
#
|
#
|
||||||
# Wezterm Configuration
|
# Wezterm Configuration
|
||||||
#
|
#
|
||||||
|
# Useful Hot Keys for Linux(replace `ctrl + shift` with `cmd` on macOS)):
|
||||||
|
# 1. Increase Font Size: `ctrl + shift + =` | `ctrl + shift + +`
|
||||||
|
# 2. Decrease Font Size: `ctrl + shift + -` | `ctrl + shift + _`
|
||||||
|
# 3. And Other common shortcuts such as Copy, Paste, Cursor Move, etc.
|
||||||
|
#
|
||||||
# Default Keybindings: https://wezfurlong.org/wezterm/config/default-keys.html
|
# Default Keybindings: https://wezfurlong.org/wezterm/config/default-keys.html
|
||||||
#
|
#
|
||||||
###########################################################
|
###########################################################
|
||||||
@@ -15,7 +20,7 @@
|
|||||||
|
|
||||||
programs.wezterm =
|
programs.wezterm =
|
||||||
{
|
{
|
||||||
enable = true;
|
enable = false; # disable
|
||||||
|
|
||||||
# TODO: Fix: https://github.com/wez/wezterm/issues/4483
|
# TODO: Fix: https://github.com/wez/wezterm/issues/4483
|
||||||
# package = pkgs.wezterm.override { };
|
# package = pkgs.wezterm.override { };
|
||||||
@@ -66,6 +71,7 @@
|
|||||||
config.hide_tab_bar_if_only_one_tab = true
|
config.hide_tab_bar_if_only_one_tab = true
|
||||||
config.scrollback_lines = 10000
|
config.scrollback_lines = 10000
|
||||||
config.enable_scroll_bar = true
|
config.enable_scroll_bar = true
|
||||||
|
config.term = 'wezterm'
|
||||||
|
|
||||||
config.keys = {
|
config.keys = {
|
||||||
-- toggle opacity(CTRL + SHIFT + B)
|
-- toggle opacity(CTRL + SHIFT + B)
|
||||||
@@ -95,7 +101,7 @@
|
|||||||
if pkgs.stdenv.isDarwin
|
if pkgs.stdenv.isDarwin
|
||||||
then {
|
then {
|
||||||
# install wezterm via homebrew on macOS to avoid compilation, dummy package here.
|
# install wezterm via homebrew on macOS to avoid compilation, dummy package here.
|
||||||
package = pkgs.hello;
|
# package = pkgs.hello;
|
||||||
enableBashIntegration = false;
|
enableBashIntegration = false;
|
||||||
enableZshIntegration = false;
|
enableZshIntegration = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# Zellij - A workspace lives in your terminal
|
||||||
|
|
||||||
|
Zellij is a terminal workspace with batteries included.
|
||||||
|
At its core, it is a terminal multiplexer (similar to tmux and screen), but this is merely its infrastructure layer.
|
||||||
|
|
||||||
|
Zellij is very user-friendly and easy to use, with a step-by-step hint system that will help you get to know the keybindings, which is very like the Neovim or helix.
|
||||||
|
|
||||||
|
> By contrast, tmux's key design is counterintuitive, there is no prompt system, and the plug-in performance is rubbish. It's really a pain to use.
|
||||||
|
> tmux's inital release was in 2007, it's too old, I would recommend any users that do not have a experience with multiplexer to use zellij instead of tmux.
|
||||||
|
|
||||||
|
## Why use zellij as the detault terminal environment?
|
||||||
|
|
||||||
|
By auto start zellij on shell login, and exit the shell session on zellij exit, we can use zellij as the default terminal environment.
|
||||||
|
|
||||||
|
By this way, We will only use the most basic features of the terminal emulator(kitty/alacritty/wezterm/...),
|
||||||
|
while most of the functions of terminal are provided by zellij.
|
||||||
|
Thus we can easily switch to any terminal emulator without losing any key functions,
|
||||||
|
and do not need to take care of the differences between different terminal emulators.
|
||||||
|
|
||||||
|
And Zellij can be used not only locally, but also on any remote server, which is very convenient. Learn once and use everywhere!
|
||||||
|
|
||||||
|
> Yeah, you didn't misread it, zellij is very suitable for not only remotely, but also locally!
|
||||||
|
|
||||||
|
Some features such as search/copy/scrollback in different terminal emulators are implemented in different ways, and has different user experience.
|
||||||
|
For example, Wezterm's default search function is very basic, and it's not easy to use. Kitty's scrollback search/copy is really tricky to use.
|
||||||
|
As for some Editor such as Neovim, its intergrated terminal is really useful, but zellij is more powerful and useful than it, and more stable!
|
||||||
|
Zellij overcomes these problems, and provides a unified user experience for all terminal emulators!
|
||||||
|
|
||||||
|
Teminal emulators should only be responsible for displaying characters.
|
||||||
|
|
||||||
|
## Passthrough mode(Lock Mode)
|
||||||
|
|
||||||
|
`Ctrl + g` lock the outer zellij interface, and all keys will be sent to the focused pane.
|
||||||
|
|
||||||
|
It's extremely useful when you want to:
|
||||||
|
|
||||||
|
1. Use zellij locally for daily work, and use a remote zellij via ssh to do some work on the remote server.
|
||||||
|
1. To avoid the key conflicts between zellij and the program running in the terminal, such as vim, tmux, etc.
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
|
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
|
||||||
keybinds {
|
keybinds clear-defaults=true {
|
||||||
normal {
|
normal {
|
||||||
// uncomment this and adjust key if using copy_on_select=false
|
// uncomment this and adjust key if using copy_on_select=false
|
||||||
// bind "Alt c" { Copy; }
|
// bind "Alt c" { Copy; }
|
||||||
@@ -111,29 +111,29 @@ keybinds {
|
|||||||
bind "Ctrl s" { SwitchToMode "Scroll"; }
|
bind "Ctrl s" { SwitchToMode "Scroll"; }
|
||||||
bind "d" { Detach; }
|
bind "d" { Detach; }
|
||||||
}
|
}
|
||||||
tmux {
|
// tmux {
|
||||||
bind "[" { SwitchToMode "Scroll"; }
|
// bind "[" { SwitchToMode "Scroll"; }
|
||||||
bind "Ctrl b" { Write 2; SwitchToMode "Normal"; }
|
// bind "Ctrl b" { Write 2; SwitchToMode "Normal"; }
|
||||||
bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
|
// bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
|
||||||
bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
|
// bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
|
||||||
bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
|
// bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
|
||||||
bind "c" { NewTab; SwitchToMode "Normal"; }
|
// bind "c" { NewTab; SwitchToMode "Normal"; }
|
||||||
bind "," { SwitchToMode "RenameTab"; }
|
// bind "," { SwitchToMode "RenameTab"; }
|
||||||
bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
|
// bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
|
||||||
bind "n" { GoToNextTab; SwitchToMode "Normal"; }
|
// bind "n" { GoToNextTab; SwitchToMode "Normal"; }
|
||||||
bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
|
// bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
|
||||||
bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
|
// bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
|
||||||
bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
|
// bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
|
||||||
bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
|
// bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
|
||||||
bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; }
|
// bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; }
|
||||||
bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; }
|
// bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; }
|
||||||
bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; }
|
// bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; }
|
||||||
bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; }
|
// bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; }
|
||||||
bind "o" { FocusNextPane; }
|
// bind "o" { FocusNextPane; }
|
||||||
bind "d" { Detach; }
|
// bind "d" { Detach; }
|
||||||
bind "Space" { NextSwapLayout; }
|
// bind "Space" { NextSwapLayout; }
|
||||||
bind "x" { CloseFocus; SwitchToMode "Normal"; }
|
// bind "x" { CloseFocus; SwitchToMode "Normal"; }
|
||||||
}
|
// }
|
||||||
shared_except "locked" {
|
shared_except "locked" {
|
||||||
bind "Ctrl g" { SwitchToMode "Locked"; }
|
bind "Ctrl g" { SwitchToMode "Locked"; }
|
||||||
bind "Ctrl q" { Quit; }
|
bind "Ctrl q" { Quit; }
|
||||||
@@ -168,9 +168,9 @@ keybinds {
|
|||||||
shared_except "move" "locked" {
|
shared_except "move" "locked" {
|
||||||
bind "Ctrl h" { SwitchToMode "Move"; }
|
bind "Ctrl h" { SwitchToMode "Move"; }
|
||||||
}
|
}
|
||||||
shared_except "tmux" "locked" {
|
// shared_except "tmux" "locked" {
|
||||||
bind "Ctrl b" { SwitchToMode "Tmux"; }
|
// bind "Ctrl b" { SwitchToMode "Tmux"; }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
let
|
||||||
|
shellAliases = {
|
||||||
|
"zj" = "zellij";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
programs.zellij = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
# auto start zellij in nushell
|
||||||
|
programs.nushell.extraConfig = ''
|
||||||
|
# auto start zellij
|
||||||
|
if not "ZELLIJ" in $env {
|
||||||
|
if "ZELLIJ_AUTO_ATTACH" in $env and $env.ZELLIJ_AUTO_ATTACH == "true" {
|
||||||
|
^zellij attach -c
|
||||||
|
} else {
|
||||||
|
^zellij
|
||||||
|
}
|
||||||
|
|
||||||
|
# Auto exit the shell session when zellij exit
|
||||||
|
$env.ZELLIJ_AUTO_EXIT = "false" # disable auto exit
|
||||||
|
if "ZELLIJ_AUTO_EXIT" in $env and $env.ZELLIJ_AUTO_EXIT == "true" {
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
# only works in bash/zsh, not nushell
|
||||||
|
home.shellAliases = shellAliases;
|
||||||
|
programs.nushell.shellAliases = shellAliases;
|
||||||
|
|
||||||
|
xdg.configFile."zellij/config.kdl".source = ./config.kdl;
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
neofetch
|
neofetch
|
||||||
ranger # terminal file manager(batteries included, with image preview support)
|
|
||||||
|
|
||||||
# archives
|
# archives
|
||||||
zip
|
zip
|
||||||
@@ -23,8 +22,9 @@
|
|||||||
# Docs: https://github.com/learnbyexample/Command-line-text-processing
|
# Docs: https://github.com/learnbyexample/Command-line-text-processing
|
||||||
gnugrep # GNU grep, provides `grep`/`egrep`/`fgrep`
|
gnugrep # GNU grep, provides `grep`/`egrep`/`fgrep`
|
||||||
gnused # GNU sed, very powerful(mainly for replacing text in files)
|
gnused # GNU sed, very powerful(mainly for replacing text in files)
|
||||||
|
gnumake
|
||||||
|
just # a command runner like make, but simpler
|
||||||
gawk # GNU awk, a pattern scanning and processing language
|
gawk # GNU awk, a pattern scanning and processing language
|
||||||
ripgrep # recursively searches directories for a regex pattern
|
|
||||||
sad # CLI search and replace, with diff preview, really useful!!!
|
sad # CLI search and replace, with diff preview, really useful!!!
|
||||||
delta # A viewer for git and diff output
|
delta # A viewer for git and diff output
|
||||||
# A fast and polyglot tool for code searching, linting, rewriting at large scale
|
# A fast and polyglot tool for code searching, linting, rewriting at large scale
|
||||||
@@ -43,6 +43,7 @@
|
|||||||
zstd
|
zstd
|
||||||
caddy
|
caddy
|
||||||
gnupg
|
gnupg
|
||||||
|
rsync
|
||||||
|
|
||||||
# nix related
|
# nix related
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# Editors
|
||||||
|
|
||||||
|
See [desktop/editors/](../../desktop/editors/) for more details.
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{mylib, ...}: {
|
||||||
|
imports = mylib.scanPaths ./.;
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
programs.helix = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
programs = {
|
||||||
|
neovim = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
defaultEditor = true;
|
||||||
|
viAlias = true;
|
||||||
|
vimAlias = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
{pkgs, ...}: {
|
|
||||||
programs.tmux = {
|
|
||||||
enable = true;
|
|
||||||
shell = "${pkgs.nushell}/bin/nu";
|
|
||||||
|
|
||||||
# Resize the window to the size of the smallest session for which it is the current window.
|
|
||||||
#
|
|
||||||
aggressiveResize = true;
|
|
||||||
|
|
||||||
# https://github.com/tmux-plugins/tmux-sensible
|
|
||||||
# tmux-sensible overwrites default tmux shortcuts, makes them more sane.
|
|
||||||
sensibleOnTop = true;
|
|
||||||
|
|
||||||
# https://github.com/sxyazi/yazi/wiki/Image-preview-within-tmux
|
|
||||||
extraConfig = ''
|
|
||||||
set -g allow-passthrough on
|
|
||||||
|
|
||||||
set -ga update-environment TERM
|
|
||||||
set -ga update-environment TERM_PROGRAM
|
|
||||||
'';
|
|
||||||
# keyMode = "vi"; # default is emacs
|
|
||||||
|
|
||||||
baseIndex = 1; # start index from 1
|
|
||||||
escapeTime = 0; # do not wait for escape key
|
|
||||||
|
|
||||||
plugins = with pkgs.tmuxPlugins; [
|
|
||||||
{
|
|
||||||
# theme
|
|
||||||
# https://github.com/catppuccin/tmux
|
|
||||||
plugin = catppuccin;
|
|
||||||
extraConfig = ''
|
|
||||||
set -g @catppuccin_flavour 'mocha' # or frappe, macchiato, mocha
|
|
||||||
set -g @catppuccin_window_status_enable "yes"
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
|
|
||||||
# https://github.com/tmux-plugins/tmux-yank
|
|
||||||
# Enables copying to system clipboard.
|
|
||||||
yank
|
|
||||||
|
|
||||||
{
|
|
||||||
# https://github.com/tmux-plugins/tmux-resurrect
|
|
||||||
# Manually persists tmux environment across system restarts.
|
|
||||||
# prefix + Ctrl-s - save
|
|
||||||
# prefix + Ctrl-r - restore
|
|
||||||
#
|
|
||||||
plugin = resurrect;
|
|
||||||
# Restore Neovim sessions
|
|
||||||
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
|
|
||||||
}
|
|
||||||
|
|
||||||
# set -g @plugin 'tmux-plugins/tmux-cpu'
|
|
||||||
{
|
|
||||||
plugin = cpu;
|
|
||||||
extraConfig = ''
|
|
||||||
set -g status-right '#{cpu_bg_color} CPU: #{cpu_icon} #{cpu_percentage} | %a %h-%d %H:%M '
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,18 @@
|
|||||||
{pkgs-unstable, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
|
nur-ryan4yin,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
# terminal file manager
|
# terminal file manager
|
||||||
programs.yazi = {
|
programs.yazi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs-unstable.yazi;
|
package = pkgs-unstable.yazi;
|
||||||
|
# Changing working directory when exiting Yazi
|
||||||
enableBashIntegration = true;
|
enableBashIntegration = true;
|
||||||
# TODO: nushellIntegration is broken on release-23.11, wait for master's fix to be released
|
# TODO: nushellIntegration is broken on release-23.11, wait for master's fix to be released
|
||||||
enableNushellIntegration = false;
|
enableNushellIntegration = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xdg.configFile."yazi/theme.toml".source = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-yazi}/mocha.toml";
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
_: {
|
let
|
||||||
|
shellAliases = {
|
||||||
|
"zj" = "zellij";
|
||||||
|
};
|
||||||
|
in {
|
||||||
programs.zellij = {
|
programs.zellij = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
# only works in bash/zsh, not nushell
|
||||||
xdg.configFile."zellij/config.kdl".source = ./config.kdl;
|
home.shellAliases = shellAliases;
|
||||||
|
programs.nushell.shellAliases = shellAliases;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# Home Manager's Darwin Submodules
|
# Home Manager's Darwin Submodules
|
||||||
|
|
||||||
1. `core.nix`: some basic configuration.
|
1. `core.nix`: some basic configuration.
|
||||||
2. `nushell.nix`: nushell's configuration for darwin.
|
|
||||||
3. `rime-squirrel.nix`: [rime-squirrel](https://github.com/rime/squirrel)'s configuration.
|
3. `rime-squirrel.nix`: [rime-squirrel](https://github.com/rime/squirrel)'s configuration.
|
||||||
4. `default.nix`: the entrypoint of darwin's configuration, it import all the submodules above.
|
4. `default.nix`: the entrypoint of darwin's configuration, it import all the submodules above.
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
{
|
{pkgs, ...}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
clash-meta
|
||||||
|
];
|
||||||
home.file.".proxychains/proxychains.conf".source = ./proxychains.conf;
|
home.file.".proxychains/proxychains.conf".source = ./proxychains.conf;
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
{
|
let
|
||||||
|
envExtra = ''
|
||||||
|
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
|
||||||
|
'';
|
||||||
|
in {
|
||||||
# Homebrew's default install location:
|
# Homebrew's default install location:
|
||||||
# /opt/homebrew for Apple Silicon
|
# /opt/homebrew for Apple Silicon
|
||||||
# /usr/local for macOS Intel
|
# /usr/local for macOS Intel
|
||||||
@@ -6,14 +10,10 @@
|
|||||||
# in /opt/homebrew for Apple Silicon and /usr/local for Rosetta 2 to coexist and use bottles.
|
# in /opt/homebrew for Apple Silicon and /usr/local for Rosetta 2 to coexist and use bottles.
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
bashrcExtra = ''
|
bashrcExtra = envExtra;
|
||||||
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
envExtra = ''
|
envExtra = envExtra;
|
||||||
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-17
@@ -2,22 +2,7 @@
|
|||||||
|
|
||||||
1. `base`: The base module that is suitable for any NixOS environment.
|
1. `base`: The base module that is suitable for any NixOS environment.
|
||||||
2. `desktop`: Configuration for desktop environments, such as Hyprland, I3, etc.
|
2. `desktop`: Configuration for desktop environments, such as Hyprland, I3, etc.
|
||||||
3. `fcitx5`: fcitx5's configuration(Chinese input method).
|
|
||||||
4. `hyprland`: Hyprland's configuration.
|
|
||||||
5. `i3`: i3's configuration.
|
|
||||||
6. `server.nix`: Configuration which is suitable for both servers and desktops. It import only `base` as its submodule.
|
6. `server.nix`: Configuration which is suitable for both servers and desktops. It import only `base` as its submodule.
|
||||||
1. used by all my nixos servers.
|
1. used by all my nixos servers.
|
||||||
6. `desktop-hyprland.nix`: the entrypoint of hyprland's configuration, it import all the submodules above, except `i3`.
|
7. `desktop.nix`: the entrypoint of desktop's configuration, it import both `base` and `desktop` as its submodules.
|
||||||
1. used by my hyprland desktop.
|
1. used by all my nixos desktops.
|
||||||
7. `desktop-i3.nix`: the entrypoint of i3's configuration, it import all the submodules above, except `hyprland`.
|
|
||||||
1. used by my i3 desktop.
|
|
||||||
|
|
||||||
|
|
||||||
## Why install I3/Hyprland in Home Manager instead of a NixOS Module?
|
|
||||||
|
|
||||||
1. I3 & Hyprland's configuration file is located in `~/.config`, which can be easily managed by Home Manager.
|
|
||||||
2. There're other user-specific systemd servcies, such gammastep, wallpaper-switcher, etc. which can be easily managed by Home Manager, but if we start i3/hyprland in NixOS Module, they may failed to start automatically. With i3/hyprland installed via home-manager, we can control their systemd service's dependent order, to avoid issues like this.
|
|
||||||
3. By install as less as possible in NixOS Module, we can:
|
|
||||||
1. Make the NixOS system more secure and stable.
|
|
||||||
2. Make this flake more portable to other non-NixOS systems, as home-manager can be installed on any Linux system.
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
|
{
|
||||||
{config, username, ...}: let
|
config,
|
||||||
|
username,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
d = config.xdg.dataHome;
|
d = config.xdg.dataHome;
|
||||||
c = config.xdg.configHome;
|
c = config.xdg.configHome;
|
||||||
cache = config.xdg.cacheHome;
|
cache = config.xdg.cacheHome;
|
||||||
in rec {
|
in rec {
|
||||||
|
|
||||||
home.homeDirectory = "/home/${username}";
|
home.homeDirectory = "/home/${username}";
|
||||||
|
|
||||||
# environment variables that always set at login
|
# environment variables that always set at login
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Desktop Related
|
||||||
|
|
||||||
|
|
||||||
|
3. `base`: all common configurations for all desktops.
|
||||||
|
4. `hyprland`: Hyprland's configuration.
|
||||||
|
5. `i3`: i3's configuration.
|
||||||
|
|
||||||
|
|
||||||
|
## Why install I3/Hyprland in Home Manager instead of a NixOS Module?
|
||||||
|
|
||||||
|
1. I3 & Hyprland's configuration file is located in `~/.config`, which can be easily managed by Home Manager.
|
||||||
|
2. There're other user-specific systemd servcies, such gammastep, wallpaper-switcher, etc. which can be easily managed by Home Manager, but if we start i3/hyprland in NixOS Module, they may failed to start automatically. With i3/hyprland installed via home-manager, we can control their systemd service's dependent order, to avoid issues like this.
|
||||||
|
3. By install as less as possible in NixOS Module, we can:
|
||||||
|
1. Make the NixOS system more secure and stable.
|
||||||
|
2. Make this flake more portable to other non-NixOS systems, as home-manager can be installed on any Linux system.
|
||||||
|
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# GUI apps
|
# GUI apps
|
||||||
# e-book viewer(.epub/.mobi/...)
|
# e-book viewer(.epub/.mobi/...)
|
||||||
@@ -8,7 +12,7 @@
|
|||||||
# instant messaging
|
# instant messaging
|
||||||
telegram-desktop
|
telegram-desktop
|
||||||
discord
|
discord
|
||||||
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
|
pkgs-unstable.qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
|
||||||
|
|
||||||
# remote desktop(rdp connect)
|
# remote desktop(rdp connect)
|
||||||
remmina
|
remmina
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
text = ''
|
text = ''
|
||||||
export WALLPAPERS_DIR="${wallpapers}"
|
export WALLPAPERS_DIR="${wallpapers}"
|
||||||
export WALLPAPERS_STATE_FILEPATH="${config.xdg.stateHome}/wallpaper-switcher/switcher_state"
|
export WALLPAPERS_STATE_FILEPATH="${config.xdg.stateHome}/wallpaper-switcher/switcher_state"
|
||||||
export WALLPAPER_WAIT_MIN=10
|
export WALLPAPER_WAIT_MIN=60
|
||||||
export WALLPAPER_WAIT_MAX=20
|
export WALLPAPER_WAIT_MAX=180
|
||||||
exec ${./wallpaper-switcher.py}
|
exec ${./wallpaper-switcher.py}
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,6 +8,9 @@ input {
|
|||||||
kb_rules=
|
kb_rules=
|
||||||
follow_mouse=1
|
follow_mouse=1
|
||||||
natural_scroll=0
|
natural_scroll=0
|
||||||
|
touchpad {
|
||||||
|
natural_scroll = 1
|
||||||
|
}
|
||||||
force_no_accel=0
|
force_no_accel=0
|
||||||
# repeat_rate=
|
# repeat_rate=
|
||||||
# repeat_delay=
|
# repeat_delay=
|
||||||
@@ -52,6 +55,7 @@ decoration {
|
|||||||
#-- Animations ----------------------------------------------------
|
#-- Animations ----------------------------------------------------
|
||||||
animations {
|
animations {
|
||||||
enabled=1
|
enabled=1
|
||||||
|
# animation=NAME,ONOFF,SPEED,CURVE,STYLE
|
||||||
animation=windows,1,8,default,popin 80%
|
animation=windows,1,8,default,popin 80%
|
||||||
animation=fadeOut,1,8,default
|
animation=fadeOut,1,8,default
|
||||||
animation=fadeIn,1,8,default
|
animation=fadeIn,1,8,default
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"modules-right": [
|
"modules-right": [
|
||||||
"mpd",
|
"mpd",
|
||||||
"pulseaudio",
|
"pulseaudio",
|
||||||
|
"battery",
|
||||||
"memory",
|
"memory",
|
||||||
"cpu",
|
"cpu",
|
||||||
"network",
|
"network",
|
||||||
@@ -178,5 +179,29 @@
|
|||||||
"tray": {
|
"tray": {
|
||||||
"icon-size": 15,
|
"icon-size": 15,
|
||||||
"spacing": 5
|
"spacing": 5
|
||||||
}
|
},
|
||||||
|
"battery": {
|
||||||
|
"bat": "BAT0",
|
||||||
|
"adapter": "ADP0",
|
||||||
|
"interval": 60,
|
||||||
|
"states": {
|
||||||
|
"warning": 30,
|
||||||
|
"critical": 15
|
||||||
|
},
|
||||||
|
"max-length": 20,
|
||||||
|
"format": "{icon} {capacity}%",
|
||||||
|
"format-warning": "{icon} {capacity}%",
|
||||||
|
"format-critical": "{icon} {capacity}%",
|
||||||
|
"format-charging": "<span font-family='Font Awesome 6 Free'></span> {capacity}%",
|
||||||
|
"format-plugged": " {capacity}%",
|
||||||
|
"format-alt": "{icon} {time}",
|
||||||
|
"format-full": " {capacity}%",
|
||||||
|
"format-icons": [
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" "
|
||||||
|
]
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* https://github.com/catppuccin/waybar/blob/main/themes/mocha.css
|
||||||
|
*
|
||||||
|
* Catppuccin Mocha palette
|
||||||
|
* Maintainer: rubyowo
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
@define-color base #1e1e2e;
|
||||||
|
@define-color mantle #181825;
|
||||||
|
@define-color crust #11111b;
|
||||||
|
|
||||||
|
@define-color text #cdd6f4;
|
||||||
|
@define-color subtext0 #a6adc8;
|
||||||
|
@define-color subtext1 #bac2de;
|
||||||
|
|
||||||
|
@define-color surface0 #313244;
|
||||||
|
@define-color surface1 #45475a;
|
||||||
|
@define-color surface2 #585b70;
|
||||||
|
|
||||||
|
@define-color overlay0 #6c7086;
|
||||||
|
@define-color overlay1 #7f849c;
|
||||||
|
@define-color overlay2 #9399b2;
|
||||||
|
|
||||||
|
@define-color blue #89b4fa;
|
||||||
|
@define-color lavender #b4befe;
|
||||||
|
@define-color sapphire #74c7ec;
|
||||||
|
@define-color sky #89dceb;
|
||||||
|
@define-color teal #94e2d5;
|
||||||
|
@define-color green #a6e3a1;
|
||||||
|
@define-color yellow #f9e2af;
|
||||||
|
@define-color peach #fab387;
|
||||||
|
@define-color maroon #eba0ac;
|
||||||
|
@define-color red #f38ba8;
|
||||||
|
@define-color mauve #cba6f7;
|
||||||
|
@define-color pink #f5c2e7;
|
||||||
|
@define-color flamingo #f2cdcd;
|
||||||
|
@define-color rosewater #f5e0dc;
|
||||||
|
|
||||||
|
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
|
@import "mocha.css";
|
||||||
|
|
||||||
* {
|
* {
|
||||||
|
/* https://docs.gtk.org/gtk3/css-overview.html#colors */
|
||||||
|
color: @text;
|
||||||
font-family: "JetBrainsMono Nerd Font";
|
font-family: "JetBrainsMono Nerd Font";
|
||||||
font-size: 12pt;
|
font-size: 12pt;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -23,12 +27,13 @@
|
|||||||
}
|
}
|
||||||
window#waybar {
|
window#waybar {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
border: 2px solid alpha(@crust, 0.3);
|
||||||
}
|
}
|
||||||
window > box {
|
window > box {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
background-color: #1e1e2a;
|
background-color: shade(@base, 0.9);
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
border: 2px none #33ccff;
|
border: 2px none #33ccff;
|
||||||
@@ -97,9 +102,28 @@ tooltip label {
|
|||||||
#clock {
|
#clock {
|
||||||
color: rgb(217, 224, 238);
|
color: rgb(217, 224, 238);
|
||||||
}
|
}
|
||||||
/* #idle_inhibitor {
|
|
||||||
|
#idle_inhibitor {
|
||||||
color: rgb(221, 182, 242);
|
color: rgb(221, 182, 242);
|
||||||
}*/
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
#battery {
|
||||||
|
min-width: 55px;
|
||||||
|
color: rgb(126, 186, 244);
|
||||||
|
}
|
||||||
|
#battery.charging,
|
||||||
|
#battery.full,
|
||||||
|
#battery.plugged {
|
||||||
|
color: #26a65b;
|
||||||
|
}
|
||||||
|
#battery.critical:not(.charging) {
|
||||||
|
color: #f53c3c;
|
||||||
|
animation-name: blink;
|
||||||
|
animation-duration: 0.5s;
|
||||||
|
animation-timing-function: linear;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-direction: alternate;
|
||||||
|
}
|
||||||
#custom-wall {
|
#custom-wall {
|
||||||
color: #33ccff;
|
color: #33ccff;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
# misc
|
# misc
|
||||||
"_JAVA_AWT_WM_NONREPARENTING,1"
|
"_JAVA_AWT_WM_NONREPARENTING,1"
|
||||||
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
|
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
|
||||||
|
"QT_QPA_PLATFORM,wayland"
|
||||||
|
"SDL_VIDEODRIVER,wayland"
|
||||||
|
"GDK_BACKEND,wayland"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
package = hyprland.packages.${pkgs.system}.hyprland;
|
package = hyprland.packages.${pkgs.system}.hyprland;
|
||||||
|
|||||||
@@ -1,6 +1,40 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
|
pkgs,
|
||||||
|
nur-ryan4yin,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
# refer to https://codeberg.org/dnkl/foot/src/branch/master/foot.ini
|
||||||
|
xdg.configFile."foot/foot.ini".text =
|
||||||
|
''
|
||||||
|
[main]
|
||||||
|
dpi-aware=yes
|
||||||
|
font=JetBrainsMono Nerd Font:size=13
|
||||||
|
shell=${pkgs.bash}/bin/bash --login -c 'nu --login --interactive'
|
||||||
|
term=foot
|
||||||
|
initial-window-size-pixels=3840x2160
|
||||||
|
initial-window-mode=windowed
|
||||||
|
pad=0x0 # optionally append 'center'
|
||||||
|
resize-delay-ms=10
|
||||||
|
|
||||||
|
[mouse]
|
||||||
|
hide-when-typing=yes
|
||||||
|
''
|
||||||
|
+ (builtins.readFile "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-foot}/catppuccin-mocha.conf");
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
# a wayland only terminal emulator
|
||||||
|
foot = {
|
||||||
|
enable = true;
|
||||||
|
# foot can also be run in a server mode. In this mode, one process hosts multiple windows.
|
||||||
|
# All Wayland communication, VT parsing and rendering is done in the server process.
|
||||||
|
# New windows are opened by running footclient, which remains running until the terminal window is closed.
|
||||||
|
#
|
||||||
|
# Advantages to run foot in server mode including reduced memory footprint and startup time.
|
||||||
|
# The downside is a performance penalty. If one window is very busy with, for example, producing output,
|
||||||
|
# then other windows will suffer. Also, should the server process crash, all windows will be gone.
|
||||||
|
server.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
|
||||||
google-chrome = {
|
google-chrome = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
# config starts here: #
|
# config starts here: #
|
||||||
#######################
|
#######################
|
||||||
|
|
||||||
# Font for window titles. Will also be used by the bar unless a different font
|
# Font for window titles.
|
||||||
# is used in the bar {} block below.
|
|
||||||
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
||||||
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
||||||
font pango: Noto Sans Regular 10
|
font pango: Noto Sans Regular 10
|
||||||
@@ -85,9 +84,6 @@ bindsym $mod+Return exec kitty
|
|||||||
# kill focused window
|
# kill focused window
|
||||||
bindsym $mod+q kill
|
bindsym $mod+q kill
|
||||||
|
|
||||||
# exit-menu
|
|
||||||
bindsym $mod+Shift+e exec ~/.config/i3/scripts/powermenu
|
|
||||||
|
|
||||||
# Lock the system
|
# Lock the system
|
||||||
# lock with a picture:
|
# lock with a picture:
|
||||||
#bindsym $mod+l exec i3lock -i ~/.config/i3/i3-lock-screen.png -p default|win -t
|
#bindsym $mod+l exec i3lock -i ~/.config/i3/i3-lock-screen.png -p default|win -t
|
||||||
@@ -157,15 +153,15 @@ bindsym $mod+Shift+n exec ~/.config/i3/scripts/empty_workspace
|
|||||||
# Multimedia Keys
|
# Multimedia Keys
|
||||||
|
|
||||||
# volume
|
# volume
|
||||||
bindsym XF86AudioRaiseVolume exec amixer -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks
|
bindsym XF86AudioRaiseVolume exec amixer -D pulse sset Master 5%+ && pkill -RTMIN+1 polybar
|
||||||
bindsym XF86AudioLowerVolume exec amixer -D pulse sset Master 5%- && pkill -RTMIN+1 i3blocks
|
bindsym XF86AudioLowerVolume exec amixer -D pulse sset Master 5%- && pkill -RTMIN+1 polybar
|
||||||
|
|
||||||
# gradular volume control
|
# gradular volume control
|
||||||
bindsym $mod+XF86AudioRaiseVolume exec amixer -D pulse sset Master 1%+ && pkill -RTMIN+1 i3blocks
|
bindsym $mod+XF86AudioRaiseVolume exec amixer -D pulse sset Master 1%+ && pkill -RTMIN+1 polybar
|
||||||
bindsym $mod+XF86AudioLowerVolume exec amixer -D pulse sset Master 1%- && pkill -RTMIN+1 i3blocks
|
bindsym $mod+XF86AudioLowerVolume exec amixer -D pulse sset Master 1%- && pkill -RTMIN+1 polybar
|
||||||
|
|
||||||
# mute
|
# mute
|
||||||
bindsym XF86AudioMute exec amixer sset Master toggle && killall -USR1 i3blocks
|
bindsym XF86AudioMute exec amixer sset Master toggle && killall -USR1 polybar
|
||||||
|
|
||||||
# audio control
|
# audio control
|
||||||
bindsym XF86AudioPlay exec playerctl play
|
bindsym XF86AudioPlay exec playerctl play
|
||||||
@@ -181,13 +177,6 @@ bindsym $mod+w exec /usr/bin/firefox
|
|||||||
bindsym $mod+n exec /usr/bin/thunar
|
bindsym $mod+n exec /usr/bin/thunar
|
||||||
bindsym Print exec scrot ~/%Y-%m-%d-%T-screenshot.png && notify-send "Screenshot saved to ~/$(date +"%Y-%m-%d-%T")-screenshot.png"
|
bindsym Print exec scrot ~/%Y-%m-%d-%T-screenshot.png && notify-send "Screenshot saved to ~/$(date +"%Y-%m-%d-%T")-screenshot.png"
|
||||||
|
|
||||||
# Power Profiles menu switcher (rofi)
|
|
||||||
bindsym $mod+Shift+p exec ~/.config/i3/scripts/power-profiles
|
|
||||||
|
|
||||||
|
|
||||||
bindsym $mod+Shift+m exec ~/.config/i3/scripts/restore-idols-monitor.sh
|
|
||||||
|
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# configuration for workspace behaviour: #
|
# configuration for workspace behaviour: #
|
||||||
##########################################
|
##########################################
|
||||||
@@ -245,14 +234,10 @@ exec_always --no-startup-id picom -b
|
|||||||
# for custom config:
|
# for custom config:
|
||||||
#exec_always --no-startup-id picom --config ~/.config/picom.conf
|
#exec_always --no-startup-id picom --config ~/.config/picom.conf
|
||||||
|
|
||||||
|
|
||||||
#############################################
|
#############################################
|
||||||
# autostart applications/services on login: #
|
# autostart applications/services on login: #
|
||||||
#############################################
|
#############################################
|
||||||
|
|
||||||
#get auth work with polkit-gnome
|
|
||||||
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
|
||||||
|
|
||||||
# dex execute .desktop files + apps using /etc/xdg/autostart.
|
# dex execute .desktop files + apps using /etc/xdg/autostart.
|
||||||
exec --no-startup-id dex --autostart --environment i3
|
exec --no-startup-id dex --autostart --environment i3
|
||||||
|
|
||||||
@@ -270,7 +255,6 @@ exec --no-startup-id xset s 480 dpms 600 600 600
|
|||||||
#exec --no-startup-id /usr/bin/dunst --config ~/.config/dunst/dunstrc
|
#exec --no-startup-id /usr/bin/dunst --config ~/.config/dunst/dunstrc
|
||||||
exec --no-startup-id /usr/bin/dunst
|
exec --no-startup-id /usr/bin/dunst
|
||||||
|
|
||||||
|
|
||||||
# screenshot tool
|
# screenshot tool
|
||||||
exec --no-startup-id flameshot
|
exec --no-startup-id flameshot
|
||||||
|
|
||||||
@@ -280,8 +264,6 @@ exec_always --no-startup-id autotiling
|
|||||||
|
|
||||||
exec --no-startup-id i3-msg "workspace $ws2; exec firefox"
|
exec --no-startup-id i3-msg "workspace $ws2; exec firefox"
|
||||||
|
|
||||||
exec --no-startup-id sleep 1 && ~/.config/i3/scripts/restore-idols-monitor.sh
|
|
||||||
|
|
||||||
##################
|
##################
|
||||||
# floating rules #
|
# floating rules #
|
||||||
##################
|
##################
|
||||||
@@ -306,9 +288,8 @@ for_window [class="urxvt"] border pixel 1
|
|||||||
# set position of floating window
|
# set position of floating window
|
||||||
#for_window [class=".*"] move position center
|
#for_window [class=".*"] move position center
|
||||||
|
|
||||||
|
|
||||||
######################################
|
######################################
|
||||||
# color settings for bar and windows #
|
# color settings for windows #
|
||||||
######################################
|
######################################
|
||||||
|
|
||||||
# https://github.com/catppuccin/i3/blob/main/themes/catppuccin-mocha
|
# https://github.com/catppuccin/i3/blob/main/themes/catppuccin-mocha
|
||||||
@@ -336,7 +317,6 @@ set $surface1 #45475a
|
|||||||
set $surface0 #313244
|
set $surface0 #313244
|
||||||
set $base #1e1e2e
|
set $base #1e1e2e
|
||||||
# use colors in the RGBA format, the last two digits are transparency
|
# use colors in the RGBA format, the last two digits are transparency
|
||||||
set $base_i3bar #1e1e2ee6
|
|
||||||
set $mantle #181825
|
set $mantle #181825
|
||||||
set $crust #11111b
|
set $crust #11111b
|
||||||
|
|
||||||
@@ -348,62 +328,6 @@ client.urgent $pink $base $lavender $overlay0 $pink
|
|||||||
client.placeholder $overlay0 $base $text $overlay0 $overlay0
|
client.placeholder $overlay0 $base $text $overlay0 $overlay0
|
||||||
client.background $base
|
client.background $base
|
||||||
|
|
||||||
|
# Start Polybar
|
||||||
|
exec_always --no-startup-id $HOME/.config/polybar/launch.sh --shapes
|
||||||
|
|
||||||
############################################
|
|
||||||
# bar settings (input comes from i3blocks) #
|
|
||||||
############################################
|
|
||||||
|
|
||||||
# Start i3bar to display a workspace bar
|
|
||||||
# (plus the system information i3status finds out, if available)
|
|
||||||
bar {
|
|
||||||
font pango: Noto Sans Regular 10
|
|
||||||
status_command i3blocks -c ~/.config/i3/i3blocks.conf
|
|
||||||
position top
|
|
||||||
# you can add different bars for multidisplay setups on each display by using `output`
|
|
||||||
output DP-2
|
|
||||||
|
|
||||||
# enable transparency for i3bar
|
|
||||||
i3bar_command i3bar --transparency
|
|
||||||
|
|
||||||
# it could be that you have no primary display set: set one (xrandr --output <output> --primary)
|
|
||||||
# reference: https://i3wm.org/docs/userguide.html#_tray_output
|
|
||||||
#tray_output primary
|
|
||||||
tray_padding 0
|
|
||||||
|
|
||||||
# When strip_workspace_numbers is set to yes,
|
|
||||||
# any workspace that has a name of the form
|
|
||||||
# “[n][:][NAME]” will display only the name.
|
|
||||||
strip_workspace_numbers yes
|
|
||||||
##strip_workspace_name no
|
|
||||||
|
|
||||||
colors {
|
|
||||||
separator $pink
|
|
||||||
background $base_transparent
|
|
||||||
statusline $lavender
|
|
||||||
# border bg txt indicator
|
|
||||||
focused_workspace $surface2 $overlay1 $surface1 $pink
|
|
||||||
active_workspace $peach $surface2 $surface1 $pink
|
|
||||||
inactive_workspace $surface1 $surface2 $overlay1 $pink
|
|
||||||
urgent_workspace $red $red $lavender $pink
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#####################################
|
|
||||||
# Application menu handled by rofi: #
|
|
||||||
#####################################
|
|
||||||
|
|
||||||
## rofi bindings fancy application menu ($mod+d /F9 optional disabled)
|
|
||||||
|
|
||||||
bindsym $mod+d exec rofi -modi drun -show drun \
|
|
||||||
-config ~/.config/rofi/rofidmenu.rasi \
|
|
||||||
-dpi 162
|
|
||||||
|
|
||||||
## rofi bindings for window menu ($mod+t /F10 optional disabled)
|
|
||||||
bindsym $mod+t exec rofi -show window \
|
|
||||||
-config ~/.config/rofi/rofidmenu.rasi \
|
|
||||||
-dpi 162
|
|
||||||
|
|
||||||
## rofi bindings to manage clipboard (install rofi-greenclip from the AUR)
|
|
||||||
#exec --no-startup-id greenclip daemon>/dev/null
|
|
||||||
#bindsym $mod+c exec --no-startup-id rofi -modi "clipboard:greenclip print" -show clipboard \
|
|
||||||
# -config ~/.config/rofi/rofidmenu.rasi
|
|
||||||
|
|||||||
@@ -1,142 +0,0 @@
|
|||||||
#
|
|
||||||
# _ _____ _ _ _
|
|
||||||
# (_)___ /| |__ | | ___ ___| | _____
|
|
||||||
# | | |_ \| '_ \| |/ _ \ / __| |/ / __|
|
|
||||||
# | |___) | |_) | | (_) | (__| <\__ \
|
|
||||||
# |_|____/|_.__/|_|\___/ \___|_|\_\___/
|
|
||||||
#
|
|
||||||
# Official repository for community contributed blocklets:
|
|
||||||
# https://github.com/vivien/i3blocks-contrib
|
|
||||||
#
|
|
||||||
# NOTE: every command's ouput should end with a newline character (\n), otherwise the block may not be displayed correctly.
|
|
||||||
|
|
||||||
# Global properties
|
|
||||||
# The top properties below are applied to every block, but can be overridden.
|
|
||||||
separator=false
|
|
||||||
markup=pango
|
|
||||||
|
|
||||||
[terminal]
|
|
||||||
full_text=
|
|
||||||
color=#807dfe
|
|
||||||
command=i3-msg -q exec kitty
|
|
||||||
|
|
||||||
[browser]
|
|
||||||
full_text=
|
|
||||||
color=#ff7f81
|
|
||||||
command=i3-msg -q exec firefox
|
|
||||||
|
|
||||||
[files]
|
|
||||||
full_text=
|
|
||||||
color=#7f3fbf
|
|
||||||
command=i3-msg -q exec thunar ~/
|
|
||||||
|
|
||||||
[simple-2]
|
|
||||||
full_text=: :
|
|
||||||
color=#717171
|
|
||||||
|
|
||||||
|
|
||||||
# Disk usage
|
|
||||||
#
|
|
||||||
# The directory defaults to $HOME if the instance is not specified.
|
|
||||||
# The script may be called with a optional argument to set the alert
|
|
||||||
# (defaults to 10 for 10%).
|
|
||||||
[disk]
|
|
||||||
command=df -h / | awk '/\//{ printf(" %4s/%s \n", $4, $2) }'
|
|
||||||
interval=30
|
|
||||||
label=<span color="#50fa7b"> </span>
|
|
||||||
border=#50fa7b
|
|
||||||
border_top=1
|
|
||||||
border_right=0
|
|
||||||
border_bottom=0
|
|
||||||
border_left=0
|
|
||||||
|
|
||||||
|
|
||||||
# Memory usage
|
|
||||||
#
|
|
||||||
# The type defaults to "mem" if the instance is not specified.
|
|
||||||
[memory]
|
|
||||||
command=free -h | awk '/Mem:/ { printf(" %5s/%s \n", $3, $2) }'
|
|
||||||
interval=2
|
|
||||||
label=<span color="#f1fa8c"> </span>
|
|
||||||
border=#f1fa8c
|
|
||||||
border_top=1
|
|
||||||
border_right=0
|
|
||||||
border_bottom=0
|
|
||||||
border_left=0
|
|
||||||
|
|
||||||
[cpu_stats]
|
|
||||||
command=(mpstat 1 1 | grep Average | awk '{ printf "%04.1f<span color=\"#ff5555\">%</span>", (100 - $12) }') && (sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*' -o | awk '{ printf "%s<span color=\"#ff5555\">°C</span>\n", $2 }')
|
|
||||||
interval=2
|
|
||||||
label=<span color="#ff5555"><b>CPU: </b></span>
|
|
||||||
border=#ff5555
|
|
||||||
border_top=1
|
|
||||||
border_right=0
|
|
||||||
border_bottom=0
|
|
||||||
border_left=0
|
|
||||||
|
|
||||||
|
|
||||||
[nvidia_gpu_stats]
|
|
||||||
command=nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits | awk '{ printf "%02i<span color=\"#ffb86c\">%</span>", $0}' && nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits | awk '{ printf "+%i<span color=\"#ffb86c\">°C</span>\n", $0}'
|
|
||||||
label=<span color="#ffb86c"><b>GPU: </b></span>
|
|
||||||
interval=5
|
|
||||||
border=#ffb86c
|
|
||||||
border_top=1
|
|
||||||
border_right=0
|
|
||||||
border_bottom=0
|
|
||||||
border_left=0
|
|
||||||
|
|
||||||
|
|
||||||
# https://github.com/vivien/i3blocks-contrib/blob/master/bandwidth3/README.md
|
|
||||||
[bandwidth]
|
|
||||||
command=~/.config/i3/scripts/bandwidth
|
|
||||||
label=<span color="#ff79c6"></span>
|
|
||||||
interval=persist
|
|
||||||
border=#ff79c6
|
|
||||||
border_top=1
|
|
||||||
border_right=0
|
|
||||||
border_bottom=0
|
|
||||||
border_left=0
|
|
||||||
|
|
||||||
|
|
||||||
[pavucontrol]
|
|
||||||
full_text=
|
|
||||||
command=pavucontrol
|
|
||||||
border=#ffffff
|
|
||||||
border_top=1
|
|
||||||
border_right=0
|
|
||||||
border_bottom=0
|
|
||||||
border_left=0
|
|
||||||
|
|
||||||
|
|
||||||
[date]
|
|
||||||
command=date
|
|
||||||
interval=60
|
|
||||||
label=<span color="#ff5555"> </span>
|
|
||||||
border=#ff5555
|
|
||||||
border_top=1
|
|
||||||
border_right=0
|
|
||||||
border_bottom=0
|
|
||||||
border_left=0
|
|
||||||
|
|
||||||
|
|
||||||
# power-profiles-daemon implementation:
|
|
||||||
# needs package power-profiles-daemon installed and the service running see here:
|
|
||||||
# https://wiki.archlinux.org/title/CPU_frequency_scaling#power-profiles-daemon
|
|
||||||
[ppd_menu]
|
|
||||||
full_text=
|
|
||||||
command=~/.config/i3/scripts/power-profiles
|
|
||||||
color=#50fa7b
|
|
||||||
|
|
||||||
#Show the current power-profile
|
|
||||||
[ppd-status]
|
|
||||||
command=powerprofilesctl get
|
|
||||||
interval=5
|
|
||||||
|
|
||||||
|
|
||||||
[shutdown_menu]
|
|
||||||
full_text=
|
|
||||||
command=~/.config/i3/scripts/powermenu
|
|
||||||
|
|
||||||
[simple-2]
|
|
||||||
full_text=: :
|
|
||||||
color=#717171
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
# I3 Layouts
|
|
||||||
|
|
||||||
This directory contains the layouts for i3.
|
|
||||||
|
|
||||||
The are generated using the `i3-save-tree` command, and need to customized to make it work.
|
|
||||||
|
|
||||||
See the [i3 user guide](https://i3wm.org/docs/layout-saving.html) for more information.
|
|
||||||
|
|
||||||
## Idol's Monitor
|
|
||||||
|
|
||||||
the `idol-monitor.json` file contains the layout showing my nix distributed building monitor, it's a 2x2 grid of terminals running `btop`:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
the layout & btop are autostarted by i3.
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
// vim:ts=4:sw=4:et
|
|
||||||
{
|
|
||||||
// splitv split container with 2 children
|
|
||||||
"border": "pixel",
|
|
||||||
"floating": "auto_off",
|
|
||||||
"layout": "splitv",
|
|
||||||
"marks": [],
|
|
||||||
"percent": 0.5,
|
|
||||||
"type": "con",
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"border": "pixel",
|
|
||||||
"current_border_width": 2,
|
|
||||||
"floating": "auto_off",
|
|
||||||
"geometry": {
|
|
||||||
"height": 600,
|
|
||||||
"width": 800,
|
|
||||||
"x": 0,
|
|
||||||
"y": 0
|
|
||||||
},
|
|
||||||
"marks": [],
|
|
||||||
"name": "Alacritty",
|
|
||||||
"percent": 0.5,
|
|
||||||
"swallows": [
|
|
||||||
{
|
|
||||||
"class": "^Alacritty$",
|
|
||||||
"instance": "^Alacritty$",
|
|
||||||
"machine": "^ai$",
|
|
||||||
"title": "^ai$"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "con"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"border": "pixel",
|
|
||||||
"current_border_width": 2,
|
|
||||||
"floating": "auto_off",
|
|
||||||
"geometry": {
|
|
||||||
"height": 600,
|
|
||||||
"width": 800,
|
|
||||||
"x": 0,
|
|
||||||
"y": 0
|
|
||||||
},
|
|
||||||
"marks": [],
|
|
||||||
"name": "Alacritty",
|
|
||||||
"percent": 0.5,
|
|
||||||
"swallows": [
|
|
||||||
{
|
|
||||||
"class": "^Alacritty$",
|
|
||||||
"instance": "^Alacritty$",
|
|
||||||
"machine": "^ai$",
|
|
||||||
"title": "^ruby$"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "con"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
// splitv split container with 2 children
|
|
||||||
"border": "pixel",
|
|
||||||
"floating": "auto_off",
|
|
||||||
"layout": "splitv",
|
|
||||||
"marks": [],
|
|
||||||
"percent": 0.5,
|
|
||||||
"type": "con",
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"border": "pixel",
|
|
||||||
"current_border_width": 2,
|
|
||||||
"floating": "auto_off",
|
|
||||||
"geometry": {
|
|
||||||
"height": 600,
|
|
||||||
"width": 800,
|
|
||||||
"x": 0,
|
|
||||||
"y": 0
|
|
||||||
},
|
|
||||||
"marks": [],
|
|
||||||
"name": "Alacritty",
|
|
||||||
"percent": 0.5,
|
|
||||||
"swallows": [
|
|
||||||
{
|
|
||||||
"class": "^Alacritty$",
|
|
||||||
"instance": "^Alacritty$",
|
|
||||||
"machine": "^ai$",
|
|
||||||
"title": "^aquamarine$"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "con"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"border": "pixel",
|
|
||||||
"current_border_width": 2,
|
|
||||||
"floating": "auto_off",
|
|
||||||
"geometry": {
|
|
||||||
"height": 600,
|
|
||||||
"width": 800,
|
|
||||||
"x": 0,
|
|
||||||
"y": 0
|
|
||||||
},
|
|
||||||
"marks": [],
|
|
||||||
"name": "Alacritty",
|
|
||||||
"percent": 0.5,
|
|
||||||
"swallows": [
|
|
||||||
{
|
|
||||||
"class": "^Alacritty$",
|
|
||||||
"instance": "^Alacritty$",
|
|
||||||
"machine": "^ai$",
|
|
||||||
"title": "^kana$"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"type": "con"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,600 @@
|
|||||||
|
;; ┌────────────────────────────────────────────────────┐
|
||||||
|
;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀▄░█▀█░█▀▄░█▀▀│
|
||||||
|
;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█▀▄░█▀█░█▀▄░▀▀█│
|
||||||
|
;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀░░▀░▀░▀░▀░▀▀▀│
|
||||||
|
;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░│
|
||||||
|
;; └────────────────────────────────────────────────────┘
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[bar]
|
||||||
|
fill = ⏽
|
||||||
|
empty = ⏽
|
||||||
|
indicator = ⏽
|
||||||
|
; Nerd font : , ⏽, 樂 籠 錄 , 雷 絛
|
||||||
|
|
||||||
|
[module/volume]
|
||||||
|
type = internal/alsa
|
||||||
|
|
||||||
|
; Soundcard to be used
|
||||||
|
; Usually in the format hw:# where # is the card number
|
||||||
|
; You can find the different card numbers in `/proc/asound/cards`
|
||||||
|
master-soundcard = default
|
||||||
|
speaker-soundcard = default
|
||||||
|
headphone-soundcard = default
|
||||||
|
|
||||||
|
; Name of the master, speaker and headphone mixers
|
||||||
|
; Use the following command to list available mixer controls:
|
||||||
|
; $ amixer scontrols | sed -nr "s/.*'([[:alnum:]]+)'.*/\1/p"
|
||||||
|
; If master, speaker or headphone-soundcard isn't the default,
|
||||||
|
; use `amixer -c # scontrols` instead where # is the number
|
||||||
|
; of the master, speaker or headphone soundcard respectively
|
||||||
|
;
|
||||||
|
; Default: Master
|
||||||
|
master-mixer = Master
|
||||||
|
|
||||||
|
; Optionally define speaker and headphone mixers
|
||||||
|
; Default: none
|
||||||
|
;;speaker-mixer = Speaker
|
||||||
|
; Default: none
|
||||||
|
;;headphone-mixer = Headphone
|
||||||
|
|
||||||
|
; NOTE: This is required if headphone_mixer is defined
|
||||||
|
; Use the following command to list available device controls
|
||||||
|
; $ amixer controls | sed -r "/CARD/\!d; s/.*=([0-9]+).*name='([^']+)'.*/printf '%3.0f: %s\n' '\1' '\2'/e" | sort
|
||||||
|
; You may also need to use `amixer -c # controls` as above for the mixer names
|
||||||
|
; Default: none
|
||||||
|
;;headphone-id = 9
|
||||||
|
|
||||||
|
; Use volume mapping (similar to amixer -M and alsamixer), where the increase in volume is linear to the ear
|
||||||
|
; Default: false
|
||||||
|
;;mapped = true
|
||||||
|
|
||||||
|
; Interval for volume increase/decrease (in percent points)
|
||||||
|
; Default: 5
|
||||||
|
interval = 5
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-volume> (default)
|
||||||
|
; <ramp-volume>
|
||||||
|
; <bar-volume>
|
||||||
|
format-volume = <bar-volume>
|
||||||
|
format-volume-prefix =
|
||||||
|
format-volume-prefix-padding = 1
|
||||||
|
format-volume-prefix-background = ${color.blue}
|
||||||
|
format-volume-prefix-foreground = ${color.foreground}
|
||||||
|
format-volume-background = ${color.background-alt}
|
||||||
|
format-volume-foreground = ${color.foreground}
|
||||||
|
format-volume-overline = ${color.background}
|
||||||
|
format-volume-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-muted> (default)
|
||||||
|
; <ramp-volume>
|
||||||
|
; <bar-volume>
|
||||||
|
format-muted = <label-muted>
|
||||||
|
format-muted-prefix =
|
||||||
|
format-muted-prefix-padding = 1
|
||||||
|
format-muted-prefix-background = ${color.red}
|
||||||
|
format-muted-overline = ${color.background}
|
||||||
|
format-muted-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default)
|
||||||
|
label-volume = %percentage%%
|
||||||
|
label-volume-background = ${color.background-alt}
|
||||||
|
label-volume-padding = 1
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default
|
||||||
|
label-muted = "Muted"
|
||||||
|
label-muted-foreground = ${color.foreground}
|
||||||
|
label-muted-background = ${color.background-alt}
|
||||||
|
label-muted-padding = 1
|
||||||
|
|
||||||
|
; Only applies if <ramp-volume> is used
|
||||||
|
ramp-volume-0 =
|
||||||
|
ramp-volume-1 =
|
||||||
|
ramp-volume-2 =
|
||||||
|
ramp-volume-background = ${color.blue}
|
||||||
|
ramp-volume-padding = 1
|
||||||
|
|
||||||
|
; Only applies if <bar-volume> is used
|
||||||
|
bar-volume-format = " %fill%%indicator%%empty% "
|
||||||
|
bar-volume-width = 10
|
||||||
|
bar-volume-gradient = false
|
||||||
|
|
||||||
|
bar-volume-indicator = ${bar.indicator}
|
||||||
|
bar-volume-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-volume-fill = ${bar.fill}
|
||||||
|
bar-volume-foreground-0 = ${color.foreground}
|
||||||
|
bar-volume-foreground-1 = ${color.foreground}
|
||||||
|
bar-volume-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-volume-empty = ${bar.empty}
|
||||||
|
bar-volume-empty-foreground = ${color.gray}
|
||||||
|
|
||||||
|
; If defined, it will replace <ramp-volume> when
|
||||||
|
; headphones are plugged in to `headphone_control_numid`
|
||||||
|
; If undefined, <ramp-volume> will be used for both
|
||||||
|
; Only applies if <ramp-volume> is used
|
||||||
|
ramp-headphones-0 =
|
||||||
|
ramp-headphones-background = ${color.blue}
|
||||||
|
ramp-headphones-padding = 1
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/brightness]
|
||||||
|
;type = internal/xbacklight
|
||||||
|
type = internal/backlight
|
||||||
|
|
||||||
|
; Use the following command to list available cards:
|
||||||
|
; $ ls -1 /sys/class/backlight/
|
||||||
|
;card = intel_backlight
|
||||||
|
card = amdgpu_bl0
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label> (default)
|
||||||
|
; <ramp>
|
||||||
|
; <bar>
|
||||||
|
format = <bar>
|
||||||
|
format-prefix =
|
||||||
|
format-prefix-padding = 1
|
||||||
|
format-prefix-background = ${color.lime}
|
||||||
|
format-prefix-foreground = ${color.foreground}
|
||||||
|
format-background = ${color.background-alt}
|
||||||
|
format-foreground = ${color.foreground}
|
||||||
|
format-overline = ${color.background}
|
||||||
|
format-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default)
|
||||||
|
label = %percentage%%
|
||||||
|
|
||||||
|
; Only applies if <ramp> is used
|
||||||
|
ramp-0 =
|
||||||
|
ramp-1 =
|
||||||
|
ramp-2 =
|
||||||
|
ramp-3 =
|
||||||
|
ramp-4 =
|
||||||
|
|
||||||
|
; Only applies if <bar> is used
|
||||||
|
bar-format = " %fill%%indicator%%empty% "
|
||||||
|
bar-width = 10
|
||||||
|
bar-gradient = false
|
||||||
|
|
||||||
|
bar-indicator = ${bar.indicator}
|
||||||
|
bar-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-fill = ${bar.fill}
|
||||||
|
bar-foreground-0 = ${color.foreground}
|
||||||
|
bar-foreground-1 = ${color.foreground}
|
||||||
|
bar-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-empty = ${bar.empty}
|
||||||
|
bar-empty-foreground = ${color.gray}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/battery_bar]
|
||||||
|
type = internal/battery
|
||||||
|
|
||||||
|
; This is useful in case the battery never reports 100% charge
|
||||||
|
full-at = 99
|
||||||
|
|
||||||
|
; Use the following command to list batteries and adapters:
|
||||||
|
; $ ls -1 /sys/class/power_supply/
|
||||||
|
battery = BAT1
|
||||||
|
adapter = ACAD
|
||||||
|
|
||||||
|
; If an inotify event haven't been reported in this many
|
||||||
|
; seconds, manually poll for new values.
|
||||||
|
;
|
||||||
|
; Needed as a fallback for systems that don't report events
|
||||||
|
; on sysfs/procfs.
|
||||||
|
;
|
||||||
|
; Disable polling by setting the interval to 0.
|
||||||
|
;
|
||||||
|
; Default: 5
|
||||||
|
poll-interval = 2
|
||||||
|
|
||||||
|
; see "man date" for details on how to format the time string
|
||||||
|
; NOTE: if you want to use syntax tags here you need to use %%{...}
|
||||||
|
; Default: %H:%M:%S
|
||||||
|
time-format = %H:%M
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-charging> (default)
|
||||||
|
; <bar-capacity>
|
||||||
|
; <ramp-capacity>
|
||||||
|
; <animation-charging>
|
||||||
|
format-charging = <bar-capacity>
|
||||||
|
format-charging-prefix = ""
|
||||||
|
format-charging-prefix-padding = 1
|
||||||
|
format-charging-prefix-background = ${color.green}
|
||||||
|
format-charging-prefix-foreground = ${color.foreground}
|
||||||
|
format-charging-background = ${color.background-alt}
|
||||||
|
format-charging-foreground = ${color.foreground}
|
||||||
|
format-charging-overline = ${color.background}
|
||||||
|
format-charging-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-discharging> (default)
|
||||||
|
; <bar-capacity>
|
||||||
|
; <ramp-capacity>
|
||||||
|
; <animation-discharging>
|
||||||
|
format-discharging = <bar-capacity>
|
||||||
|
format-discharging-prefix = ""
|
||||||
|
format-discharging-prefix-padding = 1
|
||||||
|
format-discharging-prefix-background = ${color.pink}
|
||||||
|
format-discharging-prefix-foreground = ${color.foreground}
|
||||||
|
format-discharging-background = ${color.background-alt}
|
||||||
|
format-discharging-foreground = ${color.foreground}
|
||||||
|
format-discharging-overline = ${color.background}
|
||||||
|
format-discharging-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-full> (default)
|
||||||
|
; <bar-capacity>
|
||||||
|
; <ramp-capacity>
|
||||||
|
format-full = <label-full>
|
||||||
|
format-full-prefix = ""
|
||||||
|
format-full-prefix-padding = 1
|
||||||
|
format-full-prefix-background = ${color.red}
|
||||||
|
format-full-prefix-foreground = ${color.foreground}
|
||||||
|
format-full-background = ${color.background-alt}
|
||||||
|
format-full-foreground = ${color.foreground}
|
||||||
|
format-full-overline = ${color.background}
|
||||||
|
format-full-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default)
|
||||||
|
; %time%
|
||||||
|
; %consumption% (shows current charge rate in watts)
|
||||||
|
|
||||||
|
label-charging = %percentage%%
|
||||||
|
label-charging-background = ${color.background-alt}
|
||||||
|
label-charging-padding = 1
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default)
|
||||||
|
; %time%
|
||||||
|
; %consumption% (shows current discharge rate in watts)
|
||||||
|
label-discharging = %percentage%%
|
||||||
|
label-discharging-background = ${color.background-alt}
|
||||||
|
label-discharging-padding = 1
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default)
|
||||||
|
label-full = Full
|
||||||
|
label-full-background = ${color.background-alt}
|
||||||
|
label-full-padding = 1
|
||||||
|
|
||||||
|
; Only applies if <bar-capacity> is used
|
||||||
|
bar-capacity-format = " %fill%%indicator%%empty% "
|
||||||
|
bar-capacity-width = 10
|
||||||
|
bar-capacity-gradient = false
|
||||||
|
|
||||||
|
bar-capacity-indicator = ${bar.indicator}
|
||||||
|
bar-capacity-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-capacity-fill = ${bar.fill}
|
||||||
|
bar-capacity-foreground-0 = ${color.foreground}
|
||||||
|
bar-capacity-foreground-1 = ${color.foreground}
|
||||||
|
bar-capacity-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-capacity-empty = ${bar.empty}
|
||||||
|
bar-capacity-empty-foreground = ${color.gray}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/cpu_bar]
|
||||||
|
type = internal/cpu
|
||||||
|
|
||||||
|
; Seconds to sleep between updates
|
||||||
|
; Default: 1
|
||||||
|
interval = 0.5
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label> (default)
|
||||||
|
; <bar-load>
|
||||||
|
; <ramp-load>
|
||||||
|
; <ramp-coreload>
|
||||||
|
;;format = <label> <ramp-coreload>
|
||||||
|
format = <bar-load><label>
|
||||||
|
format-prefix =
|
||||||
|
format-prefix-padding = 1
|
||||||
|
format-prefix-background = ${color.teal}
|
||||||
|
format-prefix-foreground = ${color.foreground}
|
||||||
|
format-background = ${color.background-alt}
|
||||||
|
format-foreground = ${color.foreground}
|
||||||
|
format-overline = ${color.background}
|
||||||
|
format-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default) - total cpu load averaged over all cores
|
||||||
|
; %percentage-sum% - Cumulative load on all cores
|
||||||
|
; %percentage-cores% - load percentage for each core
|
||||||
|
; %percentage-core[1-9]% - load percentage for specific core
|
||||||
|
label = "%percentage%% "
|
||||||
|
|
||||||
|
; Only applies if <bar-load> is used
|
||||||
|
bar-load-format = " %fill%%indicator%%empty% "
|
||||||
|
bar-load-width = 10
|
||||||
|
bar-load-gradient = false
|
||||||
|
|
||||||
|
bar-load-indicator = ${bar.indicator}
|
||||||
|
bar-load-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-load-fill = ${bar.fill}
|
||||||
|
bar-load-foreground-0 = ${color.foreground}
|
||||||
|
bar-load-foreground-1 = ${color.foreground}
|
||||||
|
bar-load-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-load-empty = ${bar.empty}
|
||||||
|
bar-load-empty-foreground = ${color.gray}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/filesystem_bar]
|
||||||
|
type = internal/fs
|
||||||
|
|
||||||
|
; Mountpoints to display
|
||||||
|
mount-0 = /
|
||||||
|
;;mount-1 = /home
|
||||||
|
;;mount-2 = /var
|
||||||
|
|
||||||
|
; Seconds to sleep between updates
|
||||||
|
; Default: 30
|
||||||
|
interval = 30
|
||||||
|
|
||||||
|
; Display fixed precision values
|
||||||
|
; Default: false
|
||||||
|
fixed-values = false
|
||||||
|
|
||||||
|
; Spacing between entries
|
||||||
|
; Default: 2
|
||||||
|
;;spacing = 4
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-mounted> (default)
|
||||||
|
; <bar-free>
|
||||||
|
; <bar-used>
|
||||||
|
; <ramp-capacity>
|
||||||
|
format-mounted = <bar-used><label-mounted>
|
||||||
|
format-mounted-prefix =
|
||||||
|
format-mounted-prefix-padding = 1
|
||||||
|
format-mounted-prefix-background = ${color.purple}
|
||||||
|
format-mounted-prefix-foreground = ${color.foreground}
|
||||||
|
format-mounted-background = ${color.background-alt}
|
||||||
|
format-mounted-foreground = ${color.foreground}
|
||||||
|
format-mounted-overline = ${color.background}
|
||||||
|
format-mounted-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-unmounted> (default)
|
||||||
|
format-unmounted = <label-unmounted>
|
||||||
|
format-unmounted-prefix =
|
||||||
|
format-unmounted-prefix-padding = 1
|
||||||
|
format-unmounted-prefix-background = ${color.red}
|
||||||
|
format-unmounted-prefix-foreground = ${color.foreground}
|
||||||
|
format-unmounted-background = ${color.background-alt}
|
||||||
|
format-unmounted-foreground = ${color.foreground}
|
||||||
|
format-unmounted-overline = ${color.background}
|
||||||
|
format-unmounted-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %mountpoint%
|
||||||
|
; %type%
|
||||||
|
; %fsname%
|
||||||
|
; %percentage_free%
|
||||||
|
; %percentage_used%
|
||||||
|
; %total%
|
||||||
|
; %free%
|
||||||
|
; %used%
|
||||||
|
; Default: %mountpoint% %percentage_free%%
|
||||||
|
label-mounted = "%used%/%total% "
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %mountpoint%
|
||||||
|
; Default: %mountpoint% is not mounted
|
||||||
|
label-unmounted = " %mountpoint%: not mounted "
|
||||||
|
|
||||||
|
; Only applies if <bar-used> is used
|
||||||
|
bar-used-format = " %fill%%indicator%%empty% "
|
||||||
|
bar-used-width = 10
|
||||||
|
bar-used-gradient = false
|
||||||
|
|
||||||
|
bar-used-indicator = ${bar.indicator}
|
||||||
|
bar-used-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-used-fill = ${bar.fill}
|
||||||
|
bar-used-foreground-0 = ${color.foreground}
|
||||||
|
bar-used-foreground-1 = ${color.foreground}
|
||||||
|
bar-used-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-used-empty = ${bar.empty}
|
||||||
|
bar-used-empty-foreground = ${color.gray}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/memory_bar]
|
||||||
|
type = internal/memory
|
||||||
|
|
||||||
|
; Seconds to sleep between updates
|
||||||
|
; Default: 1
|
||||||
|
interval = 2
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label> (default)
|
||||||
|
; <bar-used>
|
||||||
|
; <bar-free>
|
||||||
|
; <ramp-used>
|
||||||
|
; <ramp-free>
|
||||||
|
; <bar-swap-used>
|
||||||
|
; <bar-swap-free>
|
||||||
|
; <ramp-swap-used>
|
||||||
|
; <ramp-swap-free>
|
||||||
|
format = <bar-used><label>
|
||||||
|
format-prefix =
|
||||||
|
format-prefix-padding = 1
|
||||||
|
format-prefix-background = ${color.indigo}
|
||||||
|
format-prefix-foreground = ${color.foreground}
|
||||||
|
format-background = ${color.background-alt}
|
||||||
|
format-foreground = ${color.foreground}
|
||||||
|
format-overline = ${color.background}
|
||||||
|
format-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage_used% (default)
|
||||||
|
; %percentage_free%
|
||||||
|
; %gb_used%
|
||||||
|
; %gb_free%
|
||||||
|
; %gb_total%
|
||||||
|
; %mb_used%
|
||||||
|
; %mb_free%
|
||||||
|
; %mb_total%
|
||||||
|
; %percentage_swap_used%
|
||||||
|
; %percentage_swap_free%
|
||||||
|
; %mb_swap_total%
|
||||||
|
; %mb_swap_free%
|
||||||
|
; %mb_swap_used%
|
||||||
|
; %gb_swap_total%
|
||||||
|
; %gb_swap_free%
|
||||||
|
; %gb_swap_used%
|
||||||
|
|
||||||
|
label = "%mb_used% "
|
||||||
|
|
||||||
|
; Only applies if <bar-used> is used
|
||||||
|
bar-used-format = " %fill%%indicator%%empty% "
|
||||||
|
bar-used-width = 10
|
||||||
|
bar-used-gradient = false
|
||||||
|
|
||||||
|
bar-used-indicator = ${bar.indicator}
|
||||||
|
bar-used-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-used-fill = ${bar.fill}
|
||||||
|
bar-used-foreground-0 = ${color.foreground}
|
||||||
|
bar-used-foreground-1 = ${color.foreground}
|
||||||
|
bar-used-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-used-empty = ${bar.empty}
|
||||||
|
bar-used-empty-foreground = ${color.gray}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/mpd_bar]
|
||||||
|
type = internal/mpd
|
||||||
|
|
||||||
|
; Host where mpd is running (either ip or domain name)
|
||||||
|
; Can also be the full path to a unix socket where mpd is running.
|
||||||
|
;;host = 127.0.0.1
|
||||||
|
;;port = 6600
|
||||||
|
;;password = mysecretpassword
|
||||||
|
|
||||||
|
; Seconds to sleep between progressbar/song timer sync
|
||||||
|
; Default: 1
|
||||||
|
interval = 1
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-song> (default)
|
||||||
|
; <label-time>
|
||||||
|
; <bar-progress>
|
||||||
|
; <toggle> - gets replaced with <icon-(pause|play)>
|
||||||
|
; <toggle-stop> - gets replaced with <icon-(stop|play)>
|
||||||
|
; <icon-random>
|
||||||
|
; <icon-repeat>
|
||||||
|
; <icon-repeatone> (deprecated)
|
||||||
|
; <icon-single> - Toggle playing only a single song. Replaces <icon-repeatone>
|
||||||
|
; <icon-consume>
|
||||||
|
; <icon-prev>
|
||||||
|
; <icon-stop>
|
||||||
|
; <icon-play>
|
||||||
|
; <icon-pause>
|
||||||
|
; <icon-next>
|
||||||
|
; <icon-seekb>
|
||||||
|
; <icon-seekf>
|
||||||
|
format-online = <label-song><bar-progress><label-time>
|
||||||
|
format-online-prefix =
|
||||||
|
format-online-prefix-padding = 1
|
||||||
|
format-online-prefix-background = ${color.green}
|
||||||
|
format-online-prefix-foreground = ${color.foreground}
|
||||||
|
format-online-background = ${color.background-alt}
|
||||||
|
format-online-foreground = ${color.foreground}
|
||||||
|
format-online-overline = ${color.background}
|
||||||
|
format-online-underline = ${color.background}
|
||||||
|
|
||||||
|
;format-playing = ${self.format-online}
|
||||||
|
;format-paused = ${self.format-online}
|
||||||
|
;format-stopped = ${self.format-online}
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-offline>
|
||||||
|
format-offline = <label-offline>
|
||||||
|
format-offline-prefix =
|
||||||
|
format-offline-prefix-padding = 1
|
||||||
|
format-offline-prefix-background = ${color.red}
|
||||||
|
format-offline-prefix-foreground = ${color.foreground}
|
||||||
|
format-offline-background = ${color.background-alt}
|
||||||
|
format-offline-foreground = ${color.foreground}
|
||||||
|
format-offline-overline = ${color.background}
|
||||||
|
format-offline-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %artist%
|
||||||
|
; %album-artist%
|
||||||
|
; %album%
|
||||||
|
; %date%
|
||||||
|
; %title%
|
||||||
|
; Default: %artist% - %title%
|
||||||
|
label-song = " %artist% - %title%"
|
||||||
|
label-song-maxlen = 25
|
||||||
|
label-song-ellipsis = true
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %elapsed%
|
||||||
|
; %total%
|
||||||
|
; Default: %elapsed% / %total%
|
||||||
|
label-time = "%elapsed% / %total% "
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; None
|
||||||
|
label-offline = " Offline "
|
||||||
|
|
||||||
|
; Only applies if <icon-X> is used
|
||||||
|
icon-play =
|
||||||
|
icon-pause =
|
||||||
|
icon-stop =
|
||||||
|
icon-next =
|
||||||
|
icon-prev =
|
||||||
|
icon-seekf =
|
||||||
|
icon-seekb =
|
||||||
|
icon-random =
|
||||||
|
icon-repeat =
|
||||||
|
icon-repeatone =
|
||||||
|
icon-single =
|
||||||
|
icon-consume =
|
||||||
|
|
||||||
|
; Used to display the state of random/repeat/repeatone/single
|
||||||
|
; Only applies if <icon-[random|repeat|repeatone|single]> is used
|
||||||
|
toggle-on-foreground = ${color.primary}
|
||||||
|
toggle-off-foreground = ${color.secondary}
|
||||||
|
|
||||||
|
; Only applies if <bar-progress> is used
|
||||||
|
bar-progress-format = " %fill%%indicator%%empty% "
|
||||||
|
bar-progress-width = 10
|
||||||
|
bar-progress-gradient = false
|
||||||
|
|
||||||
|
bar-progress-indicator = ${bar.indicator}
|
||||||
|
bar-progress-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-progress-fill = ${bar.fill}
|
||||||
|
bar-progress-foreground-0 = ${color.foreground}
|
||||||
|
bar-progress-foreground-1 = ${color.foreground}
|
||||||
|
bar-progress-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-progress-empty = ${bar.empty}
|
||||||
|
bar-progress-empty-foreground = ${color.gray}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
;; ┌────────────────────────────────────────────────────────────┐
|
||||||
|
;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀▀░█▀█░█░░░█▀█░█▀▄░█▀▀│
|
||||||
|
;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░░░█░█░█░░░█░█░█▀▄░▀▀█│
|
||||||
|
;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀│
|
||||||
|
;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░│
|
||||||
|
;; └────────────────────────────────────────────────────────────┘
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[color]
|
||||||
|
|
||||||
|
;; Use pywal.sh in scripts directory to use colors from an image/wallpaper.
|
||||||
|
|
||||||
|
;; main colors
|
||||||
|
background = #2f343f
|
||||||
|
background-alt = #C4C7C5
|
||||||
|
foreground = #1C1E20
|
||||||
|
foreground-alt = #C4C7C5
|
||||||
|
primary = #B4BC67
|
||||||
|
|
||||||
|
white = #FFFFFF
|
||||||
|
black = #000000
|
||||||
|
red = #EC7875
|
||||||
|
pink = #EC6798
|
||||||
|
purple = #BE78D1
|
||||||
|
blue = #75A4CD
|
||||||
|
cyan = #00C7DF
|
||||||
|
teal = #00B19F
|
||||||
|
green = #61C766
|
||||||
|
lime = #B9C244
|
||||||
|
yellow = #EBD369
|
||||||
|
amber = #EDB83F
|
||||||
|
orange = #E57C46
|
||||||
|
brown = #AC8476
|
||||||
|
gray = #9E9E9E
|
||||||
|
indigo = #6C77BB
|
||||||
|
blue-gray = #6D8895
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
@@ -0,0 +1,293 @@
|
|||||||
|
;; ┌────────────────────────────────────────────────────────────┐
|
||||||
|
;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀▀░█▀█░█▀█░█▀▀░▀█▀░█▀▀│
|
||||||
|
;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░░░█░█░█░█░█▀▀░░█░░█░█│
|
||||||
|
;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀▀░▀▀▀░▀░▀░▀░░░▀▀▀░▀▀▀│
|
||||||
|
;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░│
|
||||||
|
;; └────────────────────────────────────────────────────────────┘
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Global WM Settings
|
||||||
|
|
||||||
|
[global/wm]
|
||||||
|
; Adjust the _NET_WM_STRUT_PARTIAL top value
|
||||||
|
; Used for top aligned bars
|
||||||
|
margin-bottom = 0
|
||||||
|
|
||||||
|
; Adjust the _NET_WM_STRUT_PARTIAL bottom value
|
||||||
|
; Used for bottom aligned bars
|
||||||
|
margin-top = 0
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; File Inclusion
|
||||||
|
; include an external file, like module file, etc.
|
||||||
|
|
||||||
|
include-file = ~/.config/polybar/blocks/bars.ini
|
||||||
|
include-file = ~/.config/polybar/blocks/colors.ini
|
||||||
|
include-file = ~/.config/polybar/blocks/modules.ini
|
||||||
|
include-file = ~/.config/polybar/blocks/user_modules.ini
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Bar Settings
|
||||||
|
|
||||||
|
[bar/main]
|
||||||
|
; Use either of the following command to list available outputs:
|
||||||
|
; If unspecified, the application will pick the first one it finds.
|
||||||
|
; $ polybar -m | cut -d ':' -f 1
|
||||||
|
; $ xrandr -q | grep " connected" | cut -d ' ' -f1
|
||||||
|
monitor =
|
||||||
|
|
||||||
|
; Use the specified monitor as a fallback if the main one is not found.
|
||||||
|
monitor-fallback =
|
||||||
|
|
||||||
|
; Require the monitor to be in connected state
|
||||||
|
; XRandR sometimes reports my monitor as being disconnected (when in use)
|
||||||
|
monitor-strict = false
|
||||||
|
|
||||||
|
; Tell the Window Manager not to configure the window.
|
||||||
|
; Use this to detach the bar if your WM is locking its size/position.
|
||||||
|
override-redirect = false
|
||||||
|
|
||||||
|
; Put the bar at the bottom of the screen
|
||||||
|
bottom = false
|
||||||
|
|
||||||
|
; Prefer fixed center position for the `modules-center` block
|
||||||
|
; When false, the center position will be based on the size of the other blocks.
|
||||||
|
fixed-center = true
|
||||||
|
|
||||||
|
; Dimension defined as pixel value (e.g. 35) or percentage (e.g. 50%),
|
||||||
|
; the percentage can optionally be extended with a pixel offset like so:
|
||||||
|
; 50%:-10, this will result in a width or height of 50% minus 10 pixels
|
||||||
|
width = 100%
|
||||||
|
height = 34
|
||||||
|
|
||||||
|
; Offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
|
||||||
|
; the percentage can optionally be extended with a pixel offset like so:
|
||||||
|
; 50%:-10, this will result in an offset in the x or y direction
|
||||||
|
; of 50% minus 10 pixels
|
||||||
|
offset-x = 0%
|
||||||
|
offset-y = 0%
|
||||||
|
|
||||||
|
; Background ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
background = ${color.background}
|
||||||
|
|
||||||
|
; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
foreground = ${color.foreground}
|
||||||
|
|
||||||
|
; Background gradient (vertical steps)
|
||||||
|
; background-[0-9]+ = #aarrggbb
|
||||||
|
;;background-0 =
|
||||||
|
|
||||||
|
; Value used for drawing rounded corners
|
||||||
|
; Note: This shouldn't be used together with border-size because the border
|
||||||
|
; doesn't get rounded
|
||||||
|
; Individual top/bottom values can be defined using:
|
||||||
|
; radius-{top,bottom}
|
||||||
|
radius-top = 0.0
|
||||||
|
radius-bottom = 0.0
|
||||||
|
|
||||||
|
; Under-/overline pixel size and argb color
|
||||||
|
; Individual values can be defined using:
|
||||||
|
; {overline,underline}-size
|
||||||
|
; {overline,underline}-color
|
||||||
|
line-size = 5
|
||||||
|
line-color = ${color.background}
|
||||||
|
|
||||||
|
; Values applied to all borders
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; border-{left,top,right,bottom}-size
|
||||||
|
; border-{left,top,right,bottom}-color
|
||||||
|
; The top and bottom borders are added to the bar height, so the effective
|
||||||
|
; window height is:
|
||||||
|
; height + border-top-size + border-bottom-size
|
||||||
|
; Meanwhile the effective window width is defined entirely by the width key and
|
||||||
|
; the border is placed withing this area. So you effectively only have the
|
||||||
|
; following horizontal space on the bar:
|
||||||
|
; width - border-right-size - border-left-size
|
||||||
|
border-bottom-size = 0
|
||||||
|
border-bottom-color = ${color.primary}
|
||||||
|
|
||||||
|
; Number of spaces to add at the beginning/end of the bar
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; padding-{left,right}
|
||||||
|
padding = 0
|
||||||
|
|
||||||
|
; Number of spaces to add before/after each module
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; module-margin-{left,right}
|
||||||
|
module-margin-left = 0
|
||||||
|
module-margin-right = 0
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
; Fonts are defined using <font-name>;<vertical-offset>
|
||||||
|
; Font names are specified using a fontconfig pattern.
|
||||||
|
; font-0 = NotoSans-Regular:size=8;2
|
||||||
|
; font-1 = MaterialIcons:size=10
|
||||||
|
; font-2 = Termsynu:size=8;-1
|
||||||
|
; font-3 = FontAwesome:size=10
|
||||||
|
; See the Fonts wiki page for more details
|
||||||
|
|
||||||
|
font-0 = "Iosevka Nerd Font:size=10;4"
|
||||||
|
font-1 = "feather:size=10;3"
|
||||||
|
|
||||||
|
; Modules are added to one of the available blocks
|
||||||
|
; modules-left = cpu ram
|
||||||
|
; modules-center = xwindow xbacklight
|
||||||
|
; modules-right = ipc clock
|
||||||
|
|
||||||
|
modules-left = sep launcher sep workspaces sep mpd
|
||||||
|
modules-center = title
|
||||||
|
modules-right = color-switch sep alsa sep battery sep network sep date sep sysmenu sep
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
; The separator will be inserted between the output of each module
|
||||||
|
separator =
|
||||||
|
|
||||||
|
; Opacity value between 0.0 and 1.0 used on fade in/out
|
||||||
|
dim-value = 1.0
|
||||||
|
|
||||||
|
; Value to be used to set the WM_NAME atom
|
||||||
|
; If the value is empty or undefined, the atom value
|
||||||
|
; will be created from the following template: polybar-[BAR]_[MONITOR]
|
||||||
|
; NOTE: The placeholders are not available for custom values
|
||||||
|
wm-name =
|
||||||
|
|
||||||
|
; Locale used to localize various module data (e.g. date)
|
||||||
|
; Expects a valid libc locale, for example: sv_SE.UTF-8
|
||||||
|
locale =
|
||||||
|
|
||||||
|
; Position of the system tray window
|
||||||
|
; If empty or undefined, tray support will be disabled
|
||||||
|
; NOTE: A center aligned tray will cover center aligned modules
|
||||||
|
;
|
||||||
|
; Available positions:
|
||||||
|
; left
|
||||||
|
; center
|
||||||
|
; right
|
||||||
|
; none
|
||||||
|
tray-position = none
|
||||||
|
|
||||||
|
; If true, the bar will not shift its
|
||||||
|
; contents when the tray changes
|
||||||
|
tray-detached = false
|
||||||
|
|
||||||
|
; Tray icon max size
|
||||||
|
tray-maxsize = 16
|
||||||
|
|
||||||
|
; Background color for the tray container
|
||||||
|
; ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
; By default the tray container will use the bar
|
||||||
|
; background color.
|
||||||
|
tray-background = ${color.background}
|
||||||
|
|
||||||
|
; Tray offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
|
||||||
|
tray-offset-x = 0
|
||||||
|
tray-offset-y = 0
|
||||||
|
|
||||||
|
; Pad the sides of each tray icon
|
||||||
|
tray-padding = 0
|
||||||
|
|
||||||
|
; Scale factor for tray clients
|
||||||
|
tray-scale = 1.0
|
||||||
|
|
||||||
|
; Restack the bar window and put it above the
|
||||||
|
; selected window manager's root
|
||||||
|
;
|
||||||
|
; Fixes the issue where the bar is being drawn
|
||||||
|
; on top of fullscreen window's
|
||||||
|
;
|
||||||
|
; Currently supported WM's:
|
||||||
|
; bspwm
|
||||||
|
; i3 (requires: `override-redirect = true`)
|
||||||
|
;;wm-restack =
|
||||||
|
|
||||||
|
; Set a DPI values used when rendering text
|
||||||
|
; This only affects scalable fonts
|
||||||
|
; dpi =
|
||||||
|
|
||||||
|
; Enable support for inter-process messaging
|
||||||
|
; See the Messaging wiki page for more details.
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
; Fallback click handlers that will be called if
|
||||||
|
; there's no matching module handler found.
|
||||||
|
click-left =
|
||||||
|
click-middle =
|
||||||
|
click-right =
|
||||||
|
scroll-up =
|
||||||
|
scroll-down =
|
||||||
|
double-click-left =
|
||||||
|
double-click-middle =
|
||||||
|
double-click-right =
|
||||||
|
|
||||||
|
; Requires polybar to be built with xcursor support (xcb-util-cursor)
|
||||||
|
; Possible values are:
|
||||||
|
; - default : The default pointer as before, can also be an empty string (default)
|
||||||
|
; - pointer : Typically in the form of a hand
|
||||||
|
; - ns-resize : Up and down arrows, can be used to indicate scrolling
|
||||||
|
cursor-click =
|
||||||
|
cursor-scroll =
|
||||||
|
|
||||||
|
;; WM Workspace Specific
|
||||||
|
|
||||||
|
; bspwm
|
||||||
|
;;scroll-up = bspwm-desknext
|
||||||
|
;;scroll-down = bspwm-deskprev
|
||||||
|
;;scroll-up = bspc desktop -f prev.local
|
||||||
|
;;scroll-down = bspc desktop -f next.local
|
||||||
|
|
||||||
|
;i3
|
||||||
|
;;scroll-up = i3wm-wsnext
|
||||||
|
;;scroll-down = i3wm-wsprev
|
||||||
|
;;scroll-up = i3-msg workspace next_on_output
|
||||||
|
;;scroll-down = i3-msg workspace prev_on_output
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Application Settings
|
||||||
|
|
||||||
|
[settings]
|
||||||
|
; The throttle settings lets the eventloop swallow up til X events
|
||||||
|
; if they happen within Y millisecond after first event was received.
|
||||||
|
; This is done to prevent flood of update event.
|
||||||
|
;
|
||||||
|
; For example if 5 modules emit an update event at the same time, we really
|
||||||
|
; just care about the last one. But if we wait too long for events to swallow
|
||||||
|
; the bar would appear sluggish so we continue if timeout
|
||||||
|
; expires or limit is reached.
|
||||||
|
throttle-output = 5
|
||||||
|
throttle-output-for = 10
|
||||||
|
|
||||||
|
; Time in milliseconds that the input handler will wait between processing events
|
||||||
|
;throttle-input-for = 30
|
||||||
|
|
||||||
|
; Reload upon receiving XCB_RANDR_SCREEN_CHANGE_NOTIFY events
|
||||||
|
screenchange-reload = false
|
||||||
|
|
||||||
|
; Compositing operators
|
||||||
|
; @see: https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t
|
||||||
|
compositing-background = source
|
||||||
|
compositing-foreground = over
|
||||||
|
compositing-overline = over
|
||||||
|
compositing-underline = over
|
||||||
|
compositing-border = over
|
||||||
|
|
||||||
|
; Define fallback values used by all module formats
|
||||||
|
;format-foreground =
|
||||||
|
;format-background =
|
||||||
|
;format-underline =
|
||||||
|
;format-overline =
|
||||||
|
;format-spacing =
|
||||||
|
;format-padding =
|
||||||
|
;format-margin =
|
||||||
|
;format-offset =
|
||||||
|
|
||||||
|
; Enables pseudo-transparency for the bar
|
||||||
|
; If set to true the bar can be transparent without a compositor.
|
||||||
|
pseudo-transparency = false
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Add this script to your wm startup file.
|
||||||
|
|
||||||
|
DIR="$HOME/.config/polybar/blocks"
|
||||||
|
|
||||||
|
# Terminate already running bar instances
|
||||||
|
killall -q polybar
|
||||||
|
|
||||||
|
# Wait until the processes have been shut down
|
||||||
|
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
|
# Launch the bar
|
||||||
|
polybar -q main -c "$DIR"/config.ini &
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,309 @@
|
|||||||
|
;; ┌────────────────────────────────────────────────────────────────────┐
|
||||||
|
;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀█░█▀▄░█▀▀░█░█░▀█▀░█▀▀░█░█░█▀▀│
|
||||||
|
;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█▀▀░█▀▄░█▀▀░▀▄▀░░█░░█▀▀░█▄█░▀▀█│
|
||||||
|
;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀░░░▀░▀░▀▀▀░░▀░░▀▀▀░▀▀▀░▀░▀░▀▀▀│
|
||||||
|
;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
|
||||||
|
;; └────────────────────────────────────────────────────────────────────┘
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Global WM Settings
|
||||||
|
|
||||||
|
[global/wm]
|
||||||
|
; Adjust the _NET_WM_STRUT_PARTIAL top value
|
||||||
|
; Used for top aligned bars
|
||||||
|
margin-bottom = 0
|
||||||
|
|
||||||
|
; Adjust the _NET_WM_STRUT_PARTIAL bottom value
|
||||||
|
; Used for bottom aligned bars
|
||||||
|
margin-top = 0
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; File Inclusion
|
||||||
|
; include an external file, like module file, etc.
|
||||||
|
|
||||||
|
include-file = ~/.config/polybar/blocks/bars.ini
|
||||||
|
include-file = ~/.config/polybar/blocks/colors.ini
|
||||||
|
include-file = ~/.config/polybar/blocks/modules.ini
|
||||||
|
include-file = ~/.config/polybar/blocks/user_modules.ini
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Bar Settings
|
||||||
|
|
||||||
|
[bar/main]
|
||||||
|
; Use either of the following command to list available outputs:
|
||||||
|
; If unspecified, the application will pick the first one it finds.
|
||||||
|
; $ polybar -m | cut -d ':' -f 1
|
||||||
|
; $ xrandr -q | grep " connected" | cut -d ' ' -f1
|
||||||
|
monitor =
|
||||||
|
|
||||||
|
; Use the specified monitor as a fallback if the main one is not found.
|
||||||
|
monitor-fallback =
|
||||||
|
|
||||||
|
; Require the monitor to be in connected state
|
||||||
|
; XRandR sometimes reports my monitor as being disconnected (when in use)
|
||||||
|
monitor-strict = false
|
||||||
|
|
||||||
|
; Tell the Window Manager not to configure the window.
|
||||||
|
; Use this to detach the bar if your WM is locking its size/position.
|
||||||
|
override-redirect = false
|
||||||
|
|
||||||
|
; Put the bar at the bottom of the screen
|
||||||
|
bottom = false
|
||||||
|
|
||||||
|
; Prefer fixed center position for the `modules-center` block
|
||||||
|
; When false, the center position will be based on the size of the other blocks.
|
||||||
|
fixed-center = true
|
||||||
|
|
||||||
|
; Dimension defined as pixel value (e.g. 35) or percentage (e.g. 50%),
|
||||||
|
; the percentage can optionally be extended with a pixel offset like so:
|
||||||
|
; 50%:-10, this will result in a width or height of 50% minus 10 pixels
|
||||||
|
width = 100%
|
||||||
|
height = 34
|
||||||
|
|
||||||
|
; Offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
|
||||||
|
; the percentage can optionally be extended with a pixel offset like so:
|
||||||
|
; 50%:-10, this will result in an offset in the x or y direction
|
||||||
|
; of 50% minus 10 pixels
|
||||||
|
offset-x = 0%
|
||||||
|
offset-y = 0%
|
||||||
|
|
||||||
|
; Background ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
background = ${color.background}
|
||||||
|
|
||||||
|
; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
foreground = ${color.foreground}
|
||||||
|
|
||||||
|
; Background gradient (vertical steps)
|
||||||
|
; background-[0-9]+ = #aarrggbb
|
||||||
|
;;background-0 =
|
||||||
|
|
||||||
|
; Value used for drawing rounded corners
|
||||||
|
; Note: This shouldn't be used together with border-size because the border
|
||||||
|
; doesn't get rounded
|
||||||
|
; Individual top/bottom values can be defined using:
|
||||||
|
; radius-{top,bottom}
|
||||||
|
radius-top = 0.0
|
||||||
|
radius-bottom = 0.0
|
||||||
|
|
||||||
|
; Under-/overline pixel size and argb color
|
||||||
|
; Individual values can be defined using:
|
||||||
|
; {overline,underline}-size
|
||||||
|
; {overline,underline}-color
|
||||||
|
line-size = 5
|
||||||
|
line-color = ${color.background}
|
||||||
|
|
||||||
|
; Values applied to all borders
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; border-{left,top,right,bottom}-size
|
||||||
|
; border-{left,top,right,bottom}-color
|
||||||
|
; The top and bottom borders are added to the bar height, so the effective
|
||||||
|
; window height is:
|
||||||
|
; height + border-top-size + border-bottom-size
|
||||||
|
; Meanwhile the effective window width is defined entirely by the width key and
|
||||||
|
; the border is placed withing this area. So you effectively only have the
|
||||||
|
; following horizontal space on the bar:
|
||||||
|
; width - border-right-size - border-left-size
|
||||||
|
border-bottom-size = 0
|
||||||
|
border-bottom-color = ${color.primary}
|
||||||
|
|
||||||
|
; Number of spaces to add at the beginning/end of the bar
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; padding-{left,right}
|
||||||
|
padding = 0
|
||||||
|
|
||||||
|
; Number of spaces to add before/after each module
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; module-margin-{left,right}
|
||||||
|
module-margin-left = 0
|
||||||
|
module-margin-right = 0
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
; Fonts are defined using <font-name>;<vertical-offset>
|
||||||
|
; Font names are specified using a fontconfig pattern.
|
||||||
|
; font-0 = NotoSans-Regular:size=8;2
|
||||||
|
; font-1 = MaterialIcons:size=10
|
||||||
|
; font-2 = Termsynu:size=8;-1
|
||||||
|
; font-3 = FontAwesome:size=10
|
||||||
|
; See the Fonts wiki page for more details
|
||||||
|
|
||||||
|
font-0 = "Iosevka Nerd Font:size=10;4"
|
||||||
|
font-1 = "feather:size=10;3"
|
||||||
|
|
||||||
|
; Modules are added to one of the available blocks
|
||||||
|
; modules-left = cpu ram
|
||||||
|
; modules-center = xwindow xbacklight
|
||||||
|
; modules-right = ipc clock
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[bar/top]
|
||||||
|
inherit = bar/main
|
||||||
|
offset-y = 10
|
||||||
|
modules-center = sep launcher sep workspaces sep cpu sep memory sep mpd sep alsa sep battery sep network sep date sep sysmenu sep
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
[bar/mid]
|
||||||
|
inherit = bar/main
|
||||||
|
offset-y = 54
|
||||||
|
modules-center = volume sep brightness sep battery_bar sep cpu_bar sep filesystem_bar sep memory_bar sep mpd_bar
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
[bar/bottom]
|
||||||
|
inherit = bar/main
|
||||||
|
offset-y = 98
|
||||||
|
modules-center = title sep menu sep term files browser settings sep filesystem sep temperature sep color-switch sep keyboard sep pulseaudio sep backlight sep updates sep powermenu sep
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
; The separator will be inserted between the output of each module
|
||||||
|
separator =
|
||||||
|
|
||||||
|
; Opacity value between 0.0 and 1.0 used on fade in/out
|
||||||
|
dim-value = 1.0
|
||||||
|
|
||||||
|
; Value to be used to set the WM_NAME atom
|
||||||
|
; If the value is empty or undefined, the atom value
|
||||||
|
; will be created from the following template: polybar-[BAR]_[MONITOR]
|
||||||
|
; NOTE: The placeholders are not available for custom values
|
||||||
|
wm-name =
|
||||||
|
|
||||||
|
; Locale used to localize various module data (e.g. date)
|
||||||
|
; Expects a valid libc locale, for example: sv_SE.UTF-8
|
||||||
|
locale =
|
||||||
|
|
||||||
|
; Position of the system tray window
|
||||||
|
; If empty or undefined, tray support will be disabled
|
||||||
|
; NOTE: A center aligned tray will cover center aligned modules
|
||||||
|
;
|
||||||
|
; Available positions:
|
||||||
|
; left
|
||||||
|
; center
|
||||||
|
; right
|
||||||
|
; none
|
||||||
|
tray-position = none
|
||||||
|
|
||||||
|
; If true, the bar will not shift its
|
||||||
|
; contents when the tray changes
|
||||||
|
tray-detached = false
|
||||||
|
|
||||||
|
; Tray icon max size
|
||||||
|
tray-maxsize = 16
|
||||||
|
|
||||||
|
; Background color for the tray container
|
||||||
|
; ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
; By default the tray container will use the bar
|
||||||
|
; background color.
|
||||||
|
tray-background = ${color.background}
|
||||||
|
|
||||||
|
; Tray offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
|
||||||
|
tray-offset-x = 0
|
||||||
|
tray-offset-y = 0
|
||||||
|
|
||||||
|
; Pad the sides of each tray icon
|
||||||
|
tray-padding = 0
|
||||||
|
|
||||||
|
; Scale factor for tray clients
|
||||||
|
tray-scale = 1.0
|
||||||
|
|
||||||
|
; Restack the bar window and put it above the
|
||||||
|
; selected window manager's root
|
||||||
|
;
|
||||||
|
; Fixes the issue where the bar is being drawn
|
||||||
|
; on top of fullscreen window's
|
||||||
|
;
|
||||||
|
; Currently supported WM's:
|
||||||
|
; bspwm
|
||||||
|
; i3 (requires: `override-redirect = true`)
|
||||||
|
;;wm-restack =
|
||||||
|
|
||||||
|
; Set a DPI values used when rendering text
|
||||||
|
; This only affects scalable fonts
|
||||||
|
; dpi =
|
||||||
|
|
||||||
|
; Enable support for inter-process messaging
|
||||||
|
; See the Messaging wiki page for more details.
|
||||||
|
;enable-ipc = true
|
||||||
|
|
||||||
|
; Fallback click handlers that will be called if
|
||||||
|
; there's no matching module handler found.
|
||||||
|
click-left =
|
||||||
|
click-middle =
|
||||||
|
click-right =
|
||||||
|
scroll-up =
|
||||||
|
scroll-down =
|
||||||
|
double-click-left =
|
||||||
|
double-click-middle =
|
||||||
|
double-click-right =
|
||||||
|
|
||||||
|
; Requires polybar to be built with xcursor support (xcb-util-cursor)
|
||||||
|
; Possible values are:
|
||||||
|
; - default : The default pointer as before, can also be an empty string (default)
|
||||||
|
; - pointer : Typically in the form of a hand
|
||||||
|
; - ns-resize : Up and down arrows, can be used to indicate scrolling
|
||||||
|
cursor-click =
|
||||||
|
cursor-scroll =
|
||||||
|
|
||||||
|
;; WM Workspace Specific
|
||||||
|
|
||||||
|
; bspwm
|
||||||
|
;;scroll-up = bspwm-desknext
|
||||||
|
;;scroll-down = bspwm-deskprev
|
||||||
|
;;scroll-up = bspc desktop -f prev.local
|
||||||
|
;;scroll-down = bspc desktop -f next.local
|
||||||
|
|
||||||
|
;i3
|
||||||
|
;;scroll-up = i3wm-wsnext
|
||||||
|
;;scroll-down = i3wm-wsprev
|
||||||
|
;;scroll-up = i3-msg workspace next_on_output
|
||||||
|
;;scroll-down = i3-msg workspace prev_on_output
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Application Settings
|
||||||
|
|
||||||
|
[settings]
|
||||||
|
; The throttle settings lets the eventloop swallow up til X events
|
||||||
|
; if they happen within Y millisecond after first event was received.
|
||||||
|
; This is done to prevent flood of update event.
|
||||||
|
;
|
||||||
|
; For example if 5 modules emit an update event at the same time, we really
|
||||||
|
; just care about the last one. But if we wait too long for events to swallow
|
||||||
|
; the bar would appear sluggish so we continue if timeout
|
||||||
|
; expires or limit is reached.
|
||||||
|
throttle-output = 5
|
||||||
|
throttle-output-for = 10
|
||||||
|
|
||||||
|
; Time in milliseconds that the input handler will wait between processing events
|
||||||
|
;throttle-input-for = 30
|
||||||
|
|
||||||
|
; Reload upon receiving XCB_RANDR_SCREEN_CHANGE_NOTIFY events
|
||||||
|
screenchange-reload = false
|
||||||
|
|
||||||
|
; Compositing operators
|
||||||
|
; @see: https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t
|
||||||
|
compositing-background = source
|
||||||
|
compositing-foreground = over
|
||||||
|
compositing-overline = over
|
||||||
|
compositing-underline = over
|
||||||
|
compositing-border = over
|
||||||
|
|
||||||
|
; Define fallback values used by all module formats
|
||||||
|
;format-foreground =
|
||||||
|
;format-background =
|
||||||
|
;format-underline =
|
||||||
|
;format-overline =
|
||||||
|
;format-spacing =
|
||||||
|
;format-padding =
|
||||||
|
;format-margin =
|
||||||
|
;format-offset =
|
||||||
|
|
||||||
|
; Enables pseudo-transparency for the bar
|
||||||
|
; If set to true the bar can be transparent without a compositor.
|
||||||
|
pseudo-transparency = false
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
DIR="$HOME/.config/polybar/blocks"
|
||||||
|
|
||||||
|
# Terminate already running bar instances
|
||||||
|
killall -q polybar
|
||||||
|
|
||||||
|
# Wait until the processes have been shut down
|
||||||
|
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
|
# Launch the preview bar
|
||||||
|
polybar -q top -c "$DIR"/preview.ini &
|
||||||
|
polybar -q mid -c "$DIR"/preview.ini &
|
||||||
|
polybar -q bottom -c "$DIR"/preview.ini &
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
#
|
||||||
|
# checkupdates: Safely print a list of pending updates.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2013 Kyle Keen <keenerd@gmail.com>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
declare -r myname='checkupdates'
|
||||||
|
declare -r myver='1.0.0'
|
||||||
|
|
||||||
|
plain() {
|
||||||
|
(( QUIET )) && return
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
|
||||||
|
}
|
||||||
|
|
||||||
|
msg() {
|
||||||
|
(( QUIET )) && return
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
|
||||||
|
}
|
||||||
|
|
||||||
|
msg2() {
|
||||||
|
(( QUIET )) && return
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
|
||||||
|
}
|
||||||
|
|
||||||
|
ask() {
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${BLUE}::${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}" "$@" >&1
|
||||||
|
}
|
||||||
|
|
||||||
|
warning() {
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
error() {
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if messages are to be printed using color
|
||||||
|
unset ALL_OFF BOLD BLUE GREEN RED YELLOW
|
||||||
|
if [[ -t 2 && ! $USE_COLOR = "n" ]]; then
|
||||||
|
# prefer terminal safe colored and bold text when tput is supported
|
||||||
|
if tput setaf 0 &>/dev/null; then
|
||||||
|
ALL_OFF="$(tput sgr0)"
|
||||||
|
BOLD="$(tput bold)"
|
||||||
|
BLUE="${BOLD}$(tput setaf 4)"
|
||||||
|
GREEN="${BOLD}$(tput setaf 2)"
|
||||||
|
RED="${BOLD}$(tput setaf 1)"
|
||||||
|
YELLOW="${BOLD}$(tput setaf 3)"
|
||||||
|
else
|
||||||
|
ALL_OFF="\e[1;0m"
|
||||||
|
BOLD="\e[1;1m"
|
||||||
|
BLUE="${BOLD}\e[1;34m"
|
||||||
|
GREEN="${BOLD}\e[1;32m"
|
||||||
|
RED="${BOLD}\e[1;31m"
|
||||||
|
YELLOW="${BOLD}\e[1;33m"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
|
||||||
|
|
||||||
|
|
||||||
|
if (( $# > 0 )); then
|
||||||
|
echo "${myname} v${myver}"
|
||||||
|
echo
|
||||||
|
echo "Safely print a list of pending updates"
|
||||||
|
echo
|
||||||
|
echo "Usage: ${myname}"
|
||||||
|
echo
|
||||||
|
echo 'Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary database.'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! type -P fakeroot >/dev/null; then
|
||||||
|
error 'Cannot find the fakeroot binary.'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z $CHECKUPDATES_DB ]]; then
|
||||||
|
CHECKUPDATES_DB="${TMPDIR:-/tmp}/checkup-db-${USER}/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
trap 'rm -f $CHECKUPDATES_DB/db.lck' INT TERM EXIT
|
||||||
|
|
||||||
|
DBPath="$(pacman-conf DBPath)"
|
||||||
|
if [[ -z "$DBPath" ]] || [[ ! -d "$DBPath" ]]; then
|
||||||
|
DBPath="/var/lib/pacman/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$CHECKUPDATES_DB"
|
||||||
|
ln -s "${DBPath}/local" "$CHECKUPDATES_DB" &> /dev/null
|
||||||
|
if ! fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null; then
|
||||||
|
error 'Cannot fetch updates'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]'
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# vim: set noet:
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
FILE="$HOME/.config/polybar/blocks/scripts/rofi/colors.rasi"
|
||||||
|
|
||||||
|
# random accent color
|
||||||
|
COLORS=('#EC7875' '#EC6798' '#BE78D1' '#75A4CD' '#00C7DF' '#00B19F' '#61C766' \
|
||||||
|
'#B9C244' '#EBD369' '#EDB83F' '#E57C46' '#AC8476' '#6C77BB' '#6D8895')
|
||||||
|
AC="${COLORS[$(( $RANDOM % 14 ))]}"
|
||||||
|
sed -i -e "s/ac: .*/ac: ${AC}FF;/g" $FILE
|
||||||
|
sed -i -e "s/se: .*/se: ${AC}40;/g" $FILE
|
||||||
|
|
||||||
|
rofi -no-config -no-lazy-grab -show drun -modi drun -theme ~/.config/polybar/blocks/scripts/rofi/launcher.rasi
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## Author : Aditya Shakya
|
||||||
|
## Mail : adi1090x@gmail.com
|
||||||
|
## Github : @adi1090x
|
||||||
|
## Twitter : @adi1090x
|
||||||
|
|
||||||
|
dir="~/.config/polybar/blocks/scripts/rofi"
|
||||||
|
uptime=$(uptime -p | sed -e 's/up //g')
|
||||||
|
|
||||||
|
rofi_command="rofi -no-config -theme $dir/powermenu.rasi"
|
||||||
|
|
||||||
|
# Options
|
||||||
|
shutdown=" Shutdown"
|
||||||
|
reboot=" Restart"
|
||||||
|
lock=" Lock"
|
||||||
|
suspend=" Sleep"
|
||||||
|
logout=" Logout"
|
||||||
|
|
||||||
|
# Confirmation
|
||||||
|
confirm_exit() {
|
||||||
|
rofi -dmenu\
|
||||||
|
-no-config\
|
||||||
|
-i\
|
||||||
|
-no-fixed-num-lines\
|
||||||
|
-p "Are You Sure? : "\
|
||||||
|
-theme $dir/confirm.rasi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Message
|
||||||
|
msg() {
|
||||||
|
rofi -no-config -theme "$dir/message.rasi" -e "Available Options - yes / y / no / n"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Variable passed to rofi
|
||||||
|
options="$lock\n$suspend\n$logout\n$reboot\n$shutdown"
|
||||||
|
|
||||||
|
chosen="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 0)"
|
||||||
|
case $chosen in
|
||||||
|
$shutdown)
|
||||||
|
ans=$(confirm_exit &)
|
||||||
|
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||||
|
systemctl poweroff
|
||||||
|
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
msg
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
$reboot)
|
||||||
|
ans=$(confirm_exit &)
|
||||||
|
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||||
|
systemctl reboot
|
||||||
|
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
msg
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
$lock)
|
||||||
|
if [[ -f /usr/bin/i3lock ]]; then
|
||||||
|
i3lock
|
||||||
|
elif [[ -f /usr/bin/betterlockscreen ]]; then
|
||||||
|
betterlockscreen -l
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
$suspend)
|
||||||
|
ans=$(confirm_exit &)
|
||||||
|
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||||
|
mpc -q pause
|
||||||
|
amixer set Master mute
|
||||||
|
systemctl suspend
|
||||||
|
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
msg
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
$logout)
|
||||||
|
ans=$(confirm_exit &)
|
||||||
|
if [[ $ans == "yes" || $ans == "YES" || $ans == "y" || $ans == "Y" ]]; then
|
||||||
|
if [[ "$DESKTOP_SESSION" == "Openbox" ]]; then
|
||||||
|
openbox --exit
|
||||||
|
elif [[ "$DESKTOP_SESSION" == "bspwm" ]]; then
|
||||||
|
bspc quit
|
||||||
|
elif [[ "$DESKTOP_SESSION" == "i3" ]]; then
|
||||||
|
i3-msg exit
|
||||||
|
fi
|
||||||
|
elif [[ $ans == "no" || $ans == "NO" || $ans == "n" || $ans == "N" ]]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
msg
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/* colors */
|
||||||
|
|
||||||
|
* {
|
||||||
|
al: #00000000;
|
||||||
|
bg: #2f343fFF;
|
||||||
|
bga: #C4C7C5FF;
|
||||||
|
fga: #C4C7C5FF;
|
||||||
|
fg: #1C1E20FF;
|
||||||
|
ac: #00C7DFFF;
|
||||||
|
se: #00C7DF40;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/* Confirm Dialog */
|
||||||
|
|
||||||
|
@import "colors.rasi"
|
||||||
|
|
||||||
|
* {
|
||||||
|
background-color: @bg;
|
||||||
|
text-color: @fga;
|
||||||
|
font: "Iosevka Nerd Font 10";
|
||||||
|
}
|
||||||
|
|
||||||
|
window {
|
||||||
|
width: 210px;
|
||||||
|
padding: 25px;
|
||||||
|
border: 0px 0px 4px 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
location: center;
|
||||||
|
y-offset: -2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
entry {
|
||||||
|
expand: true;
|
||||||
|
text-color: @ac;
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Author : Aditya Shakya
|
||||||
|
* Mail : adi1090x@gmail.com
|
||||||
|
* Github : @adi1090x
|
||||||
|
* Twitter : @adi1090x
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
configuration {
|
||||||
|
font: "Iosevka Nerd Font 10";
|
||||||
|
show-icons: true;
|
||||||
|
icon-theme: "Papirus";
|
||||||
|
display-drun: "";
|
||||||
|
drun-display-format: "{name}";
|
||||||
|
disable-history: false;
|
||||||
|
fullscreen: false;
|
||||||
|
hide-scrollbar: true;
|
||||||
|
sidebar-mode: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@import "colors.rasi"
|
||||||
|
|
||||||
|
window {
|
||||||
|
transparency: "real";
|
||||||
|
background-color: @bg;
|
||||||
|
text-color: @fg;
|
||||||
|
border: 0px 0px 0px 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
border-radius: 0px;
|
||||||
|
width: 550px;
|
||||||
|
location: center;
|
||||||
|
x-offset: 0;
|
||||||
|
y-offset: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
prompt {
|
||||||
|
enabled: true;
|
||||||
|
padding: 6px 7px 4px 7px;
|
||||||
|
background-color: @ac;
|
||||||
|
text-color: @fg;
|
||||||
|
font: "feather 12";
|
||||||
|
}
|
||||||
|
|
||||||
|
entry {
|
||||||
|
background-color: @al;
|
||||||
|
text-color: @fg;
|
||||||
|
placeholder-color: @fg;
|
||||||
|
expand: true;
|
||||||
|
horizontal-align: 0;
|
||||||
|
placeholder: "Search...";
|
||||||
|
padding: 6px;
|
||||||
|
blink: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inputbar {
|
||||||
|
children: [ prompt, entry ];
|
||||||
|
background-color: @bga;
|
||||||
|
text-color: @fg;
|
||||||
|
expand: false;
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
listview {
|
||||||
|
background-color: @al;
|
||||||
|
padding: 0px;
|
||||||
|
columns: 2;
|
||||||
|
lines: 8;
|
||||||
|
spacing: 6px;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
layout: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
mainbox {
|
||||||
|
background-color: @al;
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
children: [ inputbar, listview ];
|
||||||
|
spacing: 6px;
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element {
|
||||||
|
background-color: @al;
|
||||||
|
text-color: @fga;
|
||||||
|
orientation: horizontal;
|
||||||
|
border-radius: 0px;
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-icon {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
size: 24px;
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
expand: true;
|
||||||
|
horizontal-align: 0;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
margin: 0px 2.5px 0px 2.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element selected {
|
||||||
|
background-color: @se;
|
||||||
|
text-color: @fga;
|
||||||
|
border: 0px 0px 0px 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/* Confirm Dialog */
|
||||||
|
|
||||||
|
@import "colors.rasi"
|
||||||
|
|
||||||
|
* {
|
||||||
|
background-color: @bg;
|
||||||
|
text-color: @fga;
|
||||||
|
font: "Iosevka Nerd Font 10";
|
||||||
|
}
|
||||||
|
|
||||||
|
window {
|
||||||
|
width: 320px;
|
||||||
|
padding: 25px;
|
||||||
|
border: 0px 0px 4px 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
location: center;
|
||||||
|
y-offset: -2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
entry {
|
||||||
|
expand: true;
|
||||||
|
text-color: @ac;
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Author : Aditya Shakya
|
||||||
|
* Mail : adi1090x@gmail.com
|
||||||
|
* Github : @adi1090x
|
||||||
|
* Twitter : @adi1090x
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
configuration {
|
||||||
|
font: "Iosevka Nerd Font 10";
|
||||||
|
show-icons: true;
|
||||||
|
icon-theme: "Papirus";
|
||||||
|
display-drun: "";
|
||||||
|
drun-display-format: "{name}";
|
||||||
|
disable-history: false;
|
||||||
|
fullscreen: false;
|
||||||
|
hide-scrollbar: true;
|
||||||
|
sidebar-mode: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@import "colors.rasi"
|
||||||
|
|
||||||
|
window {
|
||||||
|
transparency: "real";
|
||||||
|
background-color: @bg;
|
||||||
|
text-color: @fg;
|
||||||
|
border: 0px 0px 0px 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
border-radius: 0px;
|
||||||
|
width: 400px;
|
||||||
|
location: center;
|
||||||
|
x-offset: 0;
|
||||||
|
y-offset: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
prompt {
|
||||||
|
enabled: true;
|
||||||
|
padding: 6px 7px 4px 7px;
|
||||||
|
background-color: @bga;
|
||||||
|
text-color: @fg;
|
||||||
|
}
|
||||||
|
|
||||||
|
textbox-prompt-colon {
|
||||||
|
padding: 6px 7px 4px 7px;
|
||||||
|
background-color: @ac;
|
||||||
|
text-color: @fg;
|
||||||
|
expand: false;
|
||||||
|
str: "";
|
||||||
|
font: "feather 12";
|
||||||
|
}
|
||||||
|
|
||||||
|
entry {
|
||||||
|
background-color: @al;
|
||||||
|
text-color: @fg;
|
||||||
|
placeholder-color: @fg;
|
||||||
|
expand: true;
|
||||||
|
horizontal-align: 0;
|
||||||
|
placeholder: "Search...";
|
||||||
|
padding: 6px;
|
||||||
|
blink: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inputbar {
|
||||||
|
children: [ textbox-prompt-colon, prompt ];
|
||||||
|
background-color: @bga;
|
||||||
|
text-color: @fg;
|
||||||
|
expand: false;
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
listview {
|
||||||
|
background-color: @al;
|
||||||
|
padding: 0px;
|
||||||
|
columns: 1;
|
||||||
|
lines: 8;
|
||||||
|
spacing: 6px;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
layout: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
mainbox {
|
||||||
|
background-color: @al;
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
children: [ inputbar, listview ];
|
||||||
|
spacing: 6px;
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element {
|
||||||
|
background-color: @al;
|
||||||
|
text-color: @fga;
|
||||||
|
orientation: horizontal;
|
||||||
|
border-radius: 0px;
|
||||||
|
padding: 3px 3px 3px -12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-icon {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
size: 24px;
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
expand: true;
|
||||||
|
horizontal-align: 0;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
margin: 0px 2.5px 0px 2.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element selected {
|
||||||
|
background-color: @se;
|
||||||
|
text-color: @fga;
|
||||||
|
border: 0px 0px 0px 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Author : Aditya Shakya
|
||||||
|
* Mail : adi1090x@gmail.com
|
||||||
|
* Github : @adi1090x
|
||||||
|
* Twitter : @adi1090x
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
configuration {
|
||||||
|
font: "Iosevka Nerd Font 10";
|
||||||
|
show-icons: true;
|
||||||
|
icon-theme: "Papirus";
|
||||||
|
display-drun: "";
|
||||||
|
drun-display-format: "{name}";
|
||||||
|
disable-history: false;
|
||||||
|
fullscreen: false;
|
||||||
|
hide-scrollbar: true;
|
||||||
|
sidebar-mode: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@import "colors.rasi"
|
||||||
|
|
||||||
|
window {
|
||||||
|
transparency: "real";
|
||||||
|
background-color: @bg;
|
||||||
|
text-color: @fg;
|
||||||
|
border: 0px 0px 0px 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
border-radius: 0px;
|
||||||
|
width: 300px;
|
||||||
|
location: center;
|
||||||
|
x-offset: 0;
|
||||||
|
y-offset: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
prompt {
|
||||||
|
enabled: true;
|
||||||
|
padding: 6px 7px 4px 7px;
|
||||||
|
background-color: @bga;
|
||||||
|
text-color: @fg;
|
||||||
|
}
|
||||||
|
|
||||||
|
textbox-prompt-colon {
|
||||||
|
padding: 6px 7px 4px 7px;
|
||||||
|
background-color: @ac;
|
||||||
|
text-color: @fg;
|
||||||
|
expand: false;
|
||||||
|
str: "";
|
||||||
|
font: "feather 12";
|
||||||
|
}
|
||||||
|
|
||||||
|
entry {
|
||||||
|
background-color: @al;
|
||||||
|
text-color: @fg;
|
||||||
|
placeholder-color: @fg;
|
||||||
|
expand: true;
|
||||||
|
horizontal-align: 0;
|
||||||
|
placeholder: "Search...";
|
||||||
|
padding: 6px;
|
||||||
|
blink: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inputbar {
|
||||||
|
children: [ textbox-prompt-colon, prompt ];
|
||||||
|
background-color: @bga;
|
||||||
|
text-color: @fg;
|
||||||
|
expand: false;
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
listview {
|
||||||
|
background-color: @al;
|
||||||
|
padding: 0px;
|
||||||
|
columns: 1;
|
||||||
|
lines: 5;
|
||||||
|
spacing: 6px;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
layout: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
mainbox {
|
||||||
|
background-color: @al;
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
children: [ inputbar, listview ];
|
||||||
|
spacing: 6px;
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element {
|
||||||
|
background-color: @al;
|
||||||
|
text-color: @fga;
|
||||||
|
orientation: horizontal;
|
||||||
|
border-radius: 0px;
|
||||||
|
padding: 3px 3px 3px -23px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-icon {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
size: 24px;
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
expand: true;
|
||||||
|
horizontal-align: 0;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
margin: 0px 2.5px 0px 2.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element selected {
|
||||||
|
background-color: @se;
|
||||||
|
text-color: @fga;
|
||||||
|
border: 0px 0px 0px 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* Author : Aditya Shakya
|
||||||
|
* Mail : adi1090x@gmail.com
|
||||||
|
* Github : @adi1090x
|
||||||
|
* Twitter : @adi1090x
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
configuration {
|
||||||
|
font: "Iosevka Nerd Font 10";
|
||||||
|
show-icons: true;
|
||||||
|
icon-theme: "Papirus";
|
||||||
|
display-drun: "";
|
||||||
|
drun-display-format: "{name}";
|
||||||
|
disable-history: false;
|
||||||
|
fullscreen: false;
|
||||||
|
hide-scrollbar: true;
|
||||||
|
sidebar-mode: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@import "colors.rasi"
|
||||||
|
|
||||||
|
window {
|
||||||
|
transparency: "real";
|
||||||
|
background-color: @bg;
|
||||||
|
text-color: @fg;
|
||||||
|
border: 0px 0px 0px 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
border-radius: 0px;
|
||||||
|
width: 300px;
|
||||||
|
location: center;
|
||||||
|
x-offset: 0;
|
||||||
|
y-offset: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
prompt {
|
||||||
|
enabled: true;
|
||||||
|
padding: 6px 7px 4px 7px;
|
||||||
|
background-color: @bga;
|
||||||
|
text-color: @fg;
|
||||||
|
}
|
||||||
|
|
||||||
|
textbox-prompt-colon {
|
||||||
|
padding: 6px 7px 4px 7px;
|
||||||
|
background-color: @ac;
|
||||||
|
text-color: @fg;
|
||||||
|
expand: false;
|
||||||
|
str: "";
|
||||||
|
font: "feather 12";
|
||||||
|
}
|
||||||
|
|
||||||
|
entry {
|
||||||
|
background-color: @al;
|
||||||
|
text-color: @fg;
|
||||||
|
placeholder-color: @fg;
|
||||||
|
expand: true;
|
||||||
|
horizontal-align: 0;
|
||||||
|
placeholder: "Search...";
|
||||||
|
padding: 6px;
|
||||||
|
blink: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inputbar {
|
||||||
|
children: [ textbox-prompt-colon, entry ];
|
||||||
|
background-color: @bga;
|
||||||
|
text-color: @fg;
|
||||||
|
expand: false;
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
listview {
|
||||||
|
background-color: @al;
|
||||||
|
padding: 0px;
|
||||||
|
columns: 1;
|
||||||
|
lines: 5;
|
||||||
|
spacing: 6px;
|
||||||
|
cycle: true;
|
||||||
|
dynamic: true;
|
||||||
|
layout: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
mainbox {
|
||||||
|
background-color: @al;
|
||||||
|
border: 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
children: [ inputbar, listview ];
|
||||||
|
spacing: 6px;
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element {
|
||||||
|
background-color: @al;
|
||||||
|
text-color: @fga;
|
||||||
|
orientation: horizontal;
|
||||||
|
border-radius: 0px;
|
||||||
|
padding: 3px 3px 3px -23px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-icon {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
size: 24px;
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element-text {
|
||||||
|
background-color: transparent;
|
||||||
|
text-color: inherit;
|
||||||
|
expand: true;
|
||||||
|
horizontal-align: 0;
|
||||||
|
vertical-align: 0.5;
|
||||||
|
margin: 0px 2.5px 0px 2.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
element selected {
|
||||||
|
background-color: @se;
|
||||||
|
text-color: @fga;
|
||||||
|
border: 0px 0px 0px 0px;
|
||||||
|
border-radius: 0px;
|
||||||
|
border-color: @ac;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SDIR="$HOME/.config/polybar/blocks/scripts"
|
||||||
|
|
||||||
|
# Launch Rofi
|
||||||
|
MENU="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p '' \
|
||||||
|
-theme $SDIR/rofi/styles.rasi \
|
||||||
|
<<< " Default| Nord| Gruvbox| Adapta| Cherry|")"
|
||||||
|
case "$MENU" in
|
||||||
|
*Default) "$SDIR"/styles.sh --default ;;
|
||||||
|
*Nord) "$SDIR"/styles.sh --nord ;;
|
||||||
|
*Gruvbox) "$SDIR"/styles.sh --gruvbox ;;
|
||||||
|
*Adapta) "$SDIR"/styles.sh --adapta ;;
|
||||||
|
*Cherry) "$SDIR"/styles.sh --cherry ;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Color files
|
||||||
|
PFILE="$HOME/.config/polybar/blocks/colors.ini"
|
||||||
|
RFILE="$HOME/.config/polybar/blocks/scripts/rofi/colors.rasi"
|
||||||
|
|
||||||
|
# Change colors
|
||||||
|
change_color() {
|
||||||
|
# polybar
|
||||||
|
sed -i -e "s/background = #.*/background = $BG/g" $PFILE
|
||||||
|
sed -i -e "s/background-alt = #.*/background-alt = $BGA/g" $PFILE
|
||||||
|
sed -i -e "s/foreground = #.*/foreground = $FG/g" $PFILE
|
||||||
|
sed -i -e "s/foreground-alt = #.*/foreground-alt = $FGA/g" $PFILE
|
||||||
|
sed -i -e "s/primary = #.*/primary = $AC/g" $PFILE
|
||||||
|
|
||||||
|
# rofi
|
||||||
|
cat > $RFILE <<- EOF
|
||||||
|
/* colors */
|
||||||
|
|
||||||
|
* {
|
||||||
|
al: #00000000;
|
||||||
|
bg: ${BG}FF;
|
||||||
|
bga: ${BGA}FF;
|
||||||
|
fga: ${FGA}FF;
|
||||||
|
fg: ${FG}FF;
|
||||||
|
ac: ${AC}FF;
|
||||||
|
se: ${AC}40;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
polybar-msg cmd restart
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $1 = "--default" ]]; then
|
||||||
|
BG="#2f343f"
|
||||||
|
BGA="#C4C7C5"
|
||||||
|
FGA="#C4C7C5"
|
||||||
|
FG="#1C1E20"
|
||||||
|
AC="#B4BC67"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--nord" ]]; then
|
||||||
|
BG="#3B4252"
|
||||||
|
BGA="#4C566A"
|
||||||
|
FGA="#E5E9F0"
|
||||||
|
FG="#ECEFF4"
|
||||||
|
AC="#A3BE8C"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--gruvbox" ]]; then
|
||||||
|
BG="#282828"
|
||||||
|
BGA="#EBDBB2"
|
||||||
|
FGA="#EBDBB2"
|
||||||
|
FG="#282828"
|
||||||
|
AC="#CC241D"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--adapta" ]]; then
|
||||||
|
BG="#243035"
|
||||||
|
BGA="#38444A"
|
||||||
|
FGA="#FDF6E3"
|
||||||
|
FG="#FFFFFF"
|
||||||
|
AC="#4DD0E1"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--cherry" ]]; then
|
||||||
|
BG="#1F1626"
|
||||||
|
BGA="#423949"
|
||||||
|
FGA="#FFFFFF"
|
||||||
|
FG="#FFFFFF"
|
||||||
|
AC="#D94085"
|
||||||
|
change_color
|
||||||
|
else
|
||||||
|
cat <<- _EOF_
|
||||||
|
No option specified, Available options:
|
||||||
|
--default --nord --gruvbox --adapta --cherry
|
||||||
|
_EOF_
|
||||||
|
fi
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
NOTIFY_ICON=/usr/share/icons/Papirus/32x32/apps/system-software-update.svg
|
||||||
|
|
||||||
|
get_total_updates() { UPDATES=$(~/.config/polybar/blocks/scripts/checkupdates 2>/dev/null | wc -l); }
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
get_total_updates
|
||||||
|
|
||||||
|
# notify user of updates
|
||||||
|
if hash notify-send &>/dev/null; then
|
||||||
|
if (( UPDATES > 50 )); then
|
||||||
|
notify-send -u critical -i $NOTIFY_ICON \
|
||||||
|
"You really need to update!!" "$UPDATES New packages"
|
||||||
|
elif (( UPDATES > 25 )); then
|
||||||
|
notify-send -u normal -i $NOTIFY_ICON \
|
||||||
|
"You should update soon" "$UPDATES New packages"
|
||||||
|
elif (( UPDATES > 2 )); then
|
||||||
|
notify-send -u low -i $NOTIFY_ICON \
|
||||||
|
"$UPDATES New packages"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# when there are updates available
|
||||||
|
# every 10 seconds another check for updates is done
|
||||||
|
while (( UPDATES > 0 )); do
|
||||||
|
if (( UPDATES == 1 )); then
|
||||||
|
echo "$UPDATES"
|
||||||
|
elif (( UPDATES > 1 )); then
|
||||||
|
echo "$UPDATES"
|
||||||
|
else
|
||||||
|
echo "None"
|
||||||
|
fi
|
||||||
|
sleep 10
|
||||||
|
get_total_updates
|
||||||
|
done
|
||||||
|
|
||||||
|
# when no updates are available, use a longer loop, this saves on CPU
|
||||||
|
# and network uptime, only checking once every 30 min for new updates
|
||||||
|
while (( UPDATES == 0 )); do
|
||||||
|
echo "None"
|
||||||
|
sleep 1800
|
||||||
|
get_total_updates
|
||||||
|
done
|
||||||
|
done
|
||||||
@@ -0,0 +1,292 @@
|
|||||||
|
;; ┌──────────────────────────────────────────────────────────────────────────────-----┐
|
||||||
|
;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█░█░█▀▀░█▀▀░█▀▄░░░█▄█░█▀█░█▀▄░█░█░█░░░█▀▀░█▀▀ │
|
||||||
|
;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░█░▀▀█░█▀▀░█▀▄░░░█░█░█░█░█░█░█░█░█░░░█▀▀░▀▀█ │
|
||||||
|
;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░░░▀░▀░▀▀▀░▀▀░░▀▀▀░▀▀▀░▀▀▀░▀▀▀ │
|
||||||
|
;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
|
||||||
|
;; └──────────────────────────────────────────────────────────────────────────────-----┘
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/updates]
|
||||||
|
type = custom/script
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %counter%
|
||||||
|
; Command to be executed (using "/usr/bin/env sh -c [command]")
|
||||||
|
exec = ~/.config/polybar/blocks/scripts/updates.sh
|
||||||
|
|
||||||
|
; Conditional command that, if defined, needs to exit successfully
|
||||||
|
; before the main exec command is invoked.
|
||||||
|
; Default: ""
|
||||||
|
;;exec-if = ""
|
||||||
|
|
||||||
|
; Will the script output continous content?
|
||||||
|
; Default: false
|
||||||
|
tail = true
|
||||||
|
|
||||||
|
; Seconds to sleep between updates
|
||||||
|
; Default: 2 (0 if `tail = true`)
|
||||||
|
interval = 5
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <output> - deprecated
|
||||||
|
; <label> (default)
|
||||||
|
format = <label>
|
||||||
|
format-prefix =
|
||||||
|
format-prefix-background = ${color.yellow}
|
||||||
|
format-prefix-padding = 1
|
||||||
|
format-overline = ${color.background}
|
||||||
|
format-underline = ${color.background}
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %output%
|
||||||
|
; Default: %output%
|
||||||
|
label = %output%
|
||||||
|
label-background = ${color.background-alt}
|
||||||
|
label-padding = 1
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %counter%
|
||||||
|
; %pid%
|
||||||
|
;
|
||||||
|
; "click-(left|middle|right)" will be executed using "/usr/bin/env sh -c [command]"
|
||||||
|
click-left = exo-open --launch TerminalEmulator &
|
||||||
|
click-right = exo-open --launch TerminalEmulator &
|
||||||
|
;;double-click-left = echo double left %counter%
|
||||||
|
;;double-click-middle = echo double middle %counter%
|
||||||
|
;;double-click-right = echo double right %counter%
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %counter%
|
||||||
|
; %pid%
|
||||||
|
;
|
||||||
|
; "scroll-(up|down)" will be executed using "/usr/bin/env sh -c [command]"
|
||||||
|
;;scroll-up = echo scroll up %counter%
|
||||||
|
;;scroll-down = echo scroll down %counter%
|
||||||
|
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/launcher]
|
||||||
|
type = custom/text
|
||||||
|
|
||||||
|
content-prefix =
|
||||||
|
content-prefix-background = ${color.teal}
|
||||||
|
content-prefix-padding = 1
|
||||||
|
|
||||||
|
content = " Menu "
|
||||||
|
content-background = ${color.background-alt}
|
||||||
|
content-foreground = ${color.foreground}
|
||||||
|
content-overline = ${color.background}
|
||||||
|
content-underline = ${color.background}
|
||||||
|
|
||||||
|
; "click-(left|middle|right)" will be executed using "/usr/bin/env sh -c $COMMAND"
|
||||||
|
click-left = ~/.config/polybar/blocks/scripts/launcher.sh &
|
||||||
|
;;click-middle = ~/.config/polybar/blocks/scripts/launcher-full
|
||||||
|
click-right = ~/.config/polybar/blocks/scripts/style-switch.sh &
|
||||||
|
|
||||||
|
; "scroll-(up|down)" will be executed using "/usr/bin/env sh -c $COMMAND"
|
||||||
|
;;scroll-up = ~/.config/polybar/blocks/scripts/launcher.sh &
|
||||||
|
;;scroll-down = ~/.config/polybar/blocks/scripts/color-switch.sh &
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/sysmenu]
|
||||||
|
type = custom/text
|
||||||
|
|
||||||
|
content-prefix =
|
||||||
|
content-prefix-background = ${color.cyan}
|
||||||
|
content-prefix-padding = 1
|
||||||
|
|
||||||
|
content = " System "
|
||||||
|
content-background = ${color.background-alt}
|
||||||
|
content-foreground = ${color.foreground}
|
||||||
|
content-overline = ${color.background}
|
||||||
|
content-underline = ${color.background}
|
||||||
|
|
||||||
|
click-left = ~/.config/polybar/blocks/scripts/powermenu.sh &
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/color-switch]
|
||||||
|
type = custom/text
|
||||||
|
|
||||||
|
content-prefix =
|
||||||
|
content-prefix-background = ${color.orange}
|
||||||
|
content-prefix-padding = 1
|
||||||
|
|
||||||
|
content = " Style "
|
||||||
|
content-background = ${color.background-alt}
|
||||||
|
content-foreground = ${color.foreground}
|
||||||
|
content-overline = ${color.background}
|
||||||
|
content-underline = ${color.background}
|
||||||
|
|
||||||
|
click-left = ~/.config/polybar/blocks/scripts/style-switch.sh &
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/sep]
|
||||||
|
type = custom/text
|
||||||
|
content = |
|
||||||
|
|
||||||
|
content-background = ${color.background}
|
||||||
|
content-foreground = ${color.background}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/apps]
|
||||||
|
type = custom/text
|
||||||
|
content-overline = ${color.background}
|
||||||
|
content-underline = ${color.background}
|
||||||
|
content-padding = 1
|
||||||
|
|
||||||
|
[module/term]
|
||||||
|
inherit = module/apps
|
||||||
|
content =
|
||||||
|
content-background = ${color.blue-gray}
|
||||||
|
content-foreground = ${color.foreground}
|
||||||
|
click-left = termite &
|
||||||
|
click-middle = urxvt &
|
||||||
|
click-right = xfce4-terminal &
|
||||||
|
|
||||||
|
[module/files]
|
||||||
|
inherit = module/apps
|
||||||
|
content =
|
||||||
|
content-background = ${color.blue}
|
||||||
|
content-foreground = ${color.foreground}
|
||||||
|
click-left = thunar &
|
||||||
|
click-right = pcmanfm &
|
||||||
|
|
||||||
|
[module/browser]
|
||||||
|
inherit = module/apps
|
||||||
|
content =
|
||||||
|
content-background = ${color.orange}
|
||||||
|
content-foreground = ${color.foreground}
|
||||||
|
click-left = firefox &
|
||||||
|
click-right = chromium &
|
||||||
|
|
||||||
|
[module/settings]
|
||||||
|
inherit = module/apps
|
||||||
|
content =
|
||||||
|
content-background = ${color.teal}
|
||||||
|
content-foreground = ${color.foreground}
|
||||||
|
click-left = xfce4-settings-manager &
|
||||||
|
click-right = lxappearance &
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/powermenu]
|
||||||
|
type = custom/menu
|
||||||
|
|
||||||
|
; If true, <label-toggle> will be to the left of the menu items (default).
|
||||||
|
; If false, it will be on the right of all the items.
|
||||||
|
expand-right = true
|
||||||
|
|
||||||
|
; "menu-LEVEL-N" has the same properties as "label-NAME" with
|
||||||
|
; the additional "exec" property
|
||||||
|
;
|
||||||
|
; Available exec commands:
|
||||||
|
; menu-open-LEVEL
|
||||||
|
; menu-close
|
||||||
|
; Other commands will be executed using "/usr/bin/env sh -c $COMMAND"
|
||||||
|
menu-0-0 = " Reboot |"
|
||||||
|
menu-0-0-background = ${color.background-alt}
|
||||||
|
menu-0-0-exec = menu-open-1
|
||||||
|
menu-0-1 = " Shutdown "
|
||||||
|
menu-0-1-background = ${color.background-alt}
|
||||||
|
menu-0-1-exec = menu-open-2
|
||||||
|
|
||||||
|
menu-1-0 = " Back |"
|
||||||
|
menu-1-0-background = ${color.background-alt}
|
||||||
|
menu-1-0-exec = menu-open-0
|
||||||
|
menu-1-1 = " Reboot "
|
||||||
|
menu-1-1-background = ${color.background-alt}
|
||||||
|
menu-1-1-exec = systemctl reboot
|
||||||
|
|
||||||
|
menu-2-0 = " Shutdown |"
|
||||||
|
menu-2-0-background = ${color.background-alt}
|
||||||
|
menu-2-0-exec = systemctl poweroff
|
||||||
|
menu-2-1 = " Back "
|
||||||
|
menu-2-1-background = ${color.background-alt}
|
||||||
|
menu-2-1-exec = menu-open-0
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-toggle> (default) - gets replaced with <label-(open|close)>
|
||||||
|
; <menu> (default)
|
||||||
|
; Note that if you use <label-toggle> you must also include
|
||||||
|
; the definition for <label-open>
|
||||||
|
|
||||||
|
format = <label-toggle><menu>
|
||||||
|
format-overline = ${color.background}
|
||||||
|
format-underline = ${color.background}
|
||||||
|
|
||||||
|
label-open =
|
||||||
|
label-open-background = ${color.cyan}
|
||||||
|
label-open-padding = 1
|
||||||
|
label-close =
|
||||||
|
label-close-background = ${color.red}
|
||||||
|
label-close-padding = 1
|
||||||
|
|
||||||
|
; Optional item separator
|
||||||
|
; Default: none
|
||||||
|
;label-separator = " | "
|
||||||
|
;label-separator-foreground = ${color.foreground}
|
||||||
|
;label-separator-background = ${color.background-alt}
|
||||||
|
|
||||||
|
;;label-open-foreground = ${color.foreground}
|
||||||
|
;;label-close-foreground = ${color.background}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/menu]
|
||||||
|
type = custom/menu
|
||||||
|
|
||||||
|
; If true, <label-toggle> will be to the left of the menu items (default).
|
||||||
|
; If false, it will be on the right of all the items.
|
||||||
|
expand-right = true
|
||||||
|
|
||||||
|
; "menu-LEVEL-N" has the same properties as "label-NAME" with
|
||||||
|
; the additional "exec" property
|
||||||
|
;
|
||||||
|
; Available exec commands:
|
||||||
|
; menu-open-LEVEL
|
||||||
|
; menu-close
|
||||||
|
; Other commands will be executed using "/usr/bin/env sh -c $COMMAND"
|
||||||
|
menu-0-0 =" Menu | "
|
||||||
|
menu-0-0-background = ${color.background-alt}
|
||||||
|
menu-0-0-exec = ~/.config/polybar/blocks/scripts/launcher.sh &
|
||||||
|
|
||||||
|
menu-0-1 =" Files | "
|
||||||
|
menu-0-1-background = ${color.background-alt}
|
||||||
|
menu-0-1-exec = thunar &
|
||||||
|
|
||||||
|
menu-0-2 =" Terminal | "
|
||||||
|
menu-0-2-background = ${color.background-alt}
|
||||||
|
menu-0-2-exec = termite &
|
||||||
|
|
||||||
|
menu-0-3 =" Browser "
|
||||||
|
menu-0-3-background = ${color.background-alt}
|
||||||
|
menu-0-3-exec = firefox &
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-toggle> (default) - gets replaced with <label-(open|close)>
|
||||||
|
; <menu> (default)
|
||||||
|
; Note that if you use <label-toggle> you must also include
|
||||||
|
; the definition for <label-open>
|
||||||
|
|
||||||
|
format = <label-toggle><menu>
|
||||||
|
format-overline = ${color.background}
|
||||||
|
format-underline = ${color.background}
|
||||||
|
|
||||||
|
label-open =
|
||||||
|
label-open-background = ${color.yellow}
|
||||||
|
label-open-padding = 1
|
||||||
|
label-close =
|
||||||
|
label-close-background = ${color.red}
|
||||||
|
label-close-padding = 1
|
||||||
|
|
||||||
|
; Optional item separator
|
||||||
|
; Default: none
|
||||||
|
;label-separator = " | "
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
@@ -0,0 +1,534 @@
|
|||||||
|
;; ┌────────────────────────────────────────────────────┐
|
||||||
|
;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀▄░█▀█░█▀▄░█▀▀│
|
||||||
|
;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█▀▄░█▀█░█▀▄░▀▀█│
|
||||||
|
;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀░░▀░▀░▀░▀░▀▀▀│
|
||||||
|
;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░│
|
||||||
|
;; └────────────────────────────────────────────────────┘
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[bar]
|
||||||
|
fill =
|
||||||
|
empty =
|
||||||
|
indicator = ⏽
|
||||||
|
; Nerd font : , ⏽, 樂 籠 錄 , 雷 絛
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/volume]
|
||||||
|
type = internal/alsa
|
||||||
|
|
||||||
|
; Soundcard to be used
|
||||||
|
; Usually in the format hw:# where # is the card number
|
||||||
|
; You can find the different card numbers in `/proc/asound/cards`
|
||||||
|
master-soundcard = default
|
||||||
|
speaker-soundcard = default
|
||||||
|
headphone-soundcard = default
|
||||||
|
|
||||||
|
; Name of the master, speaker and headphone mixers
|
||||||
|
; Use the following command to list available mixer controls:
|
||||||
|
; $ amixer scontrols | sed -nr "s/.*'([[:alnum:]]+)'.*/\1/p"
|
||||||
|
; If master, speaker or headphone-soundcard isn't the default,
|
||||||
|
; use `amixer -c # scontrols` instead where # is the number
|
||||||
|
; of the master, speaker or headphone soundcard respectively
|
||||||
|
;
|
||||||
|
; Default: Master
|
||||||
|
master-mixer = Master
|
||||||
|
|
||||||
|
; Optionally define speaker and headphone mixers
|
||||||
|
; Default: none
|
||||||
|
;;speaker-mixer = Speaker
|
||||||
|
; Default: none
|
||||||
|
;;headphone-mixer = Headphone
|
||||||
|
|
||||||
|
; NOTE: This is required if headphone_mixer is defined
|
||||||
|
; Use the following command to list available device controls
|
||||||
|
; $ amixer controls | sed -r "/CARD/\!d; s/.*=([0-9]+).*name='([^']+)'.*/printf '%3.0f: %s\n' '\1' '\2'/e" | sort
|
||||||
|
; You may also need to use `amixer -c # controls` as above for the mixer names
|
||||||
|
; Default: none
|
||||||
|
;;headphone-id = 9
|
||||||
|
|
||||||
|
; Use volume mapping (similar to amixer -M and alsamixer), where the increase in volume is linear to the ear
|
||||||
|
; Default: false
|
||||||
|
;;mapped = true
|
||||||
|
|
||||||
|
; Interval for volume increase/decrease (in percent points)
|
||||||
|
; Default: 5
|
||||||
|
interval = 5
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-volume> (default)
|
||||||
|
; <ramp-volume>
|
||||||
|
; <bar-volume>
|
||||||
|
format-volume = <ramp-volume> <bar-volume>
|
||||||
|
format-volume-background = ${color.shade6}
|
||||||
|
format-volume-padding = 2
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-muted> (default)
|
||||||
|
; <ramp-volume>
|
||||||
|
; <bar-volume>
|
||||||
|
format-muted = <label-muted>
|
||||||
|
format-muted-prefix =
|
||||||
|
format-muted-prefix-font = 2
|
||||||
|
format-muted-background = ${color.shade6}
|
||||||
|
format-muted-padding = 2
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default)
|
||||||
|
label-volume = %percentage%%
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default
|
||||||
|
label-muted = " Muted"
|
||||||
|
label-muted-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
; Only applies if <ramp-volume> is used
|
||||||
|
ramp-volume-0 =
|
||||||
|
ramp-volume-1 =
|
||||||
|
ramp-volume-2 =
|
||||||
|
ramp-volume-font = 2
|
||||||
|
|
||||||
|
; Only applies if <bar-volume> is used
|
||||||
|
bar-volume-width = 10
|
||||||
|
bar-volume-gradient = false
|
||||||
|
|
||||||
|
bar-volume-indicator = ${bar.indicator}
|
||||||
|
bar-volume-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-volume-fill = ${bar.fill}
|
||||||
|
bar-volume-foreground-0 = ${color.foreground}
|
||||||
|
bar-volume-foreground-1 = ${color.foreground}
|
||||||
|
bar-volume-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-volume-empty = ${bar.empty}
|
||||||
|
bar-volume-empty-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
; If defined, it will replace <ramp-volume> when
|
||||||
|
; headphones are plugged in to `headphone_control_numid`
|
||||||
|
; If undefined, <ramp-volume> will be used for both
|
||||||
|
; Only applies if <ramp-volume> is used
|
||||||
|
ramp-headphones-0 =
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/brightness]
|
||||||
|
;type = internal/xbacklight
|
||||||
|
type = internal/backlight
|
||||||
|
|
||||||
|
; Use the following command to list available cards:
|
||||||
|
; $ ls -1 /sys/class/backlight/
|
||||||
|
;card = intel_backlight
|
||||||
|
card = amdgpu_bl0
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label> (default)
|
||||||
|
; <ramp>
|
||||||
|
; <bar>
|
||||||
|
format = <ramp> <bar>
|
||||||
|
format-background = ${color.shade7}
|
||||||
|
format-padding = 2
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default)
|
||||||
|
label = %percentage%%
|
||||||
|
|
||||||
|
; Only applies if <ramp> is used
|
||||||
|
ramp-0 =
|
||||||
|
ramp-1 =
|
||||||
|
ramp-2 =
|
||||||
|
ramp-3 =
|
||||||
|
ramp-4 =
|
||||||
|
ramp-font = 2
|
||||||
|
|
||||||
|
; Only applies if <bar> is used
|
||||||
|
bar-width = 10
|
||||||
|
bar-gradient = false
|
||||||
|
|
||||||
|
bar-indicator = ${bar.indicator}
|
||||||
|
bar-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-fill = ${bar.fill}
|
||||||
|
bar-foreground-0 = ${color.foreground}
|
||||||
|
bar-foreground-1 = ${color.foreground}
|
||||||
|
bar-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-empty = ${bar.empty}
|
||||||
|
bar-empty-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/battery_bar]
|
||||||
|
type = internal/battery
|
||||||
|
|
||||||
|
; This is useful in case the battery never reports 100% charge
|
||||||
|
full-at = 99
|
||||||
|
|
||||||
|
; Use the following command to list batteries and adapters:
|
||||||
|
; $ ls -1 /sys/class/power_supply/
|
||||||
|
battery = BAT1
|
||||||
|
adapter = ACAD
|
||||||
|
|
||||||
|
; If an inotify event haven't been reported in this many
|
||||||
|
; seconds, manually poll for new values.
|
||||||
|
;
|
||||||
|
; Needed as a fallback for systems that don't report events
|
||||||
|
; on sysfs/procfs.
|
||||||
|
;
|
||||||
|
; Disable polling by setting the interval to 0.
|
||||||
|
;
|
||||||
|
; Default: 5
|
||||||
|
poll-interval = 2
|
||||||
|
|
||||||
|
; see "man date" for details on how to format the time string
|
||||||
|
; NOTE: if you want to use syntax tags here you need to use %%{...}
|
||||||
|
; Default: %H:%M:%S
|
||||||
|
time-format = %H:%M
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-charging> (default)
|
||||||
|
; <bar-capacity>
|
||||||
|
; <ramp-capacity>
|
||||||
|
; <animation-charging>
|
||||||
|
format-charging = <bar-capacity>
|
||||||
|
format-charging-prefix = " "
|
||||||
|
format-charging-prefix-font = 2
|
||||||
|
format-charging-background = ${color.shade5}
|
||||||
|
format-charging-padding = 2
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-discharging> (default)
|
||||||
|
; <bar-capacity>
|
||||||
|
; <ramp-capacity>
|
||||||
|
; <animation-discharging>
|
||||||
|
format-discharging = <bar-capacity>
|
||||||
|
format-discharging-prefix = " "
|
||||||
|
format-discharging-prefix-font = 2
|
||||||
|
format-discharging-background = ${color.shade5}
|
||||||
|
format-discharging-padding = 2
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-full> (default)
|
||||||
|
; <bar-capacity>
|
||||||
|
; <ramp-capacity>
|
||||||
|
format-full = <label-full>
|
||||||
|
format-full-prefix = " "
|
||||||
|
format-full-prefix-font = 2
|
||||||
|
format-full-background = ${color.shade5}
|
||||||
|
format-full-padding = 2
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default)
|
||||||
|
; %time%
|
||||||
|
; %consumption% (shows current charge rate in watts)
|
||||||
|
|
||||||
|
label-charging = %percentage%%
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default)
|
||||||
|
; %time%
|
||||||
|
; %consumption% (shows current discharge rate in watts)
|
||||||
|
label-discharging = %percentage%%
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default)
|
||||||
|
label-full = "Full"
|
||||||
|
|
||||||
|
; Only applies if <bar-capacity> is used
|
||||||
|
bar-capacity-width = 10
|
||||||
|
bar-capacity-gradient = false
|
||||||
|
|
||||||
|
bar-capacity-indicator = ${bar.indicator}
|
||||||
|
bar-capacity-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-capacity-fill = ${bar.fill}
|
||||||
|
bar-capacity-foreground-0 = ${color.foreground}
|
||||||
|
bar-capacity-foreground-1 = ${color.foreground}
|
||||||
|
bar-capacity-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-capacity-empty = ${bar.empty}
|
||||||
|
bar-capacity-empty-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/cpu_bar]
|
||||||
|
type = internal/cpu
|
||||||
|
|
||||||
|
; Seconds to sleep between updates
|
||||||
|
; Default: 1
|
||||||
|
interval = 0.5
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label> (default)
|
||||||
|
; <bar-load>
|
||||||
|
; <ramp-load>
|
||||||
|
; <ramp-coreload>
|
||||||
|
;;format = <label> <ramp-coreload>
|
||||||
|
format = <bar-load> <label>
|
||||||
|
format-prefix = " "
|
||||||
|
format-prefix-font = 2
|
||||||
|
format-background = ${color.shade7}
|
||||||
|
format-padding = 2
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage% (default) - total cpu load averaged over all cores
|
||||||
|
; %percentage-sum% - Cumulative load on all cores
|
||||||
|
; %percentage-cores% - load percentage for each core
|
||||||
|
; %percentage-core[1-9]% - load percentage for specific core
|
||||||
|
label = "%percentage%%"
|
||||||
|
|
||||||
|
; Only applies if <bar-load> is used
|
||||||
|
bar-load-width = 10
|
||||||
|
bar-load-gradient = false
|
||||||
|
|
||||||
|
bar-load-indicator = ${bar.indicator}
|
||||||
|
bar-load-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-load-fill = ${bar.fill}
|
||||||
|
bar-load-foreground-0 = ${color.foreground}
|
||||||
|
bar-load-foreground-1 = ${color.foreground}
|
||||||
|
bar-load-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-load-empty = ${bar.empty}
|
||||||
|
bar-load-empty-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/filesystem_bar]
|
||||||
|
type = internal/fs
|
||||||
|
|
||||||
|
; Mountpoints to display
|
||||||
|
mount-0 = /
|
||||||
|
;;mount-1 = /home
|
||||||
|
;;mount-2 = /var
|
||||||
|
|
||||||
|
; Seconds to sleep between updates
|
||||||
|
; Default: 30
|
||||||
|
interval = 30
|
||||||
|
|
||||||
|
; Display fixed precision values
|
||||||
|
; Default: false
|
||||||
|
fixed-values = false
|
||||||
|
|
||||||
|
; Spacing between entries
|
||||||
|
; Default: 2
|
||||||
|
;;spacing = 4
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-mounted> (default)
|
||||||
|
; <bar-free>
|
||||||
|
; <bar-used>
|
||||||
|
; <ramp-capacity>
|
||||||
|
format-mounted = <bar-used> <label-mounted>
|
||||||
|
format-mounted-prefix = " "
|
||||||
|
format-mounted-prefix-font = 2
|
||||||
|
format-mounted-background = ${color.shade5}
|
||||||
|
format-mounted-padding = 2
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-unmounted> (default)
|
||||||
|
format-unmounted = <label-unmounted>
|
||||||
|
format-unmounted-prefix = " "
|
||||||
|
format-unmounted-prefix-font = 2
|
||||||
|
format-unmounted-background = ${color.shade5}
|
||||||
|
format-unmounted-padding = 2
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %mountpoint%
|
||||||
|
; %type%
|
||||||
|
; %fsname%
|
||||||
|
; %percentage_free%
|
||||||
|
; %percentage_used%
|
||||||
|
; %total%
|
||||||
|
; %free%
|
||||||
|
; %used%
|
||||||
|
; Default: %mountpoint% %percentage_free%%
|
||||||
|
label-mounted = %used%/%total%
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %mountpoint%
|
||||||
|
; Default: %mountpoint% is not mounted
|
||||||
|
label-unmounted = "%mountpoint%: not mounted"
|
||||||
|
|
||||||
|
; Only applies if <bar-used> is used
|
||||||
|
bar-used-width = 10
|
||||||
|
bar-used-gradient = false
|
||||||
|
|
||||||
|
bar-used-indicator = ${bar.indicator}
|
||||||
|
bar-used-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-used-fill = ${bar.fill}
|
||||||
|
bar-used-foreground-0 = ${color.foreground}
|
||||||
|
bar-used-foreground-1 = ${color.foreground}
|
||||||
|
bar-used-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-used-empty = ${bar.empty}
|
||||||
|
bar-used-empty-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/memory_bar]
|
||||||
|
type = internal/memory
|
||||||
|
|
||||||
|
; Seconds to sleep between updates
|
||||||
|
; Default: 1
|
||||||
|
interval = 2
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label> (default)
|
||||||
|
; <bar-used>
|
||||||
|
; <bar-free>
|
||||||
|
; <ramp-used>
|
||||||
|
; <ramp-free>
|
||||||
|
; <bar-swap-used>
|
||||||
|
; <bar-swap-free>
|
||||||
|
; <ramp-swap-used>
|
||||||
|
; <ramp-swap-free>
|
||||||
|
format = <bar-used> <label>
|
||||||
|
format-prefix = " "
|
||||||
|
format-prefix-font = 2
|
||||||
|
format-background = ${color.shade6}
|
||||||
|
format-padding = 2
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %percentage_used% (default)
|
||||||
|
; %percentage_free%
|
||||||
|
; %gb_used%
|
||||||
|
; %gb_free%
|
||||||
|
; %gb_total%
|
||||||
|
; %mb_used%
|
||||||
|
; %mb_free%
|
||||||
|
; %mb_total%
|
||||||
|
; %percentage_swap_used%
|
||||||
|
; %percentage_swap_free%
|
||||||
|
; %mb_swap_total%
|
||||||
|
; %mb_swap_free%
|
||||||
|
; %mb_swap_used%
|
||||||
|
; %gb_swap_total%
|
||||||
|
; %gb_swap_free%
|
||||||
|
; %gb_swap_used%
|
||||||
|
|
||||||
|
label = "%mb_used%"
|
||||||
|
|
||||||
|
; Only applies if <bar-used> is used
|
||||||
|
bar-used-width = 10
|
||||||
|
bar-used-gradient = false
|
||||||
|
|
||||||
|
bar-used-indicator = ${bar.indicator}
|
||||||
|
bar-used-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-used-fill = ${bar.fill}
|
||||||
|
bar-used-foreground-0 = ${color.foreground}
|
||||||
|
bar-used-foreground-1 = ${color.foreground}
|
||||||
|
bar-used-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-used-empty = ${bar.empty}
|
||||||
|
bar-used-empty-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[module/mpd_bar]
|
||||||
|
type = internal/mpd
|
||||||
|
|
||||||
|
; Host where mpd is running (either ip or domain name)
|
||||||
|
; Can also be the full path to a unix socket where mpd is running.
|
||||||
|
;;host = 127.0.0.1
|
||||||
|
;;port = 6600
|
||||||
|
;;password = mysecretpassword
|
||||||
|
|
||||||
|
; Seconds to sleep between progressbar/song timer sync
|
||||||
|
; Default: 1
|
||||||
|
interval = 1
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-song> (default)
|
||||||
|
; <label-time>
|
||||||
|
; <bar-progress>
|
||||||
|
; <toggle> - gets replaced with <icon-(pause|play)>
|
||||||
|
; <toggle-stop> - gets replaced with <icon-(stop|play)>
|
||||||
|
; <icon-random>
|
||||||
|
; <icon-repeat>
|
||||||
|
; <icon-repeatone> (deprecated)
|
||||||
|
; <icon-single> - Toggle playing only a single song. Replaces <icon-repeatone>
|
||||||
|
; <icon-consume>
|
||||||
|
; <icon-prev>
|
||||||
|
; <icon-stop>
|
||||||
|
; <icon-play>
|
||||||
|
; <icon-pause>
|
||||||
|
; <icon-next>
|
||||||
|
; <icon-seekb>
|
||||||
|
; <icon-seekf>
|
||||||
|
format-online = <label-song> <bar-progress> <label-time>
|
||||||
|
format-online-prefix = ﱘ
|
||||||
|
format-online-prefix-font = 2
|
||||||
|
format-online-background = ${color.shade4}
|
||||||
|
format-online-padding = 2
|
||||||
|
|
||||||
|
;format-playing = ${self.format-online}
|
||||||
|
;format-paused = ${self.format-online}
|
||||||
|
;format-stopped = ${self.format-online}
|
||||||
|
|
||||||
|
; Available tags:
|
||||||
|
; <label-offline>
|
||||||
|
format-offline = <label-offline>
|
||||||
|
format-offline-prefix = ﱘ
|
||||||
|
format-offline-prefix-font = 2
|
||||||
|
format-offline-background = ${color.shade4}
|
||||||
|
format-offline-padding = 2
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %artist%
|
||||||
|
; %album-artist%
|
||||||
|
; %album%
|
||||||
|
; %date%
|
||||||
|
; %title%
|
||||||
|
; Default: %artist% - %title%
|
||||||
|
label-song = " %artist% - %title%"
|
||||||
|
label-song-maxlen = 25
|
||||||
|
label-song-ellipsis = true
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; %elapsed%
|
||||||
|
; %total%
|
||||||
|
; Default: %elapsed% / %total%
|
||||||
|
label-time = %elapsed% / %total%
|
||||||
|
|
||||||
|
; Available tokens:
|
||||||
|
; None
|
||||||
|
label-offline = " Offline"
|
||||||
|
|
||||||
|
; Only applies if <icon-X> is used
|
||||||
|
icon-play = 喇
|
||||||
|
icon-pause =
|
||||||
|
icon-stop =
|
||||||
|
icon-prev =
|
||||||
|
icon-next =
|
||||||
|
icon-seekb =
|
||||||
|
icon-seekf =
|
||||||
|
icon-random =
|
||||||
|
icon-repeat =
|
||||||
|
icon-repeatone =
|
||||||
|
icon-single =
|
||||||
|
icon-consume =
|
||||||
|
|
||||||
|
; Used to display the state of random/repeat/repeatone/single
|
||||||
|
; Only applies if <icon-[random|repeat|repeatone|single]> is used
|
||||||
|
toggle-on-foreground = ${color.foreground}
|
||||||
|
toggle-off-foreground = ${color.background}
|
||||||
|
|
||||||
|
; Only applies if <bar-progress> is used
|
||||||
|
bar-progress-width = 10
|
||||||
|
bar-progress-gradient = false
|
||||||
|
|
||||||
|
bar-progress-indicator = ${bar.indicator}
|
||||||
|
bar-progress-indicator-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
bar-progress-fill = ${bar.fill}
|
||||||
|
bar-progress-foreground-0 = ${color.foreground}
|
||||||
|
bar-progress-foreground-1 = ${color.foreground}
|
||||||
|
bar-progress-foreground-2 = ${color.foreground}
|
||||||
|
|
||||||
|
bar-progress-empty = ${bar.empty}
|
||||||
|
bar-progress-empty-foreground = ${color.foreground}
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
;; ┌────────────────────────────────────────────────────────────┐
|
||||||
|
;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀▀░█▀█░█░░░█▀█░█▀▄░█▀▀│
|
||||||
|
;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░░░█░█░█░░░█░█░█▀▄░▀▀█│
|
||||||
|
;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀▀░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀▀▀│
|
||||||
|
;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░│
|
||||||
|
;; └────────────────────────────────────────────────────────────┘
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[color]
|
||||||
|
|
||||||
|
;; Use pywal.sh in scripts directory to use colors from an image/wallpaper.
|
||||||
|
|
||||||
|
;; main colors
|
||||||
|
background = #141C21
|
||||||
|
foreground = #F5F5F5
|
||||||
|
foreground-alt = #FFFFFF
|
||||||
|
alpha = #00000000
|
||||||
|
|
||||||
|
;; shades
|
||||||
|
shade1 = #BF360C
|
||||||
|
shade2 = #D84315
|
||||||
|
shade3 = #E64A19
|
||||||
|
shade4 = #F4511E
|
||||||
|
shade5 = #FF5722
|
||||||
|
shade6 = #FF7043
|
||||||
|
shade7 = #FF8A65
|
||||||
|
shade8 = #FFAB91
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
@@ -0,0 +1,293 @@
|
|||||||
|
;; ┌────────────────────────────────────────────────────────────┐
|
||||||
|
;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀▀░█▀█░█▀█░█▀▀░▀█▀░█▀▀│
|
||||||
|
;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█░░░█░█░█░█░█▀▀░░█░░█░█│
|
||||||
|
;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀▀▀░▀▀▀░▀░▀░▀░░░▀▀▀░▀▀▀│
|
||||||
|
;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░│
|
||||||
|
;; └────────────────────────────────────────────────────────────┘
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Global WM Settings
|
||||||
|
|
||||||
|
[global/wm]
|
||||||
|
; Adjust the _NET_WM_STRUT_PARTIAL top value
|
||||||
|
; Used for top aligned bars
|
||||||
|
margin-bottom = 0
|
||||||
|
|
||||||
|
; Adjust the _NET_WM_STRUT_PARTIAL bottom value
|
||||||
|
; Used for bottom aligned bars
|
||||||
|
margin-top = 0
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; File Inclusion
|
||||||
|
; include an external file, like module file, etc.
|
||||||
|
|
||||||
|
include-file = ~/.config/polybar/colorblocks/bars.ini
|
||||||
|
include-file = ~/.config/polybar/colorblocks/colors.ini
|
||||||
|
include-file = ~/.config/polybar/colorblocks/modules.ini
|
||||||
|
include-file = ~/.config/polybar/colorblocks/user_modules.ini
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Bar Settings
|
||||||
|
|
||||||
|
[bar/main]
|
||||||
|
; Use either of the following command to list available outputs:
|
||||||
|
; If unspecified, the application will pick the first one it finds.
|
||||||
|
; $ polybar -m | cut -d ':' -f 1
|
||||||
|
; $ xrandr -q | grep " connected" | cut -d ' ' -f1
|
||||||
|
monitor =
|
||||||
|
|
||||||
|
; Use the specified monitor as a fallback if the main one is not found.
|
||||||
|
monitor-fallback =
|
||||||
|
|
||||||
|
; Require the monitor to be in connected state
|
||||||
|
; XRandR sometimes reports my monitor as being disconnected (when in use)
|
||||||
|
monitor-strict = false
|
||||||
|
|
||||||
|
; Tell the Window Manager not to configure the window.
|
||||||
|
; Use this to detach the bar if your WM is locking its size/position.
|
||||||
|
override-redirect = false
|
||||||
|
|
||||||
|
; Put the bar at the bottom of the screen
|
||||||
|
bottom = true
|
||||||
|
|
||||||
|
; Prefer fixed center position for the `modules-center` block
|
||||||
|
; When false, the center position will be based on the size of the other blocks.
|
||||||
|
fixed-center = true
|
||||||
|
|
||||||
|
; Dimension defined as pixel value (e.g. 35) or percentage (e.g. 50%),
|
||||||
|
; the percentage can optionally be extended with a pixel offset like so:
|
||||||
|
; 50%:-10, this will result in a width or height of 50% minus 10 pixels
|
||||||
|
width = 99%
|
||||||
|
height = 40
|
||||||
|
|
||||||
|
; Offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
|
||||||
|
; the percentage can optionally be extended with a pixel offset like so:
|
||||||
|
; 50%:-10, this will result in an offset in the x or y direction
|
||||||
|
; of 50% minus 10 pixels
|
||||||
|
offset-x = 0.5%
|
||||||
|
offset-y = 1%
|
||||||
|
|
||||||
|
; Background ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
background = ${color.alpha}
|
||||||
|
|
||||||
|
; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
foreground = ${color.foreground}
|
||||||
|
|
||||||
|
; Background gradient (vertical steps)
|
||||||
|
; background-[0-9]+ = #aarrggbb
|
||||||
|
;;background-0 =
|
||||||
|
|
||||||
|
; Value used for drawing rounded corners
|
||||||
|
; Note: This shouldn't be used together with border-size because the border
|
||||||
|
; doesn't get rounded
|
||||||
|
; Individual top/bottom values can be defined using:
|
||||||
|
; radius-{top,bottom}
|
||||||
|
radius-top = 0.0
|
||||||
|
radius-bottom = 0.0
|
||||||
|
|
||||||
|
; Under-/overline pixel size and argb color
|
||||||
|
; Individual values can be defined using:
|
||||||
|
; {overline,underline}-size
|
||||||
|
; {overline,underline}-color
|
||||||
|
underline-size = 2
|
||||||
|
underline-color = ${color.foreground}
|
||||||
|
|
||||||
|
; Values applied to all borders
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; border-{left,top,right,bottom}-size
|
||||||
|
; border-{left,top,right,bottom}-color
|
||||||
|
; The top and bottom borders are added to the bar height, so the effective
|
||||||
|
; window height is:
|
||||||
|
; height + border-top-size + border-bottom-size
|
||||||
|
; Meanwhile the effective window width is defined entirely by the width key and
|
||||||
|
; the border is placed withing this area. So you effectively only have the
|
||||||
|
; following horizontal space on the bar:
|
||||||
|
; width - border-right-size - border-left-size
|
||||||
|
border-size = 0
|
||||||
|
border-color = ${color.background}
|
||||||
|
|
||||||
|
; Number of spaces to add at the beginning/end of the bar
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; padding-{left,right}
|
||||||
|
padding = 0
|
||||||
|
|
||||||
|
; Number of spaces to add before/after each module
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; module-margin-{left,right}
|
||||||
|
module-margin-left = 0
|
||||||
|
module-margin-right = 0
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
; Fonts are defined using <font-name>;<vertical-offset>
|
||||||
|
; Font names are specified using a fontconfig pattern.
|
||||||
|
; font-0 = NotoSans-Regular:size=8;2
|
||||||
|
; font-1 = MaterialIcons:size=10
|
||||||
|
; font-2 = Termsynu:size=8;-1
|
||||||
|
; font-3 = FontAwesome:size=10
|
||||||
|
; See the Fonts wiki page for more details
|
||||||
|
|
||||||
|
font-0 = "Iosevka Nerd Font:pixelsize=10;4"
|
||||||
|
font-1 = "Iosevka Nerd Font:pixelsize=13;4"
|
||||||
|
|
||||||
|
; Modules are added to one of the available blocks
|
||||||
|
; modules-left = cpu ram
|
||||||
|
; modules-center = xwindow xbacklight
|
||||||
|
; modules-right = ipc clock
|
||||||
|
|
||||||
|
modules-left = launcher sep workspaces sep mpd
|
||||||
|
modules-center =
|
||||||
|
modules-right = color-switch sep cpu memory alsa battery network date sep sysmenu
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
; The separator will be inserted between the output of each module
|
||||||
|
separator =
|
||||||
|
|
||||||
|
; Opacity value between 0.0 and 1.0 used on fade in/out
|
||||||
|
dim-value = 1.0
|
||||||
|
|
||||||
|
; Value to be used to set the WM_NAME atom
|
||||||
|
; If the value is empty or undefined, the atom value
|
||||||
|
; will be created from the following template: polybar-[BAR]_[MONITOR]
|
||||||
|
; NOTE: The placeholders are not available for custom values
|
||||||
|
wm-name =
|
||||||
|
|
||||||
|
; Locale used to localize various module data (e.g. date)
|
||||||
|
; Expects a valid libc locale, for example: sv_SE.UTF-8
|
||||||
|
locale =
|
||||||
|
|
||||||
|
; Position of the system tray window
|
||||||
|
; If empty or undefined, tray support will be disabled
|
||||||
|
; NOTE: A center aligned tray will cover center aligned modules
|
||||||
|
;
|
||||||
|
; Available positions:
|
||||||
|
; left
|
||||||
|
; center
|
||||||
|
; right
|
||||||
|
; none
|
||||||
|
tray-position = none
|
||||||
|
|
||||||
|
; If true, the bar will not shift its
|
||||||
|
; contents when the tray changes
|
||||||
|
tray-detached = false
|
||||||
|
|
||||||
|
; Tray icon max size
|
||||||
|
tray-maxsize = 16
|
||||||
|
|
||||||
|
; Background color for the tray container
|
||||||
|
; ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
; By default the tray container will use the bar
|
||||||
|
; background color.
|
||||||
|
tray-background = ${color.background}
|
||||||
|
|
||||||
|
; Tray offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
|
||||||
|
tray-offset-x = 0
|
||||||
|
tray-offset-y = 0
|
||||||
|
|
||||||
|
; Pad the sides of each tray icon
|
||||||
|
tray-padding = 0
|
||||||
|
|
||||||
|
; Scale factor for tray clients
|
||||||
|
tray-scale = 1.0
|
||||||
|
|
||||||
|
; Restack the bar window and put it above the
|
||||||
|
; selected window manager's root
|
||||||
|
;
|
||||||
|
; Fixes the issue where the bar is being drawn
|
||||||
|
; on top of fullscreen window's
|
||||||
|
;
|
||||||
|
; Currently supported WM's:
|
||||||
|
; bspwm
|
||||||
|
; i3 (requires: `override-redirect = true`)
|
||||||
|
;;wm-restack =
|
||||||
|
|
||||||
|
; Set a DPI values used when rendering text
|
||||||
|
; This only affects scalable fonts
|
||||||
|
; dpi =
|
||||||
|
|
||||||
|
; Enable support for inter-process messaging
|
||||||
|
; See the Messaging wiki page for more details.
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
; Fallback click handlers that will be called if
|
||||||
|
; there's no matching module handler found.
|
||||||
|
click-left =
|
||||||
|
click-middle =
|
||||||
|
click-right =
|
||||||
|
scroll-up =
|
||||||
|
scroll-down =
|
||||||
|
double-click-left =
|
||||||
|
double-click-middle =
|
||||||
|
double-click-right =
|
||||||
|
|
||||||
|
; Requires polybar to be built with xcursor support (xcb-util-cursor)
|
||||||
|
; Possible values are:
|
||||||
|
; - default : The default pointer as before, can also be an empty string (default)
|
||||||
|
; - pointer : Typically in the form of a hand
|
||||||
|
; - ns-resize : Up and down arrows, can be used to indicate scrolling
|
||||||
|
cursor-click =
|
||||||
|
cursor-scroll =
|
||||||
|
|
||||||
|
;; WM Workspace Specific
|
||||||
|
|
||||||
|
; bspwm
|
||||||
|
;;scroll-up = bspwm-desknext
|
||||||
|
;;scroll-down = bspwm-deskprev
|
||||||
|
;;scroll-up = bspc desktop -f prev.local
|
||||||
|
;;scroll-down = bspc desktop -f next.local
|
||||||
|
|
||||||
|
;i3
|
||||||
|
;;scroll-up = i3wm-wsnext
|
||||||
|
;;scroll-down = i3wm-wsprev
|
||||||
|
;;scroll-up = i3-msg workspace next_on_output
|
||||||
|
;;scroll-down = i3-msg workspace prev_on_output
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Application Settings
|
||||||
|
|
||||||
|
[settings]
|
||||||
|
; The throttle settings lets the eventloop swallow up til X events
|
||||||
|
; if they happen within Y millisecond after first event was received.
|
||||||
|
; This is done to prevent flood of update event.
|
||||||
|
;
|
||||||
|
; For example if 5 modules emit an update event at the same time, we really
|
||||||
|
; just care about the last one. But if we wait too long for events to swallow
|
||||||
|
; the bar would appear sluggish so we continue if timeout
|
||||||
|
; expires or limit is reached.
|
||||||
|
throttle-output = 5
|
||||||
|
throttle-output-for = 10
|
||||||
|
|
||||||
|
; Time in milliseconds that the input handler will wait between processing events
|
||||||
|
;throttle-input-for = 30
|
||||||
|
|
||||||
|
; Reload upon receiving XCB_RANDR_SCREEN_CHANGE_NOTIFY events
|
||||||
|
screenchange-reload = false
|
||||||
|
|
||||||
|
; Compositing operators
|
||||||
|
; @see: https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t
|
||||||
|
compositing-background = source
|
||||||
|
compositing-foreground = over
|
||||||
|
compositing-overline = over
|
||||||
|
compositing-underline = over
|
||||||
|
compositing-border = over
|
||||||
|
|
||||||
|
; Define fallback values used by all module formats
|
||||||
|
;format-foreground =
|
||||||
|
;format-background =
|
||||||
|
;format-underline =
|
||||||
|
;format-overline =
|
||||||
|
;format-spacing =
|
||||||
|
;format-padding =
|
||||||
|
;format-margin =
|
||||||
|
;format-offset =
|
||||||
|
|
||||||
|
; Enables pseudo-transparency for the bar
|
||||||
|
; If set to true the bar can be transparent without a compositor.
|
||||||
|
pseudo-transparency = false
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Add this script to your wm startup file.
|
||||||
|
|
||||||
|
DIR="$HOME/.config/polybar/colorblocks"
|
||||||
|
|
||||||
|
# Terminate already running bar instances
|
||||||
|
killall -q polybar
|
||||||
|
|
||||||
|
# Wait until the processes have been shut down
|
||||||
|
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
|
# Launch the bar
|
||||||
|
polybar -q main -c "$DIR"/config.ini &
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,311 @@
|
|||||||
|
;; ┌────────────────────────────────────────────────────────────────────┐
|
||||||
|
;; │░█▀█░█▀█░█░░░█░█░█▀▄░█▀█░█▀▄░░░░░░░░░█▀█░█▀▄░█▀▀░█░█░▀█▀░█▀▀░█░█░█▀▀│
|
||||||
|
;; │░█▀▀░█░█░█░░░░█░░█▀▄░█▀█░█▀▄░░░░▀░░░░█▀▀░█▀▄░█▀▀░▀▄▀░░█░░█▀▀░█▄█░▀▀█│
|
||||||
|
;; │░▀░░░▀▀▀░▀▀▀░░▀░░▀▀░░▀░▀░▀░▀░░░░▀░░░░▀░░░▀░▀░▀▀▀░░▀░░▀▀▀░▀▀▀░▀░▀░▀▀▀│
|
||||||
|
;; │░Created░By░Aditya░Shakya░@adi1090x░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
|
||||||
|
;; └────────────────────────────────────────────────────────────────────┘
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Global WM Settings
|
||||||
|
|
||||||
|
[global/wm]
|
||||||
|
; Adjust the _NET_WM_STRUT_PARTIAL top value
|
||||||
|
; Used for top aligned bars
|
||||||
|
margin-bottom = 0
|
||||||
|
|
||||||
|
; Adjust the _NET_WM_STRUT_PARTIAL bottom value
|
||||||
|
; Used for bottom aligned bars
|
||||||
|
margin-top = 0
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; File Inclusion
|
||||||
|
; include an external file, like module file, etc.
|
||||||
|
|
||||||
|
include-file = ~/.config/polybar/colorblocks/bars.ini
|
||||||
|
include-file = ~/.config/polybar/colorblocks/colors.ini
|
||||||
|
include-file = ~/.config/polybar/colorblocks/modules.ini
|
||||||
|
include-file = ~/.config/polybar/colorblocks/user_modules.ini
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Bar Settings
|
||||||
|
|
||||||
|
[bar/main]
|
||||||
|
; Use either of the following command to list available outputs:
|
||||||
|
; If unspecified, the application will pick the first one it finds.
|
||||||
|
; $ polybar -m | cut -d ':' -f 1
|
||||||
|
; $ xrandr -q | grep " connected" | cut -d ' ' -f1
|
||||||
|
monitor =
|
||||||
|
|
||||||
|
; Use the specified monitor as a fallback if the main one is not found.
|
||||||
|
monitor-fallback =
|
||||||
|
|
||||||
|
; Require the monitor to be in connected state
|
||||||
|
; XRandR sometimes reports my monitor as being disconnected (when in use)
|
||||||
|
monitor-strict = false
|
||||||
|
|
||||||
|
; Tell the Window Manager not to configure the window.
|
||||||
|
; Use this to detach the bar if your WM is locking its size/position.
|
||||||
|
override-redirect = false
|
||||||
|
|
||||||
|
; Put the bar at the bottom of the screen
|
||||||
|
bottom = true
|
||||||
|
|
||||||
|
; Prefer fixed center position for the `modules-center` block
|
||||||
|
; When false, the center position will be based on the size of the other blocks.
|
||||||
|
fixed-center = true
|
||||||
|
|
||||||
|
; Dimension defined as pixel value (e.g. 35) or percentage (e.g. 50%),
|
||||||
|
; the percentage can optionally be extended with a pixel offset like so:
|
||||||
|
; 50%:-10, this will result in a width or height of 50% minus 10 pixels
|
||||||
|
width = 99%
|
||||||
|
height = 40
|
||||||
|
|
||||||
|
; Offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
|
||||||
|
; the percentage can optionally be extended with a pixel offset like so:
|
||||||
|
; 50%:-10, this will result in an offset in the x or y direction
|
||||||
|
; of 50% minus 10 pixels
|
||||||
|
offset-x = 0.5%
|
||||||
|
offset-y = 1%
|
||||||
|
|
||||||
|
; Background ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
background = ${color.alpha}
|
||||||
|
|
||||||
|
; Foreground ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
foreground = ${color.foreground}
|
||||||
|
|
||||||
|
; Background gradient (vertical steps)
|
||||||
|
; background-[0-9]+ = #aarrggbb
|
||||||
|
;;background-0 =
|
||||||
|
|
||||||
|
; Value used for drawing rounded corners
|
||||||
|
; Note: This shouldn't be used together with border-size because the border
|
||||||
|
; doesn't get rounded
|
||||||
|
; Individual top/bottom values can be defined using:
|
||||||
|
; radius-{top,bottom}
|
||||||
|
radius-top = 0.0
|
||||||
|
radius-bottom = 0.0
|
||||||
|
|
||||||
|
; Under-/overline pixel size and argb color
|
||||||
|
; Individual values can be defined using:
|
||||||
|
; {overline,underline}-size
|
||||||
|
; {overline,underline}-color
|
||||||
|
underline-size = 2
|
||||||
|
underline-color = ${color.foreground}
|
||||||
|
|
||||||
|
; Values applied to all borders
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; border-{left,top,right,bottom}-size
|
||||||
|
; border-{left,top,right,bottom}-color
|
||||||
|
; The top and bottom borders are added to the bar height, so the effective
|
||||||
|
; window height is:
|
||||||
|
; height + border-top-size + border-bottom-size
|
||||||
|
; Meanwhile the effective window width is defined entirely by the width key and
|
||||||
|
; the border is placed withing this area. So you effectively only have the
|
||||||
|
; following horizontal space on the bar:
|
||||||
|
; width - border-right-size - border-left-size
|
||||||
|
border-size = 0
|
||||||
|
border-color = ${color.background}
|
||||||
|
|
||||||
|
; Number of spaces to add at the beginning/end of the bar
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; padding-{left,right}
|
||||||
|
padding = 0
|
||||||
|
|
||||||
|
; Number of spaces to add before/after each module
|
||||||
|
; Individual side values can be defined using:
|
||||||
|
; module-margin-{left,right}
|
||||||
|
module-margin-left = 0
|
||||||
|
module-margin-right = 0
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
; Fonts are defined using <font-name>;<vertical-offset>
|
||||||
|
; Font names are specified using a fontconfig pattern.
|
||||||
|
; font-0 = NotoSans-Regular:size=8;2
|
||||||
|
; font-1 = MaterialIcons:size=10
|
||||||
|
; font-2 = Termsynu:size=8;-1
|
||||||
|
; font-3 = FontAwesome:size=10
|
||||||
|
; See the Fonts wiki page for more details
|
||||||
|
|
||||||
|
font-0 = "Iosevka Nerd Font:pixelsize=10;4"
|
||||||
|
font-1 = "Iosevka Nerd Font:pixelsize=13;4"
|
||||||
|
|
||||||
|
; Modules are added to one of the available blocks
|
||||||
|
; modules-left = cpu ram
|
||||||
|
; modules-center = xwindow xbacklight
|
||||||
|
; modules-right = ipc clock
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
[bar/top]
|
||||||
|
inherit = bar/main
|
||||||
|
modules-left = menu sep title sep google github reddit gmail twitter
|
||||||
|
modules-right = updates temperature filesystem keyboard pulseaudio backlight sep powermenu
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
[bar/mid]
|
||||||
|
offset-y = 62
|
||||||
|
inherit = bar/main
|
||||||
|
modules-center = cpu_bar sep memory_bar sep filesystem_bar sep mpd_bar sep battery_bar sep volume sep brightness
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
[bar/bottom]
|
||||||
|
inherit = bar/main
|
||||||
|
offset-y = 114
|
||||||
|
modules-left = launcher sep workspaces sep mpd
|
||||||
|
modules-center =
|
||||||
|
modules-right = color-switch sep cpu memory alsa battery network date sep sysmenu
|
||||||
|
enable-ipc = true
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
; The separator will be inserted between the output of each module
|
||||||
|
separator =
|
||||||
|
|
||||||
|
; Opacity value between 0.0 and 1.0 used on fade in/out
|
||||||
|
dim-value = 1.0
|
||||||
|
|
||||||
|
; Value to be used to set the WM_NAME atom
|
||||||
|
; If the value is empty or undefined, the atom value
|
||||||
|
; will be created from the following template: polybar-[BAR]_[MONITOR]
|
||||||
|
; NOTE: The placeholders are not available for custom values
|
||||||
|
wm-name =
|
||||||
|
|
||||||
|
; Locale used to localize various module data (e.g. date)
|
||||||
|
; Expects a valid libc locale, for example: sv_SE.UTF-8
|
||||||
|
locale =
|
||||||
|
|
||||||
|
; Position of the system tray window
|
||||||
|
; If empty or undefined, tray support will be disabled
|
||||||
|
; NOTE: A center aligned tray will cover center aligned modules
|
||||||
|
;
|
||||||
|
; Available positions:
|
||||||
|
; left
|
||||||
|
; center
|
||||||
|
; right
|
||||||
|
; none
|
||||||
|
tray-position = none
|
||||||
|
|
||||||
|
; If true, the bar will not shift its
|
||||||
|
; contents when the tray changes
|
||||||
|
tray-detached = false
|
||||||
|
|
||||||
|
; Tray icon max size
|
||||||
|
tray-maxsize = 16
|
||||||
|
|
||||||
|
; Background color for the tray container
|
||||||
|
; ARGB color (e.g. #f00, #ff992a, #ddff1023)
|
||||||
|
; By default the tray container will use the bar
|
||||||
|
; background color.
|
||||||
|
tray-background = ${color.background}
|
||||||
|
|
||||||
|
; Tray offset defined as pixel value (e.g. 35) or percentage (e.g. 50%)
|
||||||
|
tray-offset-x = 0
|
||||||
|
tray-offset-y = 0
|
||||||
|
|
||||||
|
; Pad the sides of each tray icon
|
||||||
|
tray-padding = 0
|
||||||
|
|
||||||
|
; Scale factor for tray clients
|
||||||
|
tray-scale = 1.0
|
||||||
|
|
||||||
|
; Restack the bar window and put it above the
|
||||||
|
; selected window manager's root
|
||||||
|
;
|
||||||
|
; Fixes the issue where the bar is being drawn
|
||||||
|
; on top of fullscreen window's
|
||||||
|
;
|
||||||
|
; Currently supported WM's:
|
||||||
|
; bspwm
|
||||||
|
; i3 (requires: `override-redirect = true`)
|
||||||
|
;;wm-restack =
|
||||||
|
|
||||||
|
; Set a DPI values used when rendering text
|
||||||
|
; This only affects scalable fonts
|
||||||
|
; dpi =
|
||||||
|
|
||||||
|
; Enable support for inter-process messaging
|
||||||
|
; See the Messaging wiki page for more details.
|
||||||
|
;enable-ipc = true
|
||||||
|
|
||||||
|
; Fallback click handlers that will be called if
|
||||||
|
; there's no matching module handler found.
|
||||||
|
click-left =
|
||||||
|
click-middle =
|
||||||
|
click-right =
|
||||||
|
scroll-up =
|
||||||
|
scroll-down =
|
||||||
|
double-click-left =
|
||||||
|
double-click-middle =
|
||||||
|
double-click-right =
|
||||||
|
|
||||||
|
; Requires polybar to be built with xcursor support (xcb-util-cursor)
|
||||||
|
; Possible values are:
|
||||||
|
; - default : The default pointer as before, can also be an empty string (default)
|
||||||
|
; - pointer : Typically in the form of a hand
|
||||||
|
; - ns-resize : Up and down arrows, can be used to indicate scrolling
|
||||||
|
cursor-click =
|
||||||
|
cursor-scroll =
|
||||||
|
|
||||||
|
;; WM Workspace Specific
|
||||||
|
|
||||||
|
; bspwm
|
||||||
|
;;scroll-up = bspwm-desknext
|
||||||
|
;;scroll-down = bspwm-deskprev
|
||||||
|
;;scroll-up = bspc desktop -f prev.local
|
||||||
|
;;scroll-down = bspc desktop -f next.local
|
||||||
|
|
||||||
|
;i3
|
||||||
|
;;scroll-up = i3wm-wsnext
|
||||||
|
;;scroll-down = i3wm-wsprev
|
||||||
|
;;scroll-up = i3-msg workspace next_on_output
|
||||||
|
;;scroll-down = i3-msg workspace prev_on_output
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
|
|
||||||
|
;; Application Settings
|
||||||
|
|
||||||
|
[settings]
|
||||||
|
; The throttle settings lets the eventloop swallow up til X events
|
||||||
|
; if they happen within Y millisecond after first event was received.
|
||||||
|
; This is done to prevent flood of update event.
|
||||||
|
;
|
||||||
|
; For example if 5 modules emit an update event at the same time, we really
|
||||||
|
; just care about the last one. But if we wait too long for events to swallow
|
||||||
|
; the bar would appear sluggish so we continue if timeout
|
||||||
|
; expires or limit is reached.
|
||||||
|
throttle-output = 5
|
||||||
|
throttle-output-for = 10
|
||||||
|
|
||||||
|
; Time in milliseconds that the input handler will wait between processing events
|
||||||
|
;throttle-input-for = 30
|
||||||
|
|
||||||
|
; Reload upon receiving XCB_RANDR_SCREEN_CHANGE_NOTIFY events
|
||||||
|
screenchange-reload = false
|
||||||
|
|
||||||
|
; Compositing operators
|
||||||
|
; @see: https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-operator-t
|
||||||
|
compositing-background = source
|
||||||
|
compositing-foreground = over
|
||||||
|
compositing-overline = over
|
||||||
|
compositing-underline = over
|
||||||
|
compositing-border = over
|
||||||
|
|
||||||
|
; Define fallback values used by all module formats
|
||||||
|
;format-foreground =
|
||||||
|
;format-background =
|
||||||
|
;format-underline =
|
||||||
|
;format-overline =
|
||||||
|
;format-spacing =
|
||||||
|
;format-padding =
|
||||||
|
;format-margin =
|
||||||
|
;format-offset =
|
||||||
|
|
||||||
|
; Enables pseudo-transparency for the bar
|
||||||
|
; If set to true the bar can be transparent without a compositor.
|
||||||
|
pseudo-transparency = false
|
||||||
|
|
||||||
|
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
DIR="$HOME/.config/polybar/colorblocks"
|
||||||
|
|
||||||
|
# Terminate already running bar instances
|
||||||
|
killall -q polybar
|
||||||
|
|
||||||
|
# Wait until the processes have been shut down
|
||||||
|
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
|
# Launch the preview bar
|
||||||
|
polybar -q top -c "$DIR"/preview.ini &
|
||||||
|
polybar -q mid -c "$DIR"/preview.ini &
|
||||||
|
polybar -q bottom -c "$DIR"/preview.ini &
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
#
|
||||||
|
# checkupdates: Safely print a list of pending updates.
|
||||||
|
#
|
||||||
|
# Copyright (c) 2013 Kyle Keen <keenerd@gmail.com>
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
declare -r myname='checkupdates'
|
||||||
|
declare -r myver='1.0.0'
|
||||||
|
|
||||||
|
plain() {
|
||||||
|
(( QUIET )) && return
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
|
||||||
|
}
|
||||||
|
|
||||||
|
msg() {
|
||||||
|
(( QUIET )) && return
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
|
||||||
|
}
|
||||||
|
|
||||||
|
msg2() {
|
||||||
|
(( QUIET )) && return
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
|
||||||
|
}
|
||||||
|
|
||||||
|
ask() {
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${BLUE}::${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}" "$@" >&1
|
||||||
|
}
|
||||||
|
|
||||||
|
warning() {
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
error() {
|
||||||
|
local mesg=$1; shift
|
||||||
|
printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if messages are to be printed using color
|
||||||
|
unset ALL_OFF BOLD BLUE GREEN RED YELLOW
|
||||||
|
if [[ -t 2 && ! $USE_COLOR = "n" ]]; then
|
||||||
|
# prefer terminal safe colored and bold text when tput is supported
|
||||||
|
if tput setaf 0 &>/dev/null; then
|
||||||
|
ALL_OFF="$(tput sgr0)"
|
||||||
|
BOLD="$(tput bold)"
|
||||||
|
BLUE="${BOLD}$(tput setaf 4)"
|
||||||
|
GREEN="${BOLD}$(tput setaf 2)"
|
||||||
|
RED="${BOLD}$(tput setaf 1)"
|
||||||
|
YELLOW="${BOLD}$(tput setaf 3)"
|
||||||
|
else
|
||||||
|
ALL_OFF="\e[1;0m"
|
||||||
|
BOLD="\e[1;1m"
|
||||||
|
BLUE="${BOLD}\e[1;34m"
|
||||||
|
GREEN="${BOLD}\e[1;32m"
|
||||||
|
RED="${BOLD}\e[1;31m"
|
||||||
|
YELLOW="${BOLD}\e[1;33m"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
|
||||||
|
|
||||||
|
|
||||||
|
if (( $# > 0 )); then
|
||||||
|
echo "${myname} v${myver}"
|
||||||
|
echo
|
||||||
|
echo "Safely print a list of pending updates"
|
||||||
|
echo
|
||||||
|
echo "Usage: ${myname}"
|
||||||
|
echo
|
||||||
|
echo 'Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary database.'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! type -P fakeroot >/dev/null; then
|
||||||
|
error 'Cannot find the fakeroot binary.'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z $CHECKUPDATES_DB ]]; then
|
||||||
|
CHECKUPDATES_DB="${TMPDIR:-/tmp}/checkup-db-${USER}/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
trap 'rm -f $CHECKUPDATES_DB/db.lck' INT TERM EXIT
|
||||||
|
|
||||||
|
DBPath="$(pacman-conf DBPath)"
|
||||||
|
if [[ -z "$DBPath" ]] || [[ ! -d "$DBPath" ]]; then
|
||||||
|
DBPath="/var/lib/pacman/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$CHECKUPDATES_DB"
|
||||||
|
ln -s "${DBPath}/local" "$CHECKUPDATES_DB" &> /dev/null
|
||||||
|
if ! fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null; then
|
||||||
|
error 'Cannot fetch updates'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]'
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
# vim: set noet:
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SDIR="$HOME/.config/polybar/colorblocks/scripts"
|
||||||
|
|
||||||
|
# Launch Rofi
|
||||||
|
MENU="$(rofi -no-config -no-lazy-grab -sep "|" -dmenu -i -p '' \
|
||||||
|
-theme $SDIR/rofi/styles.rasi \
|
||||||
|
<<< "♥ amber|♥ blue|♥ blue-gray|♥ brown|♥ cyan|♥ deep-orange|\
|
||||||
|
♥ deep-purple|♥ green|♥ gray|♥ indigo|♥ blue-light|♥ green-light|\
|
||||||
|
♥ lime|♥ orange|♥ pink|♥ purple|♥ red|♥ teal|♥ yellow|♥ amber-dark|\
|
||||||
|
♥ blue-dark|♥ blue-gray-dark|♥ brown-dark|♥ cyan-dark|♥ deep-orange-dark|\
|
||||||
|
♥ deep-purple-dark|♥ green-dark|♥ gray-dark|♥ indigo-dark|♥ blue-light-dark|\
|
||||||
|
♥ green-light-dark|♥ lime-dark|♥ orange-dark|♥ pink-dark|♥ purple-dark|♥ red-dark|♥ teal-dark|♥ yellow-dark|")"
|
||||||
|
case "$MENU" in
|
||||||
|
## Light Colors
|
||||||
|
*amber) "$SDIR"/colors-light.sh --amber ;;
|
||||||
|
*blue) "$SDIR"/colors-light.sh --blue ;;
|
||||||
|
*blue-gray) "$SDIR"/colors-light.sh --blue-gray ;;
|
||||||
|
*brown) "$SDIR"/colors-light.sh --brown ;;
|
||||||
|
*cyan) "$SDIR"/colors-light.sh --cyan ;;
|
||||||
|
*deep-orange) "$SDIR"/colors-light.sh --deep-orange ;;
|
||||||
|
*deep-purple) "$SDIR"/colors-light.sh --deep-purple ;;
|
||||||
|
*green) "$SDIR"/colors-light.sh --green ;;
|
||||||
|
*gray) "$SDIR"/colors-light.sh --gray ;;
|
||||||
|
*indigo) "$SDIR"/colors-light.sh --indigo ;;
|
||||||
|
*blue-light) "$SDIR"/colors-light.sh --light-blue ;;
|
||||||
|
*green-light) "$SDIR"/colors-light.sh --light-green ;;
|
||||||
|
*lime) "$SDIR"/colors-light.sh --lime ;;
|
||||||
|
*orange) "$SDIR"/colors-light.sh --orange ;;
|
||||||
|
*pink) "$SDIR"/colors-light.sh --pink ;;
|
||||||
|
*purple) "$SDIR"/colors-light.sh --purple ;;
|
||||||
|
*red) "$SDIR"/colors-light.sh --red ;;
|
||||||
|
*teal) "$SDIR"/colors-light.sh --teal ;;
|
||||||
|
*yellow) "$SDIR"/colors-light.sh --yellow ;;
|
||||||
|
## Dark Colors
|
||||||
|
*amber-dark) "$SDIR"/colors-dark.sh --amber ;;
|
||||||
|
*blue-dark) "$SDIR"/colors-dark.sh --blue ;;
|
||||||
|
*blue-gray-dark) "$SDIR"/colors-dark.sh --blue-gray ;;
|
||||||
|
*brown-dark) "$SDIR"/colors-dark.sh --brown ;;
|
||||||
|
*cyan-dark) "$SDIR"/colors-dark.sh --cyan ;;
|
||||||
|
*deep-orange-dark) "$SDIR"/colors-dark.sh --deep-orange ;;
|
||||||
|
*deep-purple-dark) "$SDIR"/colors-dark.sh --deep-purple ;;
|
||||||
|
*green-dark) "$SDIR"/colors-dark.sh --green ;;
|
||||||
|
*gray-dark) "$SDIR"/colors-dark.sh --gray ;;
|
||||||
|
*indigo-dark) "$SDIR"/colors-dark.sh --indigo ;;
|
||||||
|
*blue-light-dark) "$SDIR"/colors-dark.sh --light-blue ;;
|
||||||
|
*green-light-dark) "$SDIR"/colors-dark.sh --light-green ;;
|
||||||
|
*lime-dark) "$SDIR"/colors-dark.sh --lime ;;
|
||||||
|
*orange-dark) "$SDIR"/colors-dark.sh --orange ;;
|
||||||
|
*pink-dark) "$SDIR"/colors-dark.sh --pink ;;
|
||||||
|
*purple-dark) "$SDIR"/colors-dark.sh --purple ;;
|
||||||
|
*red-dark) "$SDIR"/colors-dark.sh --red ;;
|
||||||
|
*teal-dark) "$SDIR"/colors-dark.sh --teal ;;
|
||||||
|
*yellow-dark) "$SDIR"/colors-dark.sh --yellow
|
||||||
|
esac
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Color files
|
||||||
|
PFILE="$HOME/.config/polybar/colorblocks/colors.ini"
|
||||||
|
RFILE="$HOME/.config/polybar/colorblocks/scripts/rofi/colors.rasi"
|
||||||
|
|
||||||
|
# Change colors
|
||||||
|
change_color() {
|
||||||
|
# polybar
|
||||||
|
sed -i -e 's/background = #.*/background = #141C21/g' $PFILE
|
||||||
|
sed -i -e "s/foreground = #.*/foreground = $FG/g" $PFILE
|
||||||
|
sed -i -e 's/foreground-alt = #.*/foreground-alt = #FFFFFF/g' $PFILE
|
||||||
|
sed -i -e "s/shade1 = #.*/shade1 = $SH1/g" $PFILE
|
||||||
|
sed -i -e "s/shade2 = #.*/shade2 = $SH2/g" $PFILE
|
||||||
|
sed -i -e "s/shade3 = #.*/shade3 = $SH3/g" $PFILE
|
||||||
|
sed -i -e "s/shade4 = #.*/shade4 = $SH4/g" $PFILE
|
||||||
|
sed -i -e "s/shade5 = #.*/shade5 = $SH5/g" $PFILE
|
||||||
|
sed -i -e "s/shade6 = #.*/shade6 = $SH6/g" $PFILE
|
||||||
|
sed -i -e "s/shade7 = #.*/shade7 = $SH7/g" $PFILE
|
||||||
|
sed -i -e "s/shade8 = #.*/shade8 = $SH8/g" $PFILE
|
||||||
|
|
||||||
|
# rofi
|
||||||
|
cat > $RFILE <<- EOF
|
||||||
|
/* colors */
|
||||||
|
|
||||||
|
* {
|
||||||
|
al: #00000000;
|
||||||
|
bg: #141C21FF;
|
||||||
|
bg1: ${SH8}FF;
|
||||||
|
bg2: ${SH7}FF;
|
||||||
|
bg3: ${SH6}FF;
|
||||||
|
fg: #FFFFFFFF;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
polybar-msg cmd restart
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $1 = "--amber" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#FF6F00" SH2="#FF8F00" SH3="#FFA000" SH4="#FFB300"
|
||||||
|
SH5="#FFC107" SH6="#FFCA28" SH7="#FFD54F" SH8="#FFE082"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--blue" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#0D47A1" SH2="#1565C0" SH3="#1976D2" SH4="#1E88E5"
|
||||||
|
SH5="#2196F3" SH6="#42A5F5" SH7="#64B5F6" SH8="#90CAF9"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--blue-gray" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#263238" SH2="#37474F" SH3="#455A64" SH4="#546E7A"
|
||||||
|
SH5="#607D8B" SH6="#78909C" SH7="#90A4AE" SH8="#B0BEC5"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--brown" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#3E2723" SH2="#4E342E" SH3="#5D4037" SH4="#6D4C41"
|
||||||
|
SH5="#795548" SH6="#8D6E63" SH7="#A1887F" SH8="#BCAAA4"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--cyan" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#006064" SH2="#00838F" SH3="#0097A7" SH4="#00ACC1"
|
||||||
|
SH5="#00BCD4" SH6="#26C6DA" SH7="#4DD0E1" SH8="#80DEEA"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--deep-orange" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#BF360C" SH2="#D84315" SH3="#E64A19" SH4="#F4511E"
|
||||||
|
SH5="#FF5722" SH6="#FF7043" SH7="#FF8A65" SH8="#FFAB91"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--deep-purple" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#311B92" SH2="#4527A0" SH3="#512DA8" SH4="#5E35B1"
|
||||||
|
SH5="#673AB7" SH6="#7E57C2" SH7="#9575CD" SH8="#B39DDB"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--green" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#1B5E20" SH2="#2E7D32" SH3="#388E3C" SH4="#43A047"
|
||||||
|
SH5="#4CAF50" SH6="#66BB6A" SH7="#81C784" SH8="#A5D6A7"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--gray" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#212121" SH2="#424242" SH3="#616161" SH4="#757575"
|
||||||
|
SH5="#9E9E9E" SH6="#BDBDBD" SH7="#D4D4D4" SH8="#EEEEEE"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--indigo" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#1A237E" SH2="#283593" SH3="#303F9F" SH4="#3949AB"
|
||||||
|
SH5="#3F51B5" SH6="#5C6BC0" SH7="#7986CB" SH8="#9FA8DA"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--light-blue" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#01579B" SH2="#0277BD" SH3="#0288D1" SH4="#039BE5"
|
||||||
|
SH5="#03A9F4" SH6="#29B6F6" SH7="#4FC3F7" SH8="#81D4FA"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--light-green" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#33691E" SH2="#558B2F" SH3="#689F38" SH4="#7CB342"
|
||||||
|
SH5="#8BC34A" SH6="#9CCC65" SH7="#AED581" SH8="#C5E1A5"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--lime" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#827717" SH2="#9E9D24" SH3="#AFB42B" SH4="#C0CA33"
|
||||||
|
SH5="#CDDC39" SH6="#D4E157" SH7="#DCE775" SH8="#E6EE9C"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--orange" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#E65100" SH2="#EF6C00" SH3="#F57C00" SH4="#FB8C00"
|
||||||
|
SH5="#FF9800" SH6="#FFA726" SH7="#FFB74D" SH8="#FFCC80"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--pink" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#880E4F" SH2="#AD1457" SH3="#C2185B" SH4="#D81B60"
|
||||||
|
SH5="#E91E63" SH6="#EC407A" SH7="#F06292" SH8="#F48FB1"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--purple" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#4A148C" SH2="#6A1B9A" SH3="#7B1FA2" SH4="#8E24AA"
|
||||||
|
SH5="#9C27B0" SH6="#AB47BC" SH7="#BA68C8" SH8="#CE93D8"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--red" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#B71C1C" SH2="#C62828" SH3="#D32F2F" SH4="#E53935"
|
||||||
|
SH5="#EE413D" SH6="#EF5350" SH7="#E57373" SH8="#EF9A9A"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--teal" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#004D40" SH2="#00695C" SH3="#00796B" SH4="#00897B"
|
||||||
|
SH5="#009688" SH6="#26A69A" SH7="#4DB6AC" SH8="#80CBC4"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--yellow" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#F57F17" SH2="#F9A825" SH3="#FBC02D" SH4="#FDD835"
|
||||||
|
SH5="#FFEB3B" SH6="#FFEE58" SH7="#FFF176" SH8="#FFF59D"
|
||||||
|
change_color
|
||||||
|
else
|
||||||
|
cat <<- _EOF_
|
||||||
|
No option specified, Available options:
|
||||||
|
--amber --blue --blue-gray --brown
|
||||||
|
--cyan --deep-orange --deep-purple --green
|
||||||
|
--gray --indigo --light-blue --light-green
|
||||||
|
--lime --orange --pink --purple
|
||||||
|
--red --teal --yellow
|
||||||
|
_EOF_
|
||||||
|
fi
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Color files
|
||||||
|
PFILE="$HOME/.config/polybar/colorblocks/colors.ini"
|
||||||
|
RFILE="$HOME/.config/polybar/colorblocks/scripts/rofi/colors.rasi"
|
||||||
|
|
||||||
|
# Change colors
|
||||||
|
change_color() {
|
||||||
|
# polybar
|
||||||
|
sed -i -e 's/background = #.*/background = #FFFFFF/g' $PFILE
|
||||||
|
sed -i -e "s/foreground = #.*/foreground = $FG/g" $PFILE
|
||||||
|
sed -i -e 's/foreground-alt = #.*/foreground-alt = #141C21/g' $PFILE
|
||||||
|
sed -i -e "s/shade1 = #.*/shade1 = $SH1/g" $PFILE
|
||||||
|
sed -i -e "s/shade2 = #.*/shade2 = $SH2/g" $PFILE
|
||||||
|
sed -i -e "s/shade3 = #.*/shade3 = $SH3/g" $PFILE
|
||||||
|
sed -i -e "s/shade4 = #.*/shade4 = $SH4/g" $PFILE
|
||||||
|
sed -i -e "s/shade5 = #.*/shade5 = $SH5/g" $PFILE
|
||||||
|
sed -i -e "s/shade6 = #.*/shade6 = $SH6/g" $PFILE
|
||||||
|
sed -i -e "s/shade7 = #.*/shade7 = $SH7/g" $PFILE
|
||||||
|
sed -i -e "s/shade8 = #.*/shade8 = $SH8/g" $PFILE
|
||||||
|
|
||||||
|
# rofi
|
||||||
|
cat > $RFILE <<- EOF
|
||||||
|
/* colors */
|
||||||
|
|
||||||
|
* {
|
||||||
|
al: #00000000;
|
||||||
|
bg: #FFFFFFFF;
|
||||||
|
bg1: ${SH5}FF;
|
||||||
|
bg2: ${SH4}FF;
|
||||||
|
bg3: ${SH3}FF;
|
||||||
|
fg: #141C21FF;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
polybar-msg cmd restart
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $1 = "--amber" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#FF6F00" SH2="#FF8F00" SH3="#FFA000" SH4="#FFB300"
|
||||||
|
SH5="#FFC107" SH6="#FFCA28" SH7="#FFD54F" SH8="#FFE082"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--blue" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#0D47A1" SH2="#1565C0" SH3="#1976D2" SH4="#1E88E5"
|
||||||
|
SH5="#2196F3" SH6="#42A5F5" SH7="#64B5F6" SH8="#90CAF9"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--blue-gray" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#263238" SH2="#37474F" SH3="#455A64" SH4="#546E7A"
|
||||||
|
SH5="#607D8B" SH6="#78909C" SH7="#90A4AE" SH8="#B0BEC5"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--brown" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#3E2723" SH2="#4E342E" SH3="#5D4037" SH4="#6D4C41"
|
||||||
|
SH5="#795548" SH6="#8D6E63" SH7="#A1887F" SH8="#BCAAA4"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--cyan" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#006064" SH2="#00838F" SH3="#0097A7" SH4="#00ACC1"
|
||||||
|
SH5="#00BCD4" SH6="#26C6DA" SH7="#4DD0E1" SH8="#80DEEA"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--deep-orange" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#BF360C" SH2="#D84315" SH3="#E64A19" SH4="#F4511E"
|
||||||
|
SH5="#FF5722" SH6="#FF7043" SH7="#FF8A65" SH8="#FFAB91"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--deep-purple" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#311B92" SH2="#4527A0" SH3="#512DA8" SH4="#5E35B1"
|
||||||
|
SH5="#673AB7" SH6="#7E57C2" SH7="#9575CD" SH8="#B39DDB"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--green" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#1B5E20" SH2="#2E7D32" SH3="#388E3C" SH4="#43A047"
|
||||||
|
SH5="#4CAF50" SH6="#66BB6A" SH7="#81C784" SH8="#A5D6A7"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--gray" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#212121" SH2="#424242" SH3="#616161" SH4="#757575"
|
||||||
|
SH5="#9E9E9E" SH6="#BDBDBD" SH7="#D4D4D4" SH8="#EEEEEE"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--indigo" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#1A237E" SH2="#283593" SH3="#303F9F" SH4="#3949AB"
|
||||||
|
SH5="#3F51B5" SH6="#5C6BC0" SH7="#7986CB" SH8="#9FA8DA"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--light-blue" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#01579B" SH2="#0277BD" SH3="#0288D1" SH4="#039BE5"
|
||||||
|
SH5="#03A9F4" SH6="#29B6F6" SH7="#4FC3F7" SH8="#81D4FA"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--light-green" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#33691E" SH2="#558B2F" SH3="#689F38" SH4="#7CB342"
|
||||||
|
SH5="#8BC34A" SH6="#9CCC65" SH7="#AED581" SH8="#C5E1A5"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--lime" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#827717" SH2="#9E9D24" SH3="#AFB42B" SH4="#C0CA33"
|
||||||
|
SH5="#CDDC39" SH6="#D4E157" SH7="#DCE775" SH8="#E6EE9C"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--orange" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#E65100" SH2="#EF6C00" SH3="#F57C00" SH4="#FB8C00"
|
||||||
|
SH5="#FF9800" SH6="#FFA726" SH7="#FFB74D" SH8="#FFCC80"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--pink" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#880E4F" SH2="#AD1457" SH3="#C2185B" SH4="#D81B60"
|
||||||
|
SH5="#E91E63" SH6="#EC407A" SH7="#F06292" SH8="#F48FB1"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--purple" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#4A148C" SH2="#6A1B9A" SH3="#7B1FA2" SH4="#8E24AA"
|
||||||
|
SH5="#9C27B0" SH6="#AB47BC" SH7="#BA68C8" SH8="#CE93D8"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--red" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#B71C1C" SH2="#C62828" SH3="#D32F2F" SH4="#E53935"
|
||||||
|
SH5="#EE413D" SH6="#EF5350" SH7="#E57373" SH8="#EF9A9A"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--teal" ]]; then
|
||||||
|
FG="#F5F5F5"
|
||||||
|
SH1="#004D40" SH2="#00695C" SH3="#00796B" SH4="#00897B"
|
||||||
|
SH5="#009688" SH6="#26A69A" SH7="#4DB6AC" SH8="#80CBC4"
|
||||||
|
change_color
|
||||||
|
elif [[ $1 = "--yellow" ]]; then
|
||||||
|
FG="#141C21"
|
||||||
|
SH1="#F57F17" SH2="#F9A825" SH3="#FBC02D" SH4="#FDD835"
|
||||||
|
SH5="#FFEB3B" SH6="#FFEE58" SH7="#FFF176" SH8="#FFF59D"
|
||||||
|
change_color
|
||||||
|
else
|
||||||
|
cat <<- _EOF_
|
||||||
|
No option specified, Available options:
|
||||||
|
--amber --blue --blue-gray --brown
|
||||||
|
--cyan --deep-orange --deep-purple --green
|
||||||
|
--gray --indigo --light-blue --light-green
|
||||||
|
--lime --orange --pink --purple
|
||||||
|
--red --teal --yellow
|
||||||
|
_EOF_
|
||||||
|
fi
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
rofi -no-config -no-lazy-grab -show drun -modi drun -theme ~/.config/polybar/colorblocks/scripts/rofi/launcher.rasi
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user