Compare commits

...

443 commits
v2 ... main

Author SHA1 Message Date
2113835e41
Add more upload aliases 2025-04-09 23:12:07 +02:00
ee6f059647
Add quick pr checkout alias 2025-04-09 23:11:52 +02:00
ddbfc640fa
Fix gh-notify systemd timer 2025-03-11 20:07:12 +01:00
07d85ad240
Update hyprlock config 2025-02-25 10:04:32 +01:00
ee9469230f
Use systemd in toggle-idle 2025-02-25 00:19:56 +01:00
fcf1762b1c
Fix UWSM app launching 2025-02-25 00:07:59 +01:00
409723adf6
Mention binding to quit keybind isolation in notif 2025-02-24 23:29:17 +01:00
c51ae232c6
Run keybind apps through uwsm app 2025-02-24 23:28:39 +01:00
bcff64f0fc
Make hyprland-monitord start eww windows with systemd 2025-02-24 23:19:32 +01:00
fbc693674d
Adjust systemd services to work better with UWSM 2025-02-24 23:19:01 +01:00
1abeb1e9ab
Add omnisharp home XDG envvar 2025-02-24 22:49:48 +01:00
d68284ed85
Use bash compliant syntax for extending PATH 2025-02-24 22:49:19 +01:00
35dceab233
Fix hypridle config typo 2025-02-24 22:44:57 +01:00
3993fb896d
Move to UWSM 2025-02-24 22:27:49 +01:00
510d01ef47
Fix toggle-fake-fullscreen 2025-02-03 18:32:58 +01:00
1a345713b3
Fix mpv zooming 2025-02-03 18:30:14 +01:00
c0e871af58
Update monitor setup 2025-02-03 18:29:47 +01:00
b93efba0fd
Auto-install nvtop from install gui script 2024-12-29 00:49:13 +01:00
f6f292306e
Add low battery notification reminder 2024-12-24 23:18:29 +01:00
6c5c3fb36c
Use extra/swappy rather than aur/swappy-git 2024-12-24 14:32:40 +01:00
db58721f45
Format hyprland-screenshot script 2024-12-24 14:32:18 +01:00
f871b7b427
Add a default (template) commit-msg git hook 2024-12-22 17:51:46 +01:00
9e946c7611
hyprlock: add disabled fingerprint reader support 2024-12-22 05:12:56 +01:00
6fc5d3a03d
hypridle: fix typo - remove semicolon 2024-12-22 05:10:11 +01:00
9931adaec5
hypridle: Dim the screen & keyboard backlight 2024-12-22 05:09:44 +01:00
4b37fb8fb3
Rewrite the hyprlock (systemd-lock-handler) service 2024-12-22 04:37:44 +01:00
ffd352074f
Inhibit swaync when session is locked 2024-12-22 04:14:41 +01:00
c8d1e94c0f
Move to swaync (from dunst) 2024-12-22 02:33:14 +01:00
df82f47ccb
Set numlock & capslock colors 2024-12-22 01:12:09 +01:00
e11b3c9dd7
hyprlock: specify the check & fail colors as hex 2024-12-22 01:11:53 +01:00
a3a0000c4a
Add delay before starting vesktop 2024-12-22 01:08:01 +01:00
5a0132296b
hyprlock: don't use a negative rgb value, lol 2024-12-21 03:52:48 +01:00
339e17716c
hyprlock: Use ints for shadow size, not floats 2024-12-21 03:47:51 +01:00
c4928b163a
Fix outer color circle for hyprlock 0.6.0 2024-12-21 03:09:20 +01:00
9b3c5b20aa
Update dunstrc (new version changes the height setting) 2024-12-14 02:29:29 +01:00
dacb4ac34c
Use uv instead of rye 2024-12-14 02:28:47 +01:00
31ab2cdb8e
Auto-install xdg desktop portal gtk 2024-12-09 18:12:25 +01:00
75cc7d5102
Add OCR keybind 2024-12-09 18:11:39 +01:00
63873fcccf
Update git reauthor-all alias (retain commit dates) 2024-11-19 20:24:49 +01:00
8fcf3646fe
Update hyprland settings to latest syntax 2024-11-13 23:15:09 +01:00
867ba642c6
Add support for init script to hyprland-monitord 2024-10-13 23:36:00 +02:00
d9c71e2310
Make docker use btrfs 2024-10-13 23:17:13 +02:00
b9aaebc10c
Add another qualculate shortcut 2024-10-13 22:00:36 +02:00
e90cada897
Make hyprland-move-window script executable 2024-10-13 21:59:31 +02:00
b0ca57ac4a
Add custom service to watch monitor updates 2024-10-13 21:59:18 +02:00
d2f808f469
Add arch-audit 2024-10-04 14:04:12 +02:00
254181c0fc
Major rewrite: switching back to Arch from NixOS 2024-10-02 14:48:26 +02:00
df585b737b
Add archival notice 2024-06-28 00:47:10 +02:00
11ef5e8a1c
Fix eww workspaces script crashing occasionally 2024-04-09 09:18:13 +02:00
03608c5b1c
Add vesktop rename rule 2024-03-22 16:39:01 +01:00
934579abf0
Add rose-pine hyprcursor theme 2024-03-14 01:32:46 +01:00
98b3c35444
Add locscreen screenshot keybind 2024-03-14 01:06:24 +01:00
3c29dab3c5
Pause notifications before sleep & unpause on unlock 2024-03-14 01:05:09 +01:00
e8136e9666
Show fail msg & attempt amount with labels 2024-03-14 01:03:05 +01:00
7a63d4df6f
use smaller font size for hypridle notification 2024-03-14 00:38:53 +01:00
973bd59b59
Update hyprlock config 2024-03-14 00:37:40 +01:00
b15a43697f
Replace discord with vesktop 2024-03-13 11:04:37 +01:00
60f77b7707
Add jetbrain fixes window rules 2024-03-11 02:54:15 +01:00
2320760c85
Remove touchpad and trackpoint settings 2024-03-11 02:54:02 +01:00
8a86b41b19
Add commented left option for ext monitor 2024-03-11 02:53:35 +01:00
ff22d1e9d5
Escape comments in sourced files 2024-03-11 02:52:15 +01:00
0ee56ce533
Enable stdout hyprland logs 2024-03-11 02:49:38 +01:00
3325992ce4
Add microsoft teams as 'msteams' scheme handler 2024-03-11 02:20:11 +01:00
7049bab02f
Open SVGs with nomacs by default 2024-03-11 02:18:55 +01:00
42d4a02eb4
Fix typos 2024-03-11 02:18:24 +01:00
e621adedf3
Enable hyprlock service & remove old swaylock one 2024-03-10 13:42:33 +01:00
7d28f984a5
Update hyprlock config 2024-03-10 13:41:32 +01:00
fd5c9ed762
Update hypridle 2024-03-10 04:43:30 +01:00
118cd7f676
Migrate swaylock to hyprlock 2024-03-10 04:42:08 +01:00
9bb205b74d
Re-add systemd-lock-handler to install script 2024-03-10 04:14:43 +01:00
6404099438
Add gvfs-mtp for android files 2024-03-10 04:13:35 +01:00
545fd01ae4
Add hyprlang and hyprcursor install deps 2024-03-10 04:13:19 +01:00
da1b1f1c76
Remove dwindle-autogroup building (there's hyprpm) 2024-03-10 03:59:52 +01:00
9bf79edda2
Update hypridle settings 2024-03-05 11:17:01 +01:00
bd7f0b78a6
Move back to systemd-lock-handler 2024-03-05 11:16:53 +01:00
a5191afbf9
Add github-cli pkg 2024-02-21 23:54:36 +01:00
6527de32b5
Fix hypridle systemd logs 2024-02-19 02:12:56 +01:00
c2564684da
Update toggle-idle to use hypridle 2024-02-19 01:56:00 +01:00
59c3b49d33
Use official treesitter pkg ft=hyprlang (not ft=hypr) 2024-02-19 01:29:39 +01:00
ae02222df1
Migrate from swayidle to hypridle 2024-02-19 01:19:52 +01:00
a1f9a7c82d
Fix dot-put script 2024-02-18 20:32:00 +01:00
0d3c5f1db4
Update hyprland config for latest update (hyprlang) 2024-02-18 20:31:15 +01:00
eba5d3fdbc
Update alacritty config (auto-formatting) 2024-02-17 23:12:13 +01:00
b29dfb9af6
Rewrite dot-put script 2024-02-17 23:11:38 +01:00
05e61f18a1
Update plugin config 2024-02-17 23:11:22 +01:00
2d77f7d95c
Add wh=which alias 2024-02-17 23:11:01 +01:00
9bade74f02
Remove devour aliases 2024-02-17 23:10:55 +01:00
e33d386521
Update window rules 2024-02-17 22:54:47 +01:00
f769f85293
Update btop config (new version) 2024-02-17 22:54:14 +01:00
d0c25b5901
Update keybinds 2024-02-17 22:53:22 +01:00
6ff912d3b8
Split hyprland config even more 2024-02-17 22:53:00 +01:00
0e0dd92bb9
Add git tracked-text-files alias 2024-02-17 22:52:25 +01:00
82ab38ae7f
Add dot-put script 2024-02-17 22:50:24 +01:00
3c1362f7c9
Add cpu-power alias 2024-02-17 22:45:52 +01:00
0f78f4e61e
Install zoxide from install_root.sh 2024-02-17 22:45:42 +01:00
292778fa9c
Add hyfetch 2024-02-17 22:45:22 +01:00
cbb7fa714b
Migrate from z.lua to zoxide 2024-02-16 17:30:04 +01:00
ebe36051d5
Add pythonrc for xdg history file 2024-02-05 23:25:31 +01:00
ecac51aadb
Add hibernate option to menuquit 2024-02-05 23:24:42 +01:00
2f9a4044ba
Also copy npm config 2024-02-05 23:24:30 +01:00
46de81f52b
Add hibernation guide 2024-02-05 23:24:15 +01:00
578559f8d2
Also mention systemd-cryptsetup-generator 2024-02-01 14:13:08 +01:00
461839260d
Link to wiki for systemd-gpt-auto-generator 2024-02-01 13:52:45 +01:00
2a57a33762
Update fstab, include btrfs root mountpoint 2024-01-27 11:16:33 +01:00
a473ed5cb3
Rewrite btrfs-backup script 2024-01-27 04:27:12 +01:00
f77786d892
Add system (ana)cron tab files 2024-01-26 00:33:02 +01:00
d7bf3a044d
Add btrfs backup/snapshot script 2024-01-26 00:32:51 +01:00
dc4d6fd43f
Install ipython & upgrade pip on all pyenv vers 2023-12-31 13:11:51 +01:00
fe1fe28219
Automatically import my gpg key 2023-12-31 13:05:51 +01:00
d199e7ab58
Make sure to load env vars for proper XDG locations 2023-12-31 12:49:27 +01:00
97459fc7e8
Don't install nodejs-lts-gallium (no longer needed) 2023-12-31 12:44:40 +01:00
29583e07b7
Allow AC adapter naming in battery script 2023-12-31 12:44:08 +01:00
40094c9628
Fix typo 2023-12-31 05:00:19 +01:00
56c1821716
Fix typo 2023-12-31 04:55:27 +01:00
e3d9c46c61
Addres major security concern with TPM 2023-12-31 04:52:34 +01:00
beb5e2ba30
Add secure boot with TPM guide 2023-12-30 21:13:19 +01:00
770e9f46c1
Update installation guide 2023-12-30 21:13:10 +01:00
9538d5c1b1
Upate gui install scripts 2023-12-29 15:11:58 +01:00
f16a5c999a
Update installation scripts and guide 2023-12-29 15:07:57 +01:00
2fec62fdd3
Update install_user script 2023-12-29 13:55:03 +01:00
1cb455fba7
Update installation guide,script,hosts file 2023-12-29 13:49:55 +01:00
74b3df693c
Fix stremio window rule 2023-12-10 02:22:37 +01:00
f20cbc479e
Split hyprland plugin config to it's own file 2023-12-10 02:22:19 +01:00
3233c322b6
Make yay auto-track dev dependencies 2023-11-19 00:13:09 +01:00
1a3327a37c
Update incremental backup script 2023-11-19 00:12:13 +01:00
77a8cced84
Update pythonrc 2023-10-10 21:32:38 +02:00
18252755b8
Override the comment color in zsh syntax highlighting 2023-10-10 21:29:53 +02:00
525c6ee5a8
Update kitty config 2023-10-10 21:27:47 +02:00
29159b9fb3
Add loog (long log) git alias 2023-10-10 21:27:38 +02:00
2ac4840117
Enable battery module in eww 2023-10-10 21:27:19 +02:00
4e7a291bd9
Delete waybar configuration 2023-10-10 20:58:04 +02:00
8621bdaae1
Don't use check=True for git diff (ends with code 1) 2023-10-10 20:56:02 +02:00
f1531c7274
Don't show tpm tmux plugin repo content in sync 2023-10-10 20:53:47 +02:00
296a5b86cf
Don't show .zgenom files in diff 2023-10-10 20:52:35 +02:00
cf2ac68b64
Remove old lunarvim confiuration 2023-10-10 20:50:04 +02:00
cc54b67635
Satisfy pyright checker on sync.py 2023-10-10 20:45:48 +02:00
c900d14516
Run ruff linter on sync.py script 2023-10-10 20:43:50 +02:00
55a70492a2
Show diff as systemfile replacing dotfile 2023-10-10 20:39:00 +02:00
6aeff61f59
Update aliases 2023-10-10 20:36:09 +02:00
08929b8360
Update fontconfig (Caskaydia fonts are now TTF) 2023-10-10 20:35:35 +02:00
0806557d5d
Update launch-hypr exports for nvidia 2023-10-10 20:34:56 +02:00
9a79a5453b
Add userspace reboot option to menuquit 2023-10-10 20:32:55 +02:00
6e31a94da3
Add vim filetype override comments 2023-10-10 20:22:13 +02:00
24d34c0d11
Add keybindings for optional manual tiling 2023-10-10 20:21:11 +02:00
0291bccf22
Use layoutmsg for togglesplit dispatcher 2023-10-10 20:20:40 +02:00
4049a59628
Rewrite various parts of hyprland configuration 2023-10-10 20:20:25 +02:00
2bf70e652a
Add dwindle-autogroup plugin 2023-10-09 19:28:26 +02:00
200cffd629
Auto-float some tor browser windows 2023-10-09 19:27:58 +02:00
4bef2362d4
Auto-float firefox Opening dialogs 2023-10-09 19:27:40 +02:00
91ae4cb3b7
Fix stremio 2023-10-09 19:27:20 +02:00
b15574ce25
Add keybind isolation group 2023-10-09 19:27:05 +02:00
ee3dc5a256
Change video keybind 2023-10-09 19:26:56 +02:00
0bcfd32b78
Remove trailing space 2023-08-04 11:46:15 +02:00
212fd0d82f
Move to updated settings for v0.28.0 2023-08-04 11:46:01 +02:00
90ede066a4
Remove existing zsh config if present 2023-08-02 22:07:58 +02:00
8b00572567
Auto-install astronvim dependencies 2023-08-02 16:01:34 +02:00
8d8b05d0f6
Fix typo 2023-08-02 14:46:23 +02:00
79fe6bf657
Don't needlessly sync & update 2023-08-02 14:42:56 +02:00
3b5ac91ae8
Only add ~/.local/bin to PATH if it exists
Without existence check, the `find` command prints a fail message to
stderr, and leaves stdout empty. This means only the prefix `:` is
appended to the `$PATH` variable.

Leaving a trailing `:` in `$PATH` is however something we really don't
want to be doing, as it makes the current directory get treated as a
part of `$PATH`.

While the `~/.local/bin` directory is generally going to exist, during
installation and in some other edge cases, it might not yet be there,
and we need to account for that.
2023-08-02 14:13:44 +02:00
62912b75ba
Follow symlnks when adding ~/.local/bin dirs to PATH 2023-08-02 11:02:18 +02:00
2da877dfba
Add glow package (CLI markdown renderer) 2023-08-02 02:31:46 +02:00
fc45c3eb7a
Export ZOOTDIR from /etc/zsh/zshenv 2023-08-02 02:29:54 +02:00
c4053d8496
Use the git version of xdg-ninja 2023-08-02 02:24:15 +02:00
ccd5f28999
export XDG_STATE_HOME 2023-08-02 01:53:00 +02:00
f0ce0a249d
Move .pki to data home (.local/share), not config 2023-08-02 01:49:08 +02:00
3cc7ee31a8
Auto-install xdg-ninja 2023-08-02 01:46:55 +02:00
fdc5d6108f
Set npm specific XDG base dir vars 2023-08-02 01:46:28 +02:00
be2013e4d4
Set XDG vars for python 2023-08-02 01:45:32 +02:00
08973fb001 Copy the ~/.mozilla symlink 2023-08-01 17:06:55 +02:00
2391f389ca Fix typos 2023-08-01 16:49:29 +02:00
65f675cfdd Fix typo 2023-08-01 15:16:05 +02:00
722649b3a4 Also copy the dunst and eww configurations 2023-08-01 14:39:55 +02:00
f29837c598 Remove xdg-desktop-portal-gnome if installed 2023-08-01 14:34:41 +02:00
a56a2a4daa Fix typo (railsmark -> ralismark github username) 2023-08-01 14:24:04 +02:00
e2ae926dbc Add tood on potential git pull 2023-08-01 14:19:35 +02:00
c247c0fbab Don't fail if hyprland-dwindlw-autogroup exists 2023-08-01 14:19:20 +02:00
6a803b051a Fix typo (don't run yay as root) 2023-08-01 14:16:23 +02:00
6273223007 Fix typo (wrong cd directory) 2023-08-01 14:14:46 +02:00
16546e3f34 Fix typo (| instead of || to ignore failures) 2023-08-01 14:13:26 +02:00
ba4e46bdb3 Fix typo 2023-08-01 14:10:09 +02:00
35dcf5ffa0 Use echo "y" instead of yes to avoid SIGPIPE
When using the `yes` command and piping it's output to pacman, it will
confirm the y/n question, however it will then keep running after pacman
ends, as it didn't sent an EOF back. Once that happens, as yes will try
to write more output after pacman process ended, the pipeline breaks,
making the process receive a `SIGPIPE` signal, which causes `yes` to
end.

This would normally be fine, however since we're using `set -euo
pipefail`, this signal causes the whole script to end with code 141. To
avoid this, as we know only a single confirmation will be needed here,
we use echo instead of yes, only supplying one "y" to pacman.
2023-08-01 14:03:13 +02:00
6d327a133b Override nodejs with nodejs-lts-gallium without user interaction 2023-08-01 13:45:33 +02:00
fab6bdce66 Remove dooit-git 2023-08-01 13:35:58 +02:00
32ed1b9a7d Don't end the script if the repos were already cloned 2023-08-01 13:35:16 +02:00
4c19890318 Checkout latest stable release of hyprland 2023-08-01 13:33:24 +02:00
7801977c2e Also install dwindle-autogroup hyprland plugin 2023-08-01 13:21:37 +02:00
065c6cee0c Also copy hyprland settings 2023-08-01 13:21:14 +02:00
4091125515 Install pyenv python versions in user install script 2023-08-01 13:20:29 +02:00
5bf0cd7267 Always sync and update before installing 2023-08-01 13:20:05 +02:00
9e242c5f47 Don't needlessly reinstall pkgs in install scripts 2023-08-01 13:18:55 +02:00
5f3d1fde5d Add GUI installation script 2023-08-01 12:06:53 +02:00
ac390b1d64 Update user install script 2023-08-01 12:05:16 +02:00
64ad18c6f6 Fix typo in user install script 2023-08-01 10:24:44 +02:00
60f8b7ec79 Add some footnotes to installation guide 2023-08-01 02:03:51 +02:00
47429dddee Add full arch installation guide 2023-08-01 01:54:02 +02:00
b83e5b55a1 Use su -l on first login, for env vars like HOME 2023-07-31 22:23:06 +02:00
c615c1368b Add user installation script 2023-07-31 22:17:54 +02:00
4488a65de5 Cd back to original dir after install_root.sh ends 2023-07-31 22:09:39 +02:00
22d15d2093 Add quick run instructions 2023-07-31 22:04:51 +02:00
03b4e74694 Rename install.sh to root_install.sh 2023-07-31 22:04:24 +02:00
6ec7231174 Run pacman with --noconfirm for zsh install 2023-07-31 21:59:08 +02:00
291ebd4f63 Add pkgfile 2023-07-31 21:58:52 +02:00
a48d3a5502 Allow ~/.config already existing 2023-07-31 21:56:22 +02:00
5f3e02b29c Sync pacman repos after updating /etc/pacman.conf 2023-07-31 21:55:39 +02:00
983d95c2a6 Make the install script executable 2023-07-31 21:53:59 +02:00
52aabcdfb6 Add simple install script 2023-07-31 21:53:14 +02:00
f21ddf9f5a Add comments to sysctl overrides 2023-07-31 21:47:22 +02:00
dbd7e017d3
Use DE instead of WM (hyprland shows with DE) 2023-07-23 02:00:54 +02:00
9072761185
Add neofetch settings 2023-07-23 01:55:45 +02:00
97fa55a935
Add kitty terminal settings 2023-07-23 00:27:31 +02:00
0025d52ab9
Add npm binaries to path 2023-07-23 00:14:23 +02:00
47af19d900
Add git commit ammend alias 2023-07-23 00:13:19 +02:00
946589562d
Update comments in env vars definitions 2023-07-23 00:12:55 +02:00
b42498ea5d
Add gpg cofiguration 2023-07-23 00:07:46 +02:00
36553763a1
Stop wayland-session, not wm-ready 2023-07-23 00:06:03 +02:00
68b0d96841
Fix toggle-powersave script 2023-07-23 00:05:23 +02:00
427d15e717
Update mimetypes 2023-07-23 00:01:17 +02:00
15075f2009
Update window rules 2023-07-22 23:59:33 +02:00
590b681070
Update keybinds 2023-07-22 23:59:25 +02:00
84afdb1bbf
Split up hyprland config 2023-07-22 23:40:28 +02:00
bbc2294602
Use ctrl+F10 for obs 2023-07-22 23:33:21 +02:00
64af08d11e
Remove postspace 2023-07-22 23:33:08 +02:00
01c03651ce
Change terminal to kitty 2023-07-22 23:32:56 +02:00
e0e03aee0f
Auto-float opensnitch-ui 2023-07-22 23:32:42 +02:00
84bfe7e967
Change group border color 2023-07-22 23:32:22 +02:00
945e7dcce6
Add new monitor variables (hyprland update) 2023-06-26 14:18:34 +02:00
ca1864eb56
use fontawesome bitcoin icon 2023-06-26 14:17:07 +02:00
59768f2935
Move to v3 systray
See: https://github.com/elkowar/eww/pull/743#issuecomment-1602653455
2023-06-26 14:16:27 +02:00
61197fb18e
Define font-size for window name text 2023-06-26 14:16:15 +02:00
36c91ef958
Improve formatting in eww.scss 2023-06-26 14:15:45 +02:00
e848833628
Add styling for menu items (including tray popouts) 2023-06-26 14:14:28 +02:00
eddcb6a825
Add some of yokoffing's ublock filter lists 2023-06-07 20:15:12 +02:00
0565a2e651
Use default nvim, not lvim as editor 2023-05-22 16:41:34 +02:00
4aaa1e1e64
Add linediff alias 2023-05-22 16:41:21 +02:00
9921a7bdc4
Custom dark mode on hacker news 2023-05-21 01:08:55 +02:00
74467ca4c4
Disable click2load (causes too many issues) 2023-05-21 01:08:11 +02:00
1d97d2e918
Re-enable hiding GDPR banner on meteoblue 2023-05-21 01:07:44 +02:00
ccb03eb330
Hide 'experiencing interruptions' youtube popup 2023-05-21 01:05:37 +02:00
fddd312ffb
Add collection of custom uBlock filter lists 2023-05-21 01:03:35 +02:00
27056562d5
Block .zip TLD
Google rcently introduced a new Top Level Domain `.zip`. This has
already been used for malicious purposes, as it resembles file names,
and any existing posts that were talking about say "statement.zip",
might now appear as full links to malicious websites.
2023-05-21 00:59:04 +02:00
acc4abd023
Add directory for ublock 2023-05-21 00:58:45 +02:00
4127f1a7d9
Add sysctl.d folder (kernel settings) 2023-04-28 14:43:07 +02:00
3f5fef59c9
Add tmux configuration 2023-04-27 13:28:05 +02:00
eaf2c5cec0
Remove z.lua git module (installed via zgenom) 2023-04-27 13:27:06 +02:00
3036faee22
Prefer nvim as MANPAGER, if available 2023-04-24 13:09:26 +02:00
8db46cd6bf
Use ffmpegthumbnailer as video thumbnailer 2023-04-23 11:09:39 +02:00
61136611de
Use relative path in latest link 2023-04-16 02:51:01 +02:00
e7f7ac8334
Fix typo in tag name 2023-04-11 21:41:36 +02:00
3cfb4df6af
Add amdgpu_bl1 to brightness sudo exception 2023-04-10 19:51:55 +02:00
259d84b6cd
Blacklist Caskaydia nerd fonts (causes issues)
Caskaydia Nerd Fonts are automatically installed with `nerd-fonts-git`
AUR package, however their presence seems to be causing issues with
Material Symbols font. This then affects the eww bar, making the icons
small.

This is a pretty odd issue, but after some debugging, removing or
blacklisting this font does resolve the issue. It seems that it's some
font priority issue, however the eww bar clearly specifies which font to
use, and the icons are correct, it's just the size that's weird (too
small).

This is just a hacky workaround, but it's probably a permanent one,
unless I figure out what exactly is the cause of this and resolve it
diferently, which I'm probably too lazy to get to.
2023-04-10 15:51:11 +02:00
312e27aa6b
Use zsh in profile 2023-04-10 15:50:01 +02:00
f0f6336b4e
Add fallback to xinit if hyprland isn't installed 2023-04-10 15:49:49 +02:00
b430528874
Remove accidentally pasted rule 2023-04-10 15:48:51 +02:00
eed7a6ad08
Update stremio class in window rule 2023-04-10 15:47:51 +02:00
d2e41de5b5
Float spotify popup hint windows 2023-04-10 15:47:34 +02:00
76b961f4b3
Add window rule for easyeffects 2023-04-10 15:47:06 +02:00
d68ade6f62
Add udev rule to run suspend when battery drops to 2% 2023-03-28 02:55:53 +02:00
5972b65e95
Add power-connected/disconnected systemd targets 2023-03-28 02:47:34 +02:00
bc3a65ba93
Make services specific to wayland use their own sysd target 2023-03-26 13:06:59 +02:00
02b99b30cb
Start gnome-keyring on wm-ready 2023-02-17 11:34:41 +01:00
0e05953a38
Add some more float rules 2023-02-17 11:32:59 +01:00
f1dabb9f19
Wait 1s before starting wm-ready target 2023-02-17 11:32:26 +01:00
63f92dbba7
Use pcman-qt as default app for inode/directory 2023-02-17 11:31:49 +01:00
e6e497b779
Make MPV work properly under wayland 2023-02-17 11:30:49 +01:00
e3dc08d787
Use UP/DOWN for volume control 2023-02-17 11:30:24 +01:00
0e148e6343
Suppress stderr (loading) output from gh-notify 2023-02-17 11:28:13 +01:00
64beef9cb6
Update git aliases 2023-02-17 11:27:01 +01:00
9766350e8d
Update git signing key 2023-02-17 11:26:45 +01:00
921590323f
Add some more configuration aliases 2023-02-17 11:26:23 +01:00
96d3eefb39
Add zsh-completions and zsh-autosuggestions 2023-02-11 18:53:43 +01:00
475d163269
Move zgenom to the bottom (plugins should load last) 2023-02-11 18:53:27 +01:00
bd5ef1bef4
Rework zsh config and use zgenom for plugins 2023-02-09 13:09:37 +01:00
112368f7d1
Use --no-persist option for clipman, to avoid it overriding mime types 2023-02-03 05:46:47 +01:00
e7aa2bb510
Add quick-record script for easy screen capture recordings 2023-02-03 05:46:28 +01:00
88072cac31
Fix time variable in eww 2023-02-02 23:57:42 +01:00
947b3a84c0
Add aliases for rm -r and rm -rf 2023-02-02 23:26:54 +01:00
12b77dfa2f
Don't use trash-put by default for rm 2023-02-02 23:26:45 +01:00
de1fec1b7e
Remove no longer used graphical-session.target 2023-02-02 23:23:17 +01:00
2d8ba074f5
Add RestartSec=3 to eww and wallpaper services 2023-02-02 23:23:03 +01:00
8a33d738af
Convert eww-bar service to an instantiated eww-window service 2023-02-02 23:22:29 +01:00
8dfb109e83
Ensure eww daemon is running with eww ping in eww-bar service 2023-02-02 23:08:21 +01:00
4c7e892acb
Remove backup file 2023-02-02 23:00:37 +01:00
7f2f567807
Add support for partial overwriting 2023-02-02 22:55:45 +01:00
681427ad9a
Use ifconfig.me instead of ifconfig.co for ip obtaining 2023-02-02 22:53:12 +01:00
8767fdf367
Fix some formatting issues 2023-02-02 22:08:41 +01:00
c9d593ef4f
Use a much less repetetive system for applying fixes 2023-02-02 22:04:51 +01:00
7c735df204
Export RANDFILE to follow XDG dirs 2023-02-02 22:04:05 +01:00
6ce522f012
Use match statements instead of if-elif chains 2023-02-02 21:32:53 +01:00
81224d24e7
Move github-notification icon to apps/ subdir 2023-02-02 21:32:38 +01:00
449e912560
Ensure system dir exists for NOTFOUND 2023-02-02 21:12:45 +01:00
bf5734f571
Add clipman clipboard manager 2023-02-02 19:16:36 +01:00
3159fc4909
Center the elements in network panel and decrease size 2023-02-02 18:59:51 +01:00
bec052f159
Remove paccache.timer (pacman-contrib provides it) 2023-02-02 13:38:33 +01:00
245b75837e
Comment out uptime module 2023-02-02 13:33:16 +01:00
e0a7754c2e
Specify default keyring for python 2023-02-02 13:04:48 +01:00
2301eb550f
Comment notify daemons for apparmor and udiskie 2023-02-02 13:03:16 +01:00
bd0b7801a2
Uncomment monitor line 2023-02-02 13:02:27 +01:00
52d9765f68
Fall back to Jost font 2023-02-02 12:59:05 +01:00
390cecf165
Disable 'quiet' option in grub 2023-02-02 12:38:42 +01:00
15bc7ea4a6
Allow discards on crypttab 2023-02-02 12:37:56 +01:00
7e6eeed575
Add reflector settings 2023-02-02 03:35:38 +01:00
0272a69330
Make paccache timer depend on network 2023-02-02 03:32:43 +01:00
2028a65409
Add udev rules for disabling nvidia 2023-02-02 03:32:19 +01:00
0ce57ecb3a
Fix type noveau->nouveau 2023-02-02 03:32:07 +01:00
d4dad7beff
Auto-start bluetooth service on toggle if not running 2023-01-29 23:00:25 +01:00
f76f7c65da
Call get_report before while loop in loop() 2023-01-29 22:49:13 +01:00
d8430aa089
Add radio/connections menu window 2023-01-29 22:49:08 +01:00
d918406072
Handle hyprctl returning invalid json 2023-01-29 18:38:50 +01:00
745e6838ec
Explicitly specfiy direction to pack icons in system tray 2023-01-29 18:38:50 +01:00
0734993789
Move all variable definitions under a single file 2023-01-29 18:38:48 +01:00
d583587360
Use icons from Material font in workspaces 2023-01-29 17:23:23 +01:00
a5e1737cfa
Remove dead code for margin setting 2023-01-29 15:56:08 +01:00
a1749885f3
Add Material Symbols font as fallback font for icons 2023-01-29 15:56:08 +01:00
aa6af14455
Only use font awesome for icons 2023-01-29 15:56:02 +01:00
186d00cd66
Add sans-serif as fallback font for eww 2023-01-29 15:42:09 +01:00
adb438f050
Use battery icons from Material Symbols font 2023-01-29 15:40:24 +01:00
2a4dbd98db
Make system tray a module and add some margin 2023-01-29 15:39:37 +01:00
cb0e365a8f
Mark eww-bar as PartOf eww service, not just After 2023-01-26 22:41:48 +01:00
5154b019cf
Add settings for pcmanfm-qt 2023-01-26 04:09:42 +01:00
67129762a5
Add qt5ct config 2023-01-26 04:06:14 +01:00
254d56c874
Add 10px gaps on both sides of eww bar (smaller min-width) 2023-01-26 01:31:46 +01:00
2d9a741ae0
Add gammarelay controls to eww bar 2023-01-26 01:31:19 +01:00
0be14cd96a
Make sure stopping eww-bar service closes the bar 2023-01-26 01:28:35 +01:00
a9c6b2439b
Remove trailing whitespace 2023-01-26 01:06:45 +01:00
0b7ba9c3cb
Remove shortcut for quick todos 2023-01-26 01:06:02 +01:00
3bd24d6d27
Run gh-notification service after dunst (needs notifs) 2023-01-25 19:07:38 +01:00
d7f171df59
Restart eww any time it ends, not just on failures 2023-01-25 18:55:36 +01:00
0909c9f59b
Start eww bar as service 2023-01-25 18:54:40 +01:00
746e79aa30
Update wallpaper service
Run swaybg directly, since using setbg script runs it detached, and
while it's possible to just set `RemainAfterExit=true`, this makes
things needlessly annoying and confusing.
2023-01-25 18:39:38 +01:00
948bb3be6b
Add icon for gh-notification script notifications 2023-01-25 13:17:22 +01:00
cf68e7a4e2
Increase verbosity for gh-notification service 2023-01-25 13:01:04 +01:00
4d5c96a804
Remove unneeded --no-display arg in gh-notify service (sysd imports DISPLAY) 2023-01-25 13:01:04 +01:00
924ac09370
Show the whole gh-notify output line on -vvv 2023-01-25 13:00:59 +01:00
920216d3ea
Handle Commit,Discussion and RepositoryDependabotAlertsThread notification types 2023-01-25 12:52:30 +01:00
f8f96d4dd7
Properly handle 'All caught up!' output from gh-notify 2023-01-25 12:50:30 +01:00
ed1487a251
Add support for max notification amount in gh-notify 2023-01-25 12:50:15 +01:00
9293df67bf
Add gh-notify as systemd timer on wm-ready 2023-01-25 12:49:18 +01:00
29f82a4ac0
Use full path to swap-workspace script from eww 2023-01-25 12:02:33 +01:00
838d9b88ba
Make wm-ready.target want xdg-desktop-portal services 2023-01-25 10:41:06 +01:00
b67f5a2c05
Run setbg as systemd service file 2023-01-25 10:35:26 +01:00
cb6f7e60c4
Run polkit agent with systemd 2023-01-25 10:27:54 +01:00
b17982a298
Require some other services on wm-ready 2023-01-25 03:02:18 +01:00
c3b4d535ce
Run eww as systemd user service on wm-ready 2023-01-25 02:52:13 +01:00
9e042a78a7
Run dunst and swayidle as systemd user services on wm-ready 2023-01-25 02:46:59 +01:00
7ae0ced2c0
Add custom wm-ready systemd target, and run wl-gammarelay on it 2023-01-25 02:45:03 +01:00
109d0d630b
Fix stremio winow name remap rule 2023-01-25 02:14:59 +01:00
eda84b5ab8
Show all hyprland IPC events in temp test script 2023-01-25 02:14:44 +01:00
e1de14e80b
Also show tray icons with inactive statsu 2023-01-25 02:14:17 +01:00
10f0e3eb91
Add commented quick controls to test/show battety status 2023-01-25 02:13:50 +01:00
56140d624f
Fix memory module using MB, instead of GB 2023-01-25 02:12:11 +01:00
05dcf54c6a
Add logout option to menuquit 2023-01-25 02:10:02 +01:00
17af415787
Add systemd user service to autostart wl-gammarelay 2023-01-25 02:01:48 +01:00
2f68ed84aa
Increase shadow range 2023-01-25 01:45:34 +01:00
14f652a409
Add script to change window color on fake fullscreen 2023-01-25 01:43:21 +01:00
edece87bbc
Add shortcut for fakefullscreen 2023-01-25 01:42:59 +01:00
e4b7eac1e3
Add some delay before starting eww bar 2023-01-25 01:41:24 +01:00
c1c1d43f90
Add keybind to open discord 2023-01-25 01:41:24 +01:00
456833fbe3
Add some more keybinds for resize group 2023-01-25 01:41:24 +01:00
17c29fcb48
Remove useless blank line 2023-01-25 01:41:24 +01:00
e4dabd5a41
Remove conflict on spotify keybind and toggle split 2023-01-25 01:41:24 +01:00
bf23640fe7
Move special workspace section above 2023-01-25 01:41:07 +01:00
b99fe275bd
Add keybinds for moving windows around 2023-01-25 01:34:13 +01:00
a5432fa1ab
Switch to pcmanfm-qt 2023-01-25 01:33:05 +01:00
6d8590b0dc
Add quit menu instead of yes/no prompt on hyprland exit 2023-01-25 01:31:37 +01:00
7a81a38d10
Add rules to auto-float some pcmanfm-qt windows 2023-01-25 01:19:08 +01:00
16d845f25b
Don't start discord minimized 2023-01-25 01:17:48 +01:00
43fc732460
Automatically start polkit agent 2023-01-25 01:17:23 +01:00
3d1a47acc7
Remove portal restart script 2023-01-25 01:17:03 +01:00
d5487addcb
Add config file for random mac addresses on network manager 2023-01-16 23:11:07 +01:00
d015c59179
Add /etc/hosts file 2023-01-16 23:07:51 +01:00
e1e149f288
Run chromium on wayland 2023-01-16 23:05:19 +01:00
8fa29912a9
Add git total-files and tracked-files 2023-01-13 01:29:28 +01:00
b017d2b67e
Make total-lines recurse over the whole tree, not work dir 2023-01-13 01:29:13 +01:00
fc4b6f597e
Add readme 2022-11-20 04:15:10 +01:00
1f8bebd13b
Move to systemd-lock-handler instead of swayidle for locking
Swayidle will likely end up dropping logind support, and they themselves
describe it as unstable. For this reason, move to the suggested
alternative: systemd-lock-handler, and just have swayidle run the
command to trigger the logind session lock event, picked up by
systemd-lock-handler.

See <https://github.com/swaywm/swayidle/issues/117> for reference.
2022-11-20 03:15:58 +01:00
89a5b15bbd
Overhaul sync.py script 2022-11-20 03:15:58 +01:00
843904b67d
Improve battery save script 2022-11-20 03:15:58 +01:00
c0e2c397c0
Comment out multi-monitor 2022-11-20 03:15:58 +01:00
f18b01f9ad
Move spotify window rule (ocd) 2022-11-20 03:15:58 +01:00
62c4bec0a7
Add custom system-wide scripts 2022-11-20 03:15:58 +01:00
9ce557ba05
Make parallel follow XDG base dir 2022-11-20 03:15:58 +01:00
24fe73a076
Add shortcut for spotify 2022-11-20 03:15:58 +01:00
6749d1003f
Add quick note creating script 2022-11-20 03:15:58 +01:00
52213e5eed
Update eww config 2022-11-20 03:15:58 +01:00
efe9388a41
Update lvim settings 2022-11-20 03:15:58 +01:00
216beedac2
Update btop config 2022-11-20 03:15:58 +01:00
c8fa3d646b
Move between all workspaces, not just those on same monitor 2022-11-20 03:15:58 +01:00
3a46009989
Use relative movement between monitors 2022-11-20 03:15:58 +01:00
6ae5ef0f66
Also keybinds for both maximize and fullscreen 2022-11-20 03:15:57 +01:00
0de04c9a62
Add idleinhibit window rules 2022-11-20 03:15:57 +01:00
7bf40cbf70
Add custom script for screenshot taking 2022-11-20 03:15:57 +01:00
07479d0426
Fix swappy save format (%D -> %d) 2022-11-20 03:15:57 +01:00
cbdab09b52
Disable cursor inactive timeout 2022-11-20 03:15:57 +01:00
310567eee8
Also noop readthedocs.org 2022-11-20 03:15:57 +01:00
a498f4264a
Set floatterm open mapping to <C-t> 2022-11-20 03:15:57 +01:00
78c6f0d26c
Fix typo 2022-11-20 03:15:57 +01:00
d329f9a4dc
Use brackets, not braces for cycling monitors 2022-11-20 03:15:57 +01:00
4fccf5d569
Add spotify wm rules 2022-11-20 03:15:57 +01:00
4dc598c07e
Run eww bars on both monitors 2022-11-20 03:15:57 +01:00
c6ab0033b4
Use custom script for workspace change 2022-11-20 03:15:57 +01:00
ca8c1ee6fb
Convert bar0 and bar1 for second monitor support 2022-11-20 03:15:57 +01:00
49afc714f6
Add script to toggle some hyprland options for power saving 2022-11-20 03:15:57 +01:00
f8d51d5f26
Add script for monitor-unbound workspace swapping 2022-11-20 03:15:57 +01:00
39f8fa2012
Rework hyprland config 2022-11-20 03:15:57 +01:00
d7b486ab0a
Reword comment in grub config 2022-11-20 03:15:57 +01:00
9ec3b2ec06
Add black line-length default config 2022-11-20 03:15:57 +01:00
084460f7fa
Add .zshenv symlink to home 2022-11-20 03:15:57 +01:00
057a854cbd
Add placeholder gnupg dir 2022-11-20 03:15:57 +01:00
504462b592
Use hyprland log in cache properly 2022-11-20 03:15:57 +01:00
a89c25abb2
Remove extra aliases 2022-11-20 03:15:57 +01:00
10c8a93266
Add screenshots dir to user-dirs 2022-11-20 03:15:57 +01:00
35e386abc6
Also remap regular discord (not webcord) 2022-11-20 03:15:57 +01:00
c859bf2273
Add some more noopped domains 2022-11-20 03:15:57 +01:00
a49fd89a88
Trust all githubusercontent.com subdomains on github 2022-11-20 03:15:56 +01:00
a708bf90d3
Mention reason behind explicit blocks in hard mode 2022-11-20 03:15:56 +01:00
63c33c00c6
Make youtube theater actually useful 2022-11-20 03:15:56 +01:00
2bf1f949e4
Several changes to lvim config 2022-11-20 03:15:56 +01:00
50efe01b09
Add btop config 2022-11-20 03:15:56 +01:00
48ba2d1f76
Allow camo.githubusercontent.com (for images) 2022-11-20 03:15:56 +01:00
98f8dc30fc
Make ~/Videos the videos folder 2022-11-20 03:15:56 +01:00
cffb0c2690
Disable notifications on lock screen (swayidle) 2022-11-20 03:15:56 +01:00
8b8d24c4b1
Add shortcut for toggling dunst idle mode 2022-11-20 03:15:56 +01:00
1e534616c7
Add shortcut for toggling swayidle 2022-11-20 03:15:56 +01:00
1f6ad7f0b6
Remove unused exclude rules 2022-11-20 03:15:56 +01:00
6e25c58352
Also allow passwordless backlight on amd gpu screens 2022-11-20 03:15:56 +01:00
0adc8f38f5
Update exclude rules 2022-11-20 03:15:56 +01:00
50f1ff3a55
Use proper users home even when in sudo 2022-11-20 03:15:56 +01:00
ede00ca602
Remove broken discord notification fix 2022-11-20 03:15:56 +01:00
d68bdb594b
Remove temporary testing script 2022-11-20 03:15:56 +01:00
44b010a541
Update multiple scripts 2022-11-20 03:15:56 +01:00
542ac098b4
Ignore nomacs Image Lounge.conf from sync cheks on diffs 2022-11-20 03:15:56 +01:00
ce7b6837f6
Update pcmanfm window size 2022-11-20 03:15:56 +01:00
27b9e0ea42
Update sudo askpass to menupass 2022-11-20 03:15:56 +01:00
5a086c6ec7
Update aliases 2022-11-20 03:15:56 +01:00
8bfcc5b9ea
Disable TMOUT 2022-11-20 03:15:56 +01:00
d4d5e24f40
Remove deprecated tmp folder definition from npmrc 2022-11-20 03:15:56 +01:00
01acb9087e
Several hyprland config changes 2022-11-20 03:15:56 +01:00
3b655f6b6b
Move npm settings to proper location 2022-11-20 03:15:56 +01:00
46e30950b7
Don't ignore scripts in comparison 2022-11-20 03:14:53 +01:00
8536bfa688
Handle sys file being a directory while dotfile is file 2022-11-20 03:14:44 +01:00
a3e01caebf
Initial commit 2022-11-20 03:14:18 +01:00
b912871070
Remove everything and restart blank
This commit removes all files currently present in the repo, to prepare
for a start from a nothing. This is done due to my recent migration from
X11 to Wayland, which has rendered most of these config files no longer
releveant.

I've currently been tracking my dotfiles in a separate repository, in
hopes to get it to a state where it would be mergable here, but that
turned out to be much more difficult than I anticipated, and I think it
will be much easier to simply move over the history from this temporary
repository I've been using onto this one. That however requires a start
from a clean point, which this commit creates.
2022-11-20 03:07:41 +01:00
eadb37961b
Add notice about temporary dotfiles repo for wayland 2022-10-30 00:28:20 +02:00
386 changed files with 13008 additions and 10376 deletions

32
.gitignore vendored
View file

@ -1,32 +0,0 @@
# Byte-compiled / optimized / DLL Files
__pycache__/
*.py[cod]
*$py.class
# Virtual Envornments
.venv
venv/
env/
# Editor project settings
## VSCode
.vscode/
## PyCharm intellij
.idea/
## repl.it
.replit
## Spyder
.spyproject/
.spyderproject/
# Ignore ds store files
.DS_STORE
# Personal TODO files
TODO
# Ignore backups
backup/
# Ignore git downloads
download/

30
.gitmodules vendored
View file

@ -1,18 +1,12 @@
[submodule "root/usr/local/src/dmenu"]
path = "root/usr/local/src/dmenu"
url = "https://github.com/ItsDrike/dmenu"
[submodule "root/usr/share/zsh/site-functions/zsh-autosuggestions"]
path = "root/usr/share/zsh/site-functions/zsh-autosuggestions"
url = "https://github.com/zsh-users/zsh-autosuggestions"
[submodule "root/usr/share/zsh/site-functions/zsh-syntax-highlighting"]
path = "root/usr/share/zsh/site-functions/zsh-syntax-highlighting"
url = "https://github.com/zsh-users/zsh-syntax-highlighting"
#[submodule "root/usr/share/zsh/site-functions/zsh-you-should-use"]
# path = "root/usr/share/zsh/site-functions/zsh-you-should-use"
# url = "https://github.com/MichaelAquilina/zsh-you-should-use"
[submodule "root/usr/local/src/z.lua"]
path = "root/usr/local/src/z.lua"
url = "https://github.com/skywind3000/z.lua"
[submodule "home/.config/nvim"]
path = home/.config/nvim
url = https://github.com/ItsDrike/Stellar-Nvim
[submodule "root/usr/local/src/Hyprland"]
path = root/usr/local/src/Hyprland
url = https://github.com/hyprwm/Hyprland
[submodule "root/usr/local/src/eww"]
path = root/usr/local/src/eww
url = https://github.com/elkowar/eww
[submodule "home/.config/zsh/.zgenom"]
path = home/.config/zsh/.zgenom
url = https://github.com/jandamm/zgenom
[submodule "home/.config/tmux/plugins/tpm"]
path = home/.config/tmux/plugins/tpm
url = https://github.com/tmux-plugins/tpm

157
README.md
View file

@ -1,87 +1,104 @@
# Dotfiles
These are my personal dotfiles. They're split into `home/` and `root/` folders where the home folder holds all files
that should be put directly into your `$HOME` directory, while all of the files in the root folder can be put directly
into `/`
Welcome to my personal dotfiles repository! Simply put, this is a complete
collection of my system configuration files, mostly just here for my personal
use, but of course, you're free to take anything you like (as long as you follow
the [license](./LICENSE).
You are highly advised to first go through these dotfiles yourself and adjust them to your liking.
## Images
What everyone is here for!
## Sample images
**My WM and EWW bar**
<https://user-images.githubusercontent.com/20902250/202879948-f5d79f70-72ff-4cae-97aa-da9a863ac688.mp4>
- Custom prompt (defined [here](home/.config/shell/theme)).
- Colorscheme showcase: ![image](https://user-images.githubusercontent.com/20902250/117699472-69ab5d80-b1b4-11eb-85a8-2b039bc1599a.png)
- Command timing showcase: ![image](https://user-images.githubusercontent.com/20902250/129356038-f1373183-ee50-4cc9-a602-a1215b5d1e5f.png)
- Neovim configuration written in lua: ![Screenshot_2021-12-06_14-31-37](https://user-images.githubusercontent.com/20902250/144854879-f35de259-cea1-4415-9a3b-b093fe008836.png)
- Automatic unknown command package handler: ![image](https://user-images.githubusercontent.com/20902250/129359888-629a4f28-64bd-4c90-8e87-de75a9b8997d.png)
- `lf` file manager previews with ueberzug: ![image](https://user-images.githubusercontent.com/20902250/129359042-b0594788-bc14-4294-bba2-8cba8e30cd94.png)
**Prompt timing showcase**
![image](https://user-images.githubusercontent.com/20902250/202880140-78dc3f65-ea5d-4155-819b-39bd30d2b31e.png)
**Terminal color scheme showcase**
![image](https://user-images.githubusercontent.com/20902250/117699472-69ab5d80-b1b4-11eb-85a8-2b039bc1599a.png)
**Unknown command package handler**
![image](https://user-images.githubusercontent.com/20902250/202880240-c5f975cb-bedb-459b-9a38-fa70a454e0a6.png)
## Features
- Full fledged ZSH configuration without the need to rely on oh-my-zsh
- oh-my-zsh configuration is also supported, but it is off by default, adjust [`.zshrc`](home/.config/zsh/.zshrc) to
enable it
- Even though enabling it is an option, it is not a necessary thing to do, oh-my-zsh has a lot of code that is mostly
irrelevant and unused, these dotfiles give you the ability to completely avoid it, if you desire to do so
- Custom [prompt](home/.config/shell/theme), both for oh-my-zsh configuration or for standalone usage
- Custom [NVIM configuration](home/.config/nvim)
- When you open nvim for the first time, it will automatically try to install Packer plugin manager
- It is compatible with TTY usage, in which case the color support is downgraded and use of special fonts is
disabled.
- The configuration is split into multiple smaller files to keep everything clearn and avoid clutter in the main
configuration file (`init.lua`). It also allows for us to quickly disable certain parts of the config.
- The whole configuration is written in lua rather than vimscript. This allows us to do some nicer things, however
it also means that this config will NOT work for regular vim, it's only meant to be used for neovim.
- Many handy [aliases](home/.config/shell/aliases) and [functions](home/.config/shell/functions) (likely too many, you
should adjust that to your needs)
- [Many pre-defined environmental variables](home/.config/shell/environ), these include
- XDG paths configuration to avoid too much cluttering in home directory
- Colorful man pages using LESS_TERMCAP, or if `bat` is installed, using it as MANPAGER
- [Automatic handlers](home/.config/shell/handlers) which override default command not found behavior to show the
package to which given command belongs (requires pkgfile on Arch Linux)
- List of useful packages that I often install on most of my systems. (These are the package names for arch linux, but
you should be able to find these for any distro, perhaps with a bit different name) located in
[`packages.yaml`](packages.yaml)
- [Opensnitch firewall rules](root/etc/opensnitchd/rules), which block most unauthorized traffic and only allow needed
things. This also blocks spotify ads.
- Automatic logout for TTY sessions or for root logins after 10 minutes of inactivity
- NetworkManager configuration which assigns new mac for each network
- `lf` file manager configuration with support for ueberzug image previews within the terminal
- Tons of handy scripts for automating common tasks
- [`incremental-backup`](root/usr/local/bin/incremental-backup): Easy way to utilize rsync for all backups, without
the need for external software
- [`auto-chroot`](root/usr/local/bin/auto-chroot): Quick way to chroot into any other linux system, without typing
the very repetitive mount and umount commands
- [`tamper-check`](root/usr/local/bin/tamper-check): Script that uses checksums to verify that given files weren't
adjusted in any way.
- [`brightness`](home/.local/bin/scripts/brightness): Script to quickly change screen brightness, you may need to
adjust the BRIGHTNESS_FILE, this can be different from machine to machine
- [`setbg`](home/.local/bin/scripts/setbg): Quick way to set desktop background to specific image, or random image,
or previously used image
- Many smaller dmenu scripts to make life easier
- Full fledged ZSH configuration without relying on oh-my-zsh
- Fully custom terminal prompt with a lot of neat features, such as CWD
shortening, showing git status, seeing how long a command ran for, showing
non-zero exit codes, ... [prompt](./home/.config/shell/prompt)
- A ton of neat and helpful [aliases](./home/.config/shell/aliases) and
[functions](./home/.config/shell/functions) (probably too many for most
people, you should adjust these to your needs)
- Sensible pre-defined environment variables, allowing for
- Colorful man pages using `LESS_TERMCAP`, or if `bat` is installed, using it
as `MANPAGER` directly
- XDG user directory related variables, making programs use the proper
directories, avoiding clutter in `$HOME`
- Tons of handy scripts for automatic common tasks:
- [`incremental-backup`](./root/usr/local/bin/incremental-backup): Simple and
minimalistic way to utilize rsync for fast and efficient backups (utilizing
hard-links), for any directories, or even for the entire system.
- [`btrfs-backup`](./root/usr/local/bin/btrfs-backup): Simple yet very
powerful script to manage btrfs snapshots. I recommend using this in a cron
job for taking automatic snapshots.
- [`auto-chroot`](./root/usr/local/bin/auto-chroot): Quick way to chroot into
any accesible linux system, without typing the repetetive mount/umount
commands. Allows for selecting user and shell to be used.
- [`tamper-check`](./root/usr/local/bin/tamper-check): Script that uses
checksums to verify that contents of specified system-critical files haven't
changed (be aware that they will obviously change if they're updated)
- [`gh-notification`](./home/.local/bin/scripts/gui/gh-notification): Script
expected to be ran as cron-job every few minutes, checking for new github
notifications using github CLI (requies meiji163/gh-notify gh-cli extension)
and sending them out as actual desktop notifications.
- [`brightness`](./home/.local/bin/scripts/gui/brightness): Script to quickly
change the screen brightness
- [`setbg`](./home/.local/bin/scripts/gui/setbg): Simple way to pick a
background to be used (both for X11 and Wayland)
- Tons of other things! The list is just way too long, check the rest
yourself! [system scripts](./root/usr/local/bin), [user
scripts](./home/.local/bin)
On top of just configurations, this repository also includes a
[`guides/`](./guides/) directory with a bunch of guide posts that can help you
set up arch from ground up, or set up specific things after installation.
## Installation
Clone this repository anywhere you like
`$ git clone https://github.com/ItsDrike/dotfiles`
If you don't want to install git (running straight from newly installed OS), you can use `curl`: <br>
`$ curl -LJO https://github.com/ItsDrike/dotfiles/tarball/master` <br>
And extract from `.tar.gz` archive:
`$ tar xvf [archive name]`
Clone this repository anywhere you like
```bash
git https://github.com/ItsDrike/dotfiles
```
If you don't want to use git (running straight from newly installed OS), you can
even use `curl`:
```bash
curl -LJO https://github.com/ItsDrike/dotfiles/tarball/main
```
And extract from `.tar.gz` archive with: `tar xvf [archive name]`
## Attribution
The open-source community has an incredible amount of resources that people have offered to others free of charge and
we all depend on many of these sources. This project is no different and there were many open-source projects that were
utilized in some parts of this project. For that reason, I'd like to thank all of these projects and their
contributors for keeping their content open and available to everyone. This is the list of projects that helped me
build this repository to the stage it's in now. Many of the aliases, config files and other resources aren't my
original creations, but rather just small improvements and adjustments to get everything set in the way I like. Below
is the list of all projects which helped the existence of this repository:
- [Lukesmith's dotfiles/voidrice](https://github.com/LukeSmithxyz/voidrice)
- [BrodieRobertson's dotfiles](https://github.com/BrodieRobertson/dotfiles)
- [BrodieRobertson's scripts](https://github.com/BrodieRobertson/scripts)
- [Derek Taylor's dotfiles](https://gitlab.com/dwt1/dotfiles)
The open-source community has an incredible amount of resources that people have
freely provided to others and we all depend on these projects in many ways. This
collection of configuration files is no exception, and while many of the scripts
and configuration files are my own, many others were partially, or even fully
taken from other open-sourced repositories like this.
For that reason, we'd like to thank all of these communities and projects for
keeping their content open and available to everyone, but most notably we'd like
to thank and reference the significant projects that allowed this repository to
be as amazing as it is now:
- [Luke Smith's dotfiles/voidrice](https://github.com/LukeSmithxyz/voidrice)
- [Brodie Robertson's dotfiles](https://github.com/BrodieRobertson/dotfiles)
- [Brodie Robertson's scripts](https://github.com/BrodieRobertson/scripts)
- [Derek Taylor's dotfiles](https://gitlab.com/dwt1/dotfiles)
- [Mihai Fufezan's dotfiles](https://github.com/fufexan/dotfiles)
- Other sources that I followed from my NixOS configuration and ported over,
these are listed in my [NixOS dotfiles](https://github.com/ItsDrike/nixdots)
readme

View file

@ -1,14 +0,0 @@
user_pref("browser.shell.checkDefaultBrowser", false); // 0101 Enable default browser check
user_pref("network.dns.disableIPv6", false); // 0701 Some VPNs leak IPv6, mine doesn't so don't disable it
user_pref("keyword.enabled", true); // 0801 Enable searching from location bar (I trust my search engine)
user_pref("network.http.referer.XOriginPolicy", 0); // 1601 Allow cross origin referrers, with Smart Referer (this breaks too much)
user_pref("privacy.clearOnShutdown.sessions", true); // 2811 Retain HTTP Basic Auth on shutdown
user_pref("signon.rememberSignons", false); // 5003 Disable saving passwords to FF, there's Bitwarden
user_pref("security.nocertdb", true); // 5005 Don't cache certificates (stores them session-only)
user_pref("browser.download.folderList", 1); // 5016 Use Downloads folder, not previous folder for download location
/* override recipe: enable session restore ***/
user_pref("browser.startup.page", 3); // 0102 Enable session restore
user_pref("privacy.clearOnShutdown.history", false); // 2811 Don't clear history on exit
user_pref("privacy.cpd.history", false); // 2812 To match when you use Ctrl-Shift-Del
user_pref("places.history.enabled", false); // 5013 Disable browsing and download history (allows no history with session restore)

View file

@ -0,0 +1,6 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
/* full screen toolbars */
#navigator-toolbox[inFullscreen] toolbar:not([collapsed="true"]) {
visibility:visible!important;
}

View file

@ -0,0 +1,10 @@
https://raw.githubusercontent.com/yokoffing/filterlists/main/click2load.txt
https://raw.githubusercontent.com/yokoffing/filterlists/main/antipaywall_filters_without_element_hiding.txt
https://raw.githubusercontent.com/DandelionSprout/adfilt/master/LegitimateURLShortener.txt
https://raw.githubusercontent.com/DandelionSprout/adfilt/master/KnowYourMemePureBrowsingExperience.txt
https://raw.githubusercontent.com/DandelionSprout/adfilt/master/WikiaPureBrowsingExperience.txt
https://raw.githubusercontent.com/DandelionSprout/adfilt/master/StopAutoplayOnYouTube.txt
https://raw.githubusercontent.com/DandelionSprout/adfilt/master/DailyMotionSimplicity.txt
https://raw.githubusercontent.com/DandelionSprout/adfilt/master/I%20Don't%20Want%20to%20Download%20Your%20Browser.txt
https://raw.githubusercontent.com/DandelionSprout/adfilt/master/BrowseWebsitesWithoutLoggingIn.txt
https://gitlab.com/trafotin/dotfiles/-/raw/main/ublock-origin/anti-discord

View file

@ -0,0 +1,65 @@
!! Replace third-party frames with a click2load banner
!*$3p,frame,redirect=click2load.html
!! click2load exceptions
@@||viewscreen.githubusercontent.com^$3p,frame,domain=github.com
@@||www.redditmedia.com^$3p,frame,domain=www.reddit.com
@@||cdn.embedly.com^$3p,frame
@@||imgur.com^$3p,frame
!! Bad TLDs (from https://github.com/DandelionSprout/adfilt/blob/master/Dandelion%20Sprout's%20Anti-Malware%20List.txt)
||agency^
||bid^
||cf^
||ga^
||gdn^
||gq^
||ooo^
||loan^
||ml^,domain=~lingva.ml
||pw^
||tk^
||top^
||zip^
!! Hide GDPR consent banners
sat1.de##cmp-banner
meteoblue.com##.gdpr_message
askubuntu.com##.js-consent-banner
stackexchange.com##.js-consent-banner
stackoverflow.com##.js-consent-banner
gitbook.io##.r-1yzf0co.r-ymttw5.r-18u37iz.r-1quu1zo.r-1i7sdiz.r-rs99b7.r-156hn8l.r-1habvwh.css-1dbjc4n
www.morgenpost.de##.footer .no-js
www.morgenpost.de##+js(remove-class, no-js, html)
!! Hide/Block annoying elements
stackoverflow.com###saves-launch-popover
!! Hide/Block ad banners
!! Privacy
||collector.github.com^
||api.github.com/_private/browser/errors
||cmp.zdf.de^
||discord.com/api/v*/science
!! XSS hardening on codebergs login page
||codeberg.org/user/login^$script
||codeberg.org/user/login^$inline-script
||codeberg.org/user/login^$third-party
!! Cosmetic rules
! Make theater mode in youtube
youtube.com##body ytd-watch-flexy[theater-requested_]:not([fullscreen]) #player-theater-container:style(height:calc(100vh - 56px) !important; max-height:calc(100vh - 56px) !important;min-height:calc(100vh - 56px) !important; )
! Removes "Experiencing interruptions" toast popup in the bottom corner when a video is bufferring (due to network congestion, underperforming hardware, or any other reason)
! https://gist.github.com/gidoBOSSftw5731; only for English YT version
www.youtube.com#?##toast:has(#text-container:has-text(/experiencing interruptions/i))
! Hacker News dark mode
! https://letsblock.it/filters/hackernews-darkmode
news.ycombinator.com##html:style(filter:invert(100%) hue-rotate(180deg))
news.ycombinator.com##body:style(background: white)
news.ycombinator.com##div.toptext:style(color: black)
news.ycombinator.com###hnmain td[bgcolor="#000000"]

168
firefox/ublock/my_rules.txt Normal file
View file

@ -0,0 +1,168 @@
!! This is not a comment, this is a invalid line which gets silently dropped
!! by uB if you paste into your dynamic filter rules
!! Blocking mode: hard mode with click2load 3p-frames
* * * noop
* * 1p-script noop
* * 3p block
* * 3p-frame noop
* * 3p-script block
* * image noop
* * inline-script noop
behind-the-scene * * block
!! Global CDN noops for common CDNs (mostly via CNAME)
* akamai.net * noop
* akamaiedge.net * noop
* akamaihd.net * noop
* akamaized.net * noop
* b-cdn.net * noop
* cdn.cloudflare.net * noop
* cloudfront.net * noop
* discourse-cdn.com * noop
* edgecastcdn.net * noop
* global.fastly.net * noop
* hwcdn.net * noop
* kxcdn.com * noop
* bootstrapcdn.com * noop
* map.fastly.net * noop
* netdna-ssl.com * noop
* wp.com * noop
* ajax.googleapis.com * noop
* jsdelivr.net * noop
* unsplash.com * noop
* cdn.embedly.com * noop
* wixmp.com * noop
!! Website building/caching tools
* cloudflare.com * noop
* prismic.io * noop
* googlehosted.com * noop
!! Website 3rd party utilities (trusted or simply necessary things)
* maps.googleapis.com * noop
* recaptcha.net * noop
* imgur.com * noop
* shields.io * noop
* gravatar.com * noop
* fontawesome.com * noop
!! Explicit blocks
!! (Even though we block all 3rd parties, mark these as explicitly denied,
!! they're evil and it makes manual overrides easier since we know what not
!! to even consider for overriding, and it also makes it easy to notice sites
!! that use one of these evil services)
* fonts.googleapis.com * block
* doubleclick.net * block
* sentry.io * block
* servedby-buysellads.com * block
* facebook.com * block
* facebook.net * block
!! Per-site (mostly noop) settings
! GitHub
github.com githubassets.com * noop
github.com githubusercontent.com * noop
! Google
accounts.google.com googleusercontent.com * noop
accounts.google.com gstatic.com * noop
accounts.google.com signaler-pa.googleapis.com * noop
accounts.google.com youtube.com * noop
developers.google.com gstatic.com * noop
developers.google.com googleusercontent.com * noop
drive.google.com googleusercontent.com * noop
drive.google.com gstatic.com * noop
docs.google.com googleusercontent.com * noop
docs.google.com gstatic.com * noop
mail.google.com googleusercontent.com * noop
mail.google.com gstatic.com * noop
translate.google.com googleusercontent.com * noop
translate.google.com gstatic.com * noop
www.youtube.com ggpht.com * noop
www.youtube.com google.com * noop
www.youtube.com googleusercontent.com * noop
www.youtube.com googlevideo.com * noop
www.youtube.com gstatic.com * noop
www.youtube.com jnn-pa.googleapis.com * noop
www.youtube.com ytimg.com * noop
! Microsoft crap
login.live.com * 3p noop
login.live.com * 3p-frame noop
login.live.com * 3p-script noop
login.microsoftonline.com * 3p noop
login.microsoftonline.com * 3p-frame noop
login.microsoftonline.com * 3p-script noop
outlook.live.com * 3p noop
outlook.live.com * 3p-frame noop
outlook.live.com * 3p-script noop
outlook.office365.com * 3p noop
outlook.office365.com * 3p-frame noop
outlook.office365.com * 3p-script noop
! Protonmail
mail.proton.me * 3p noop
mail.proton.me * 3p-frame noop
mail.proton.me * 3p-script noop
! Reddit
www.reddit.com redditmedia.com * noop
www.reddit.com redditstatic.com * noop
www.reddit.com redd.it * noop
! StackExchange
stackexchange.com sstatic.net * noop
stackexchange.com stackoverflow.com * noop
stackoverflow.com sstatic.net * noop
stackoverflow.com stackexchange.com * noop
askubuntu.com sstatic.net * noop
askubuntu.com stackexchange.com * noop
askubuntu.com stackoverflow.com * noop
superuser.com sstatic.net * noop
superuser.com stackexchange.com * noop
superuser.com stackoverflow.com * noop
serverfault.com sstatic.net * noop
serverfault.com stackexchange.com * noop
serverfault.com stackoverflow.com * noop
! Simplelogin
app.simplelogin.io simplelogin.co * noop
! Privacyguides
www.privacyguides.org github.com * noop
www.privacyguides.org privacyguides.github.io * noop
www.privacyguides.org privacyguides.net * noop
! Fontawesome
fontawesome.com algolia.net * noop
fontawesome.com algolianet.com * noop
fontawesome.com fortawesome.com * noop
! IMDb
www.imdb.com media-amazon.com * noop
www.imdb.com media-imdb.com * noop
! Python docs
* readthedocs.io * noop
* readthedocs.org * noop
! Others
docs.gtk.org gnome.org * noop
letsgetrusty.com kartra.com * noop
* freedesktop.org * noop
* herokudns.com * noop

76
firefox/user-overrides.js Normal file
View file

@ -0,0 +1,76 @@
/* --------------- PERSONAL ARKENFOX OVERRIDES --------------- ***/
user_pref("_overrides.parrot", "Custom: Arkenfox overrides");
/* Re-enabled single perf features ***/
user_pref("keyword.enabled", true); // 0801 Enable searching from location bar (I trust my search engine)
// user_pref("browser.search.suggest.enabled", true); // 0804 Enable search suggestions
// user_pref("browser.urlbar.suggest.searches", true); // 0804 Enables search suggestions in the url-bar
user_pref("network.http.referer.XOriginPolicy", 0); // 1601 Allow cross origin referrers (disabling breaks too much), I use Smart Referer extension instead
user_pref("privacy.clearOnShutdown.sessions", true); // 2811 Retain HTTP Basic Auth on shutdown
user_pref("signon.rememberSignons", false); // 5003 Disable saving passwords to FF, there's Bitwarden
user_pref("security.nocertdb", true); // 5005 Don't cache certificates (stores them session-only)
user_pref("browser.download.folderList", 1); // 5016 Always use default downloads folder, not previous folder for download location
/* override recipe: enable session restore ***/
user_pref("browser.startup.page", 3); // 0102 Enable session restore
user_pref("privacy.clearOnShutdown.history", false); // 2811 Don't clear history on exit
user_pref("privacy.cpd.history", false); // 2812 To match when you use Ctrl-Shift-Del
user_pref("places.history.enabled", false); // 5013 Disable browsing and download history (allows no history with session restore)
/* --------------- PERSONAL PRIVACY RULES --------------- ***/
user_pref("_overrides.parrot", "Custom: Privacy rules");
/* Deny some permission requests by default (prevent ask popups) ***/
user_pref("permissions.default.microphone", 2); // Microphone
user_pref("permissions.default.desktop-notification", 2); // Notifications
user_pref("permissions.default.geo", 2); // Location
/* Disable safebrowsing (sends data to google) ***/
user_pref("browser.safebrowsing.downloads.remote.enabled", false);
user_pref("browser.safebrowsing.phishing.enabled", false);
user_pref("browser.safebrowsing.malware.enabled", false);
/* Javascript hardening (might cause slowdowns/breakage) ***/
// user_pref("javascript.options.ion", false); // Might cause slowdowns/breakage
// user_pref("javascript.options.asmjs", false); // Might cause slowdowns/breakage
// user_pref("javascript.options.wasm", false); // Completely disables WASM, for the security gain and speed benefit
// user_pref("javascript.options.baselinejit", false); // Disable JIT compilation - usually breaks sites with a lot of javascript but is a huge security gain
/* Mark Quad9 as trusted recursive resolver (TRR) for DNS over HTTPS (DoH) ***/
user_pref("network.trr.mode", 2); // Use TRR first, and only if the secure resolution fails use the operating system resolver.
user_pref("network.trr.uri", "https://dns.quad9.net:5053/dns-query"); // Resolver we want to use
user_pref("network.trr.bootstrapAddress", "9.9.9.9"); // Address to lookup the quad9 DoH address (only used once for this lookup)
/* Other Privacy hardenings ***/
user_pref("geo.enabled", false); // Fully disable location access
user_pref("media.hardwaremediakeys.enabled", false); // Disable control via media keys (some websites might be stealing these)
user_pref("dom.webaudio.enabled",false); // Old, mostly unused API, likely utilized for fingerprinting, hasn't broken anything FOR ME
/* --------------- PERSONAL NON-PRIVACY RULES --------------- ***/
user_pref("_overrides.parrot", "Custom: Non-privacy rules");
/* Annoyances ***/
user_pref("browser.tabs.firefox-view", false); // Don't show firefox view tab
user_pref("extensions.pocket.enabled", false); // Disable pocket
user_pref("extensions.abuseReport.enabled", false); // Disable report extension to mozilla
user_pref("identity.fxaccounts.enabled", false); // Disable sync entirely
/* Urlbar suggestions ***/
user_pref("browser.urlbar.suggest.openpage", false); // Disable suggestions of open pages
user_pref("browser.urlbar.suggest.engines", false); // Disable suggestions of search engines
user_pref("browser.urlbar.suggest.topsites", false); // Disable suggestions of top sites
/* Styling changes ***/
user_pref("browser.fullscreen.autohide", false); // Don't auto-hide tabs when firefox is in fullscreen
user_pref("browser.toolbars.bookmarks.visibility", "always"); // Always show bookmarks toolbar
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); // Enable profile customization with userChrome.css and userContent.css
user_pref("ui.systemUsesDarkTheme", 1); // Enables `prefers-color-scheme` CSS media feature
/* Other changes ***/
user_pref("browser.preferences.experimental", true); // Show experimental options in about:preferences
user_pref("browser.urlbar.suggest.calculator", true); // Calculator in urlbar
user_pref("layout.spellcheckDefault", 2); // Enable spellcheck by default for all inputs
user_pref("browser.quitShortcut.disabled", true); // Disable Ctrl+Q browser quit shortcut
/* --------------- END --------------- ***/
user_pref("_overrides.parrot", "Custom: success");

367
guides/01_INSTALLATION.md Normal file
View file

@ -0,0 +1,367 @@
# Installation
This installation guide will walk you through the process of setting up Arch
Linux, getting you from live cd to a working OS.
This guide is written primarily as a reference for myself, but it can certainly
be a useful resource for you too, if you want to achieve a similar setup.
This guide includes steps for full disk encryption, and sets up the system with
some basic tools and my zsh configuration.
## Partitioning
First thing we will need to do is set up partitions. To do so, I recommend using
`fdisk`. Assuming you have a single-disk system, you will want to create 3
partitions:
- EFI (1 GB)
- Swap (same size as your RAM, or more)
- Data (rest)
The swap partition is optional, however I do recommend creating it (instead of
using a swap file), as it will allow you to hibernate your machine.
> [!NOTE]
> Don't forget to also set the type for these partitions (`t` command in `fdisk`).
>
> - EFI partition type: EFI System (1)
> - Swap partition type: Linux swap (19)
> - Data partition type: Linux filesystem (20)
### File-Systems
Now we'll to create file systems on these partitions, and give them disk labels:
```bash
mkfs.fat -F 32 /dev/sdX1
fatlabel /dev/sdX1 EFI
mkswap -L SWAP /dev/diskX2
cryptsetup luksFormat /dev/sdX3 --label CRYPTFS
cryptsetup open /dev/disk/by-label/CRYPTFS crypfs
mkfs.btrfs -L FS /dev/mapper/cryptfs
```
> [!NOTE]
> For the LUKS encrypted partitions, I'd heavily recommend that you back up the
> LUKS headers in case of a partial drive failure, so that you're still able to
> recover your remaining data. To do this, you can use the following command:
>
> ```bash
> cryptsetup luksHeaderBackup /dev/device --header-backup-file /mnt/backup/file.img
> ```
### BTRFS Subvolumes
Now we will split our btrfs partition into the following subvolumes:
- root: The subvolume for `/`.
- data: The subvolume for `/data`, containing my personal files, which should be
and backed up.
- snapshots: A subvolume that will be used to store snapshots (backups) of the
other subvolumes
```bash
mount /dev/mapper/cryptfs /mnt
btrfs subvolume create /mnt/root
btrfs subvolume create /mnt/data
btrfs subvolume create /mnt/snapshots
umount /mnt
```
### Mount the partitions and subvolumes
<!-- markdownlint-disable MD028 -->
> [!NOTE]
> Even though we're specifying the `compress` flag in the mount options of each
> btrfs subvolume, somewhat misleadingly, you can't actually use different
> compression levels for different subvolumes. Btrfs will share the same
> compression level across the whole partition, so it's pointless to attempt to
> set different values here.
> [!NOTE]
> You may have seen others use btrfs options such as `ssd`, `discard=async` and
> `space_cache=v2`. These are all default (with the `ssd` being auto-detected),
> so specifying them is pointless now.
<!-- markdownlint-enable MD028 -->
```bash
mount -o subvol=root,compress=zstd:3,noatime /dev/mapper/cryptfs /mnt
mount --mkdir -o subvol=home,compress=zstd:3,noatime /dev/mapper/cryptfs /mnt/data
mount --mkdir -o subvol=snapshots,compress=zstd:3,noatime /dev/mapper/cryptfs /mnt/snapshots
mount --mkdir -o compress=zstd:3,noatime /dev/mapper/cryptfs /mnt/.btrfs
mount --mkdir /dev/disk/by-label/EFI /mnt/efi
mkdir /mnt/efi/arch
mount --mkdir --bind /mnt/efi/arch /mnt/boot
swapon /dev/disk/by-label/SWAP
```
## Base installation
```bash
reflector --save /etc/pacman.d/mirrorlist --latest 10 --protocol https --sort rate
pacstrap -K /mnt base linux linux-firmware linux-headers amd-ucode # or intel-ucode
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
```
Configure essentials
```bash
pacman -S git btrfs-progs neovim
ln -sf /usr/share/zoneinfo/CET /etc/localtime
hwclock --systohc
sed -i 's/^#en_US.UTF-8/en_US.UTF-8/g' /etc/locale.gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
locale-gen
echo "pc" > /etc/hostname
passwd
```
## Basic configuration
Clone my dotfiles and run the install script
```bash
git clone --recursive https://github.com/ItsDrike/dotfiles ~/dots
cd ~/dots
./install_root.sh
```
Exit and reenter chroot, this time into zsh shell
```bash
exit
arch-chroot /mnt zsh
```
Create non-privileged user
```bash
useradd itsdrike
usermod -aG wheel itsdrike
install -o itsdrike -g itsdrike -d /home/itsdrike
passwd itsdrike
chsh -s /usr/bin/zsh itsdrike
su -l itsdrike # press q or esc in the default zsh options
```
Setup user account
```bash
git clone --recursive https://github.com/ItsDrike/dotfiles ~/dots
cd ~/dots
./install_user.sh
```
Exit (logout) the user and relogin, this time into configured zsh shell
```bash
exit
su -l itsdrike
```
Install LazyVim
```bash
git clone https://github.com/ItsDrike/lazyvim ~/.config/nvim
```
## Fstab adjustments
Finally, we'll want to make some slight modifications to `/etc/fstab` file, so
that we're using labels instead of UUIDs to mount our devices and also fix the
permissions for the EFI mount-point (the fmask & dmask options), as by default,
they're way too permissive. This is how I like to structure my fstab:
<!-- markdownlint-disable MD013 -->
```text
# Static information about the filesystems.
# See fstab(5) for details.
#
# <file system> <dir> <type> <options> <dump> <pass>
# region: Physical partitions
# /dev/nvme1n1p1 LABEL=EFI UUID=A34B-A020
/dev/disk/by-label/EFI /efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
# /dev/nvme1n1p2 LABEL=SWAP UUID=d262a2e5-a1a3-42b1-ac83-18639f5e8f3d
/dev/disk/by-label/SWAP none swap defaults 0 0
# endregion
# region: BTRFS Subvolumes
# /dev/mapper/cryptfs LABEL=FS UUID=bffc7a62-0c7e-4aa9-b10e-fd68bac477e0
/dev/mapper/cryptfs / btrfs rw,noatime,compress=zstd:1,subvol=/root 0 1
/dev/mapper/cryptfs /data btrfs rw,noatime,compress=zstd:1,subvol=/data 0 2
/dev/mapper/cryptfs /snapshots btrfs rw,noatime,compress=zstd:1,subvol=/snapshots 0 2
/dev/mapper/cryptfs /.btrfs btrfs rw,noatime,compress=zstd:1 0 2
# endregion
# region: Bind mounts
# Write kernel images to /efi/arch, not directly to efi system partition (esp), to avoid conflicts when dual booting
/efi/arch /boot none rw,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro,bind 0 0
# endregion
```
<!-- markdownlint-enable MD013 -->
## Ask for LUKS password from initramfs
Ask for encryption password of the root partition in early userspace (only
relevant if you're using LUKS encryption), you'll also need to set cryptdevice
kernel parameter, specifying the device that should be unlocked here, and the
device mapping name. (shown later)
```bash
# Find the line with HOOKS=(...)
# Add `keyboard keymap` after `autodetect` (if these hooks are already there,
# just keep them, but make sure they're after `autodetect`).
# Lastly add `encrypt` before `filesystems`.
nvim /etc/mkinitcpio.conf
```
This will configure `mkinitcpio` to build support for the keyboard input, and
for decrypting LUKS devices from within the initial ramdisk environment.
If you wish, you can also follow the instructions below to auto-enable numlock:
```bash
sudo -u itsdrike paru -S mkinitcpio-numlock
# Go to HOOKS and add `numlock` after `keyboard` in:
nvim /etc/mkinitcpio.conf
```
Now regenerate the initial ramdisk environment image:
```bash
mkinitcpio -P
```
## Configure systemd-boot bootloader
> [!NOTE]
> If you wish to use another boot loader (like GRUB), just follow the Arch Wiki.
> This guide will only cover systemd-boot
### Make sure you're using UEFI
As a first step, you will want to confirm that you really are on a UEFI system.
If you're using any recent hardware, this is very likely the case. Nevertheless,
let's check and make sure:
```bash
bootctl status
```
Make sure the `Firmware` is reported as `UEFI`.
If you're still using BIOS instead of UEFI, you should check the wiki for
instructions on how to set up systemd-boot or choose a different boot manager,
that is more suited for BIOS firmware.
### Install systemd-boot
Install systemd-boot to the EFI system partition (ESP)
```bash
bootctl --esp-path=/efi install
# This might report a warning about permissions for the /efi mount point,
# these were addressed in the fstab file above (changed fmask and dmask),
# if you copied those to your fstab, the permissions will be fixed after reboot
```
Add boot menu entries
(Note that we're using LABEL= for cryptdevice, for which `udev` must be before
the `encrypt` hook in mkinitcpio `HOOKS`. This should however be the case by default.
If you wish, you can also use UUID= or just /dev/XYZ here)
Create a new file - `/efi/loader/entries/arch.conf`, with:
```bash
title Arch Linux
sort-key 0
linux /arch/vmlinuz-linux
initrd /arch/amd-ucode.img
initrd /arch/initramfs-linux.img
options cryptdevice=LABEL=CRYPTFS:cryptfs:allow-discards
options root=/dev/mapper/cryptfs rootflags=subvol=/root
options rw loglevel=3
```
And finally configure loader - `/efi/loader/loader.conf` (overwrite the contents):
```bash
default arch-hyprland.conf
timeout 4
console-mode auto
editor yes
auto-firmware yes
beep no
```
## Reboot
Take a deep breath.
```bash
exit # go back to live iso (exit chroot)
reboot
```
## Post-setup
Log in as an unpriviledged user, and:
Enable Network Time Protocol (time synchronization)
```bash
sudo timedatectl set-ntp true
timedatectl status
```
Connect to a wifi network
```bash
nmtui
```
## Graphical User Interface
Finally, you can run the `install_gui.sh` script in my dotfiles, to get all of
the packages necessary for a proper graphical experience with Hyprland WM and a
bunch of applications/toolings that I like to use.
This final script is definitely the most opinionated one and you might want to
make adjustments to it, depending on your preferences.
## We're done
If you got this far, good job! You should now be left with a fully functional
Arch Linux system, ready for daily use.
That said, you might find some of the other guides helpful if you wish to tinker
some more:
- If you have more encrypted partitions than just root, you should check out:
[automounting other encrypted
partitions](./02_AUTOMOUNTING_ENCRYPTED_PARTITIONS.md).
- You may be also interested in [setting up secure boot](./04_SECURE_BOOT.md).
- Having your encrypted root partition unlock automatically without compromising
on safety through [tpm unlocking](./06_TPM_UNLOCKING.md).
- The [theming guide](./99_THEMING.md), explaining how to configure qt, gtk,
cursor and fonts correctly.
- Setting up a display manager (DM) with optional automatic login: [greetd
guide](./99_GREETD.md)
- On laptops, you should check the [battery optimizations
guide](./99_BATTERY_OPTIMIZATIONS.md)

View file

@ -0,0 +1,138 @@
# Auto-mounting other encrypted partitions
If you've set up multiple encrypted partitions (a common reason to do so is
having multiple drives), you will likely want to have these other partitions
mounted automatically after the root partition, during the boot process.
> [!TIP]
> You can safely skip this guide if you only have a single encrypted partition
> (with the root).
## /etc/crypttab
Obviously, with encrypted partitions, you can't simply specify the mounting
instructions into your `/etc/fstab`, instead, there is a special file designed
precisely for this purpose: `/etc/crypttab`. Just like with `fstab`, systemd
will read `crypttab` during boot and attempt to mount the entries inside of it.
From here, you can add entries for mounting your encrypted partitions, like so:
```txt
# Configuration for encrypted block devices.
# See crypttab(5) for details.
# NOTE: Do not list your root (/) partition here, it must be set up
# beforehand by the initramfs (/etc/mkinitcpio.conf).
# <name> <device> <password> <options>
cryptdata LABEL=DATA none discard
```
> [!NOTE]
> The `discard` option is specified to enable TRIM on SSDs, which should improve
> their lifespan. It is not necessary if you're using an HDD.
The `<name>` option specifies the name of the decrypted mapper device, so in
this case, the decrypted device would be in `/dev/mapper/cryptdata`. We can then
add mounting instructions into `/etc/fstab`, that work with this mapper device.
Specifying a partition in here will result in you being prompted for a
decryption password each time during boot. If you only have one encrypted
partition like this, and your root partition isn't encrypted, this will be
sufficient for you.
## Key files
That said, if you have multiple encrypted partitions, or your root partition is
encrypted too, you might find it pretty annoying to have to enter a password for
each of your encrypted partitions every time.
For this reason, crypttab includes the `<password>` option, which we originally
left as `none`. We can use this field to specify a path to a "key file". This is
basically just a file that holds the encryption password.
> [!IMPORTANT]
> Storing the decryption password in a key file like this can only be done
> safely if that key file is stored on another encrypted partition, which we
> decrypted in another way (usually by being prompted for the password).
>
> In this example, we'll be storing the key files in `/etc/secrets`, which is
> safe as our root partition is encrypted.
LUKS encryption has support for having multiple keys for the same parition.
We'll utilize this support and add 2nd key slot to all of the partitions that we
wish to auto-mount.
```bash
mkdir -p /etc/secrets
dd if=/dev/random bs=4096 count=1 of=/etc/secrets/keyFile-data.bin
chmod -R 400 /etc/secrets
chmod 700 /etc/secrets
```
The bs argument signifies a block size (in bits), so this will create 4096-bit keys.
Now we can add this key into our LUKS encrypted data partition:
```bash
cryptsetup luksAddKey /dev/disk/by-label/DATA --new-keyfile /etc/secrets/keyFile-data.bin
```
Finally, we'll modify the `/etc/crypttab` record and add our new keyfile as the
password for this partition:
```txt
# Configuration for encrypted block devices.
# See crypttab(5) for details.
# NOTE: Do not list your root (/) partition here, it must be set up
# beforehand by the initramfs (/etc/mkinitcpio.conf).
# <name> <device> <password> <options>
cryptdata LABEL=DATA /etc/secrets/keyFile-data.bin discard
```
### /etc/fstab
While the crypttab file opens the encrypted block devices and creates the mapper
interfaces for them, to mount those to a concrete directory, we still use
/etc/fstab. Below is the /etc/fstab that I use on my system:
<!-- markdownlint-disable MD010 MD013 -->
```text
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# region: Physical partitions
# /dev/nvme0n1p2 LABEL=SWAP UUID=d262a2e5-a1a3-42b1-ac83-18639f5e8f3d
/dev/disk/by-label/SWAP none swap defaults 0 0
# /dev/nvme0n1p1 LABEL=EFI UUID=44E8-EB26
/dev/disk/by-label/EFI /efi vfat rw,relatime,fmask=0137,dmask=0027,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
# endregion
# region: BTRFS subvolumes on /dev/disk/by-label/ARCH (decrypted from ARCH_LUKS)
# /dev/mapper/cryptfs LABEL=ARCH UUID=bffc7a62-0c7e-4aa9-b10e-fd68bac477e0
/dev/mapper/cryptfs / btrfs rw,noatime,compress=zstd:1,ssd,space_cache=v2,subvol=/@ 0 1
/dev/mapper/cryptfs /home btrfs rw,noatime,compress=zstd:1,ssd,space_cache=v2,subvol=/@home 0 1
/dev/mapper/cryptfs /var/log btrfs rw,noatime,compress=zstd:2,ssd,space_cache=v2,subvol=/@log 0 1
/dev/mapper/cryptfs /var/cache btrfs rw,noatime,compress=zstd:3,ssd,space_cache=v2,subvol=/@cache 0 1
/dev/mapper/cryptfs /tmp btrfs rw,noatime,compress=no,ssd,space_cache=v2,subvol=/@tmp 0 1
/dev/mapper/cryptfs /data btrfs rw,noatime,compress=zstd:5,ssd,space_cache=v2,subvol=/@data 0 2
/dev/mapper/cryptfs /.btrfs btrfs rw,noatime,ssd,space_cache=v2 0 2 # btrfs root
# endregion
# region: Bind mounts
# Write kernel images to /efi/arch, not directly to efi system partition (esp), to avoid conflicts when dual booting
/efi/arch-1 /boot none rw,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro,bind 0 0
# endregion
```
<!-- markdownlint-enable MD010 MD013 -->

View file

@ -0,0 +1,205 @@
# Unified Kernel Images (UKI) booting
A Unified Kernel Image is a single executable (`.efi` file), which can be
booted directly from UEFI firmware, or be automatically sourced by boot loaders
with no extra configuration.
> [!NOTE]
> If you're still using BIOS, you will not be able to set up UKIs, they require
> UEFI.
A UKI will include:
- a UEFI stub loader like (systemd-stub)
- the kernel command line
- microcode
- an initramfs image
- a kernel image
- a splash screen
The most common reason why you might want to use UKIs is secure boot. That's
because a UKI is something that can be signed and represents an immutable
executable used for booting into your system.
This is good, because with a standalone bootloader, you would be allowed you to
edit the kernel parameters, or even change the kernel image by editing the
configuration inside of the (unencrypted) EFI partition. This is obviously
dangerous, and we don't want to allow this.
## Define kernel command line
Since UKI contains the kernel command line, we will need to define it so that
when the image is being built, it can pick it up.
This is a crucial step especially when you have encryption set up, as without
it, the kernel wouldn't know what root partition to use.
To set this up, we will use `/etc/kernel/cmdline`.
This is how I setup my kernel arguments (If you're unsure what arguments you
need, just check your current systemd-boot configuration, if you followed [the
INSTALLATION guide](./01_INSTALLATION.md), you will have it in:
`/efi/loader/entries/arch.conf`, all of the `options=` line contain
kernel command line args):
```bash
echo "rw loglevel=3" > /etc/kernel/cmdline
echo "cryptdevice=LABEL=CRYPTFS:cryptfs:allow-discards" >> /etc/kernel/cmdline
echo "root=/dev/mapper/cryptfs rootflags=subvol=/@" >> /etc/kernel/cmdline
```
<!-- markdownlint-disable MD028 -->
> [!TIP]
> If you prefer, you can also create `/etc/kernel/cmdline.d` directory, with
> individual files for various parts of the command line. At the end, all of the
> options from all files in this directory will be combined.
>
> You might find this useful if you set a lot of kernel parameters, so you might
> have for example: `root.conf`, `apparmor.conf`, ...
> [!IMPORTANT]
> Note that you **shouldn't** be specifying the `cryptdevice` or `root` kernel
> parameters if you're using `systemd` initramfs, rather than `BusyBox` one
> (which mkinitramfs generates by default).
>
> That said, you will still need `rootflags` to select the btrfs subvolume
> though, unless the root partition is your default subvolume.
>
> If you aren't sure which initramfs you're using, it's probably `BusyBox`.
<!-- markdownlint-disable MD028 -->
## Modify the linux preset for mkinitcpio to build UKIs
Now open `/etc/mkinitcpio.d/linux.preset`, where you'll want to:
- Uncomment `ALL_config`
- Comment `default_image`
- Uncomment `default_uki` (unified kernel image)
- Uncomment `default_options`
- Comment `fallback_image`
- Uncomment `fallback_uki`
## Recreate /efi
First, we'll need to unmount `/boot`, which is currently bind-mounted to
`/efi/EFI/arch`. This is because we'll no longer be storing the kernel,
initramfs, nor the microcode in the EFI partition at all. The EFI partition will
now only contain the final UKI, the rest can be left in `/boot`, which will now
be a part of the root partition, not mounted anywhere.
```bash
umount /boot
vim /etc/fstab # remove the bind mount entry for /boot
```
Now, we will clear the EFI partition and install `systemd-boot` again from
scratch:
```bash
rm -rf /efi/*
```
Now, we will create a `/efi/EFI/Linux` directory, which will contain all of our
UKIs. (You can change the location in `/etc/mkinitcpio.d/linux.preset` if you
wish to use some other directory in the EFI partition, or you want a different
name for the UKI file. Note that it is recommended that you stick with the same
directory, as most boot loaders will look there when searching for UKIs.)
```bash
mkdir -p /efi/EFI/Linux
```
Finally, we will reinstall the kernel and microcode, re-populating `/boot` (now
on the root partition).
This will also trigger a initramfs rebuild, which will now create the UKI image
based on the `linux.preset` file.
```bash
pacman -S linux amd-ucode # or intel-ucode
```
## Proceeding without a boot manager
Because the Unified Kernel Images can actually be booted into directly from the
UEFI, you don't need to have a boot manager installed at all. Instead, you can
simply add the UKIs as entries to the UEFI boot menu.
> [!NOTE]
> I prefer to still use a full boot manager alongside UKIs, as they allow you to
> have a nice graphical boot menu, from which you can dynamically override the
> kernel parameters during boot, or have extra entries for different operating
> systems, without having to rely on the specific implementation of the boot
> menu in your UEFI firmware (which might take really long to open, or just
> generally not provide that good/clean experience).
>
> Do note though that going without a boot manager is technically a safer
> approach, as it cuts out the middle-man entirely, whereas with a boot manager,
> your UEFI firmware will be booting the EFI image of your boot manager, only to
> then boot your own EFI image, being the UKI.
>
> Regardless, I still like to use `systemd-boot`, instead of booting UKIs
> directly. If you wish to do the same, skip this section.
<!-- markdownlint-disable MD013 -->
```bash
pacman -S efibootmgr
efibootmgr --create --disk /dev/disk/nvme0n1 --part 1 --label "Arch Linux" --loader 'EFI\Linux\arch-linux.efi' --unicode
efibootmgr -c -d /dev/disk/nvme0n1 -p 1 -L "Arch Linux Fallback" -l 'EFI\Linux\arch-linux-fallback.efi' -u
pacman -R systemd-boot
```
<!-- markdownlint-enable MD013 -->
You can also specify additional kernel parameters / override the default ones in
the UKI, by simply adding a string as a last positional argument to the
`efibootmgr` command, allowing you to create entires with different kernel
command lines easily.
## Proceeding with a boot manager
> [!NOTE]
> This is an alternative to the above, see the note in the previous section to
> understand the benefits/cons of either approach.
Most boot managers can handle loading your UKIs. The boot manager of my choice
is `systemd-boot`, but if you wish, you should be able to use grub, or any other
boot manager too. That said, this guide will only mention `systemd-boot`.
All that we'll need to do now is installing systemd-boot, just like during the
initial OS installation:
````bash
```bash
bootctl install --esp-path=/efi
````
We can now reboot. Systemd-boot will pick up any UKI images in `/efi/EFI/Linux`
automatically (this path is hard-coded), even without any entry configurations.
That said, if you do wish to do so, you can still add an explicit entry for your
configuration in `/efi/loader/entries/arch.conf`, like so:
```text
title Arch Linux
sort-key 0
efi /EFI/Linux/arch-linux.efi
# If you wish, you can also specify kernel options here, it will
# append/override those in the UKI image
#options rootflags=subvol=/@
#options rw loglevel=3
```
Although do note that if your UKI image is stored in `/efi/EFI/Linux`, because
systemd-boot picks it up automatically, you will see the entry twice, so you'll
likely want to change the target directory for the UKIs (in
`/etc/mkinitcpio.d/linux.preset`) to something else.
I however wouldn't recommend this approach, and I instead just let systemd-boot
autodetect the images, unless you need something specific.
If everything went well, you should see a new systemd based initramfs, from
where you'll be prompted for the LUKS2 password.

186
guides/04_SECURE_BOOT.md Normal file
View file

@ -0,0 +1,186 @@
# Secure Boot
This guide will show you how to set up UEFI Secure Boot with Arch Linux. Once
finished, you will be left with a system that doesn't allow booting any
untrusted EFI images (other operating systems, fraudulently modified kernels,
...) on your machine.
This guide assumes you're following from the
[INSTALLATION](./01_INSTALLATION.md) guide and that you're using [UNIFIED KERNEL
IMAGES](./03_UNIFIED_KERNEL_IMAGES.md) (UKIs) for booting.
## Security requirements
Meeting these requirements is optional, as it is possible to set up secure boot
without them. That said, if you don't meet these, setting up secure boot will
not be a very effective security measure and it might be more of a time waste
than a helpful means of enhancing your security.
First requirement is to set up a **BIOS Password**. This is a password that you
will be asked for every time you wish to enter the BIOS (UEFI). This is
necessary, as without it, an attacker could very easily just go to the BIOS and
disable Secure Boot.
The second requirement is having **disk encryption**, at least for the root
partition. This is important, because the UEFI signing keys will be stored here,
and you don't want someone to potentially be able to get access to them, as it
would allow them to sign any malicious images, making them pass secure boot.
> [!WARNING]
> Even after following all of these, you should be aware that Secure Boot isn't
> an unbreakable solution. In fact, if someone is able to get a hold of your
> machine, they can simply pull out the CMOS battery, which usually resets the
> UEFI. That means turning off Secure Boot, and getting rid of the BIOS
> password.
>
> While Secure Boot is generally a good extra measure to have, it is by no means
> a reliable way to completely prevent others from ever being able to boot
> untrusted systems, unless you use a specialized motherboard, which persists
> the UEFI state.
## Enter Setup mode
To allow us to upload new signing keys into secure boot, we will need to enter
"setup mode". This should be possible by going to the Secure Boot category in
your UEFI settings, and clicking on Delete/Clear certificates, or there could
even just be a "Setup Mode" option directly.
Once enabled, save the changes and boot back into Arch linux.
```bash
pacman -S sbctl
sbctl status
```
Make sure that `sbctl` reports that Setup Mode is Enabled.
## Create Secure Boot keys
We can now create our new signing keys for secure boot. These keys will be
stored in `/usr/share/secureboot` (so in our encrypted root partition). Once
created, we will add (enroll) these keys into the UEFI firmware (only possible
when in setup mode)
```bash
sbctl create-keys
sbctl enroll-keys -m
```
<!-- markdownlint-disable MD028 -->
> [!WARNING]
> The `-m` option (also known as `--microsoft`) will make sure to also include
> the Microsoft signing keys. This is required by most motherboards, not using
> it could brick your device.
> [!NOTE]
> If you encounter "File is immutable" warnings after running sbctl, it should
> be safe to simply add the `-i` (or `--ignore-immutable`) flag, which will run
> `chattr` and remove the immutable flags from these files for you.
>
> You can also do so manually with `chattr -i [file]` for all the listed
> immutable files and then re-run the enroll-keys command.
>
> This happens because the Linux kernel will sometimes mark the runtime EFI
> files as immutable for security - to prevent bricking the device with just `rm
-rf /*`, or similar stupid commands, however since we trust that `sbctl` will
> work and won't do anything malicious, we can just remove the immutable flag,
> and re-running will now work).
>
> If you still encounter errors even with this flag, it means you have probably
> done something wrong when entering the setup mode. Try looking for a option
> like "Reset keys" in your UEFI, then try this again.
<!-- markdownlint-enable MD028 -->
## Sign the bootloader and Unified Kernel Images
Finally then, we can sign the `.efi` executables that we'd like to use:
```bash
sbctl sign -s -o /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed /usr/lib/systemd/boot/efi/systemd-bootx64.efi
sbctl sign -s /efi/EFI/BOOT/BOOTX64.EFI
sbctl sign -s /efi/EFI/systemd/systemd-bootx64.efi
sbctl sign -s /efi/EFI/Linux/arch-linux.efi
sbctl sign -s /efi/EFI/Linux/arch-linux-fallback.efi
```
(If you're booting directly from UKI images, only sign those - in `/efi/EFI/Linux`)
The `-s` flag means save: The files will be automatically re-signed when we
update the kernel (via a sbctl pacman hook).
> [!TIP]
> To make sure that this is the case, we can run `pacman -S linux` and check
> that messages about image signing appear.
>
> They should look something like this:
>
> ```text
> Signing /efi/EFI/Linux/arch-linux.efi
> ✓ Signed /efi/EFI/Linux/arch-linux.efi
> ...
> Signing /efi/EFI/Linux/arch-linux-fallback.efi
> ✓ Signed /efi/EFI/Linux/arch-linux-fallback.efi
> ...
> File has already been signed /efi/EFI/Linux/arch-linux-fallback.efi
> File has already been signed /efi/EFI/Linux/arch-linux.efi
> File has already been signed /efi/EFI/systemd/systemd-bootx64.efi
> File has already been signed /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed
> File has already been signed /efi/EFI/BOOT/BOOTX64.EFI
> ```
When done, we can make sure that everything that needed to be signed really was
signed with:
```bash
sbctl verify
```
You can also check that setup mode got disabled after enrolling the keys:
```bash
sbctl status
```
Setup mode status should now report as `Disabled`. (Secure boot will still not
appear as enabled though.)
## Reboot with secure boot
We should now be ready to enable secure boot, as our `.efi` images were signed,
and the signing key was enrolled to UEFI firmware. So, all that remains is:
```bash
reboot
```
Boot into UEFI, go to the Secure Boot settings and enable it. (It might get
enabled automatically on some UEFI firmware after setup mode, but it's not
always the case.)
### Verify it worked
To make sure that it worked as expected, and you're booted with secure-boot
enabled, you can now run:
```bash
sbctl status
```
It should report `Secure Boot: enabled` or `Secure Boot: enabled (user)`.
## Why bother?
As I mentioned, secure boot can be bypassed if someone tries hard enough
(pulling the CMOS battery). That then brings to question whether it's even worth
it to set it up, when it doesn't really give you that much.
On its own, I probably wouldn't bother with setting up secure-boot, however
secure boot allows me to set up TPM (Trusted Platform Module) to automatically
release the decryption keys for my LUKS encrypted root partition, in a secure
way. This means I won't have to type my disk password every time I boot which is
actually the primary reason why I like having secure-boot enabled.
For more information on this, check out the follow-up guide:
[TPM_UNLOCKING](./06_TPM_UNLOCKING.md).

View file

@ -0,0 +1,211 @@
# Systemd initramfs
The initial ramdisk is in essence a very small environment (early userspace)
whihc loads various kernel modules and sets up necessary things before handing
control over to `init` program (systemd).
By default, Arch Linux uses a BusyBox+udev based initial ramdisk, generated by
`mkinitcpio`. This default initrd is essentially just a small script, that
executes other scripts, called hooks.
As an alternative to this, it's possible to have systemd run from the very
start, during that initial ramdisk phase. With this approach, the tasks ran at
this phase are determined by regular systemd unit files.
## Why?
Obviously, BusyBox initramfs works just fine, so why would you want to switch?
Well, there's a few reasons:
- **Consistency across boot phases:** The same systemd process that handles your
system after boot can also manage the early userspace during boot, providing
consistency in handling services, devices and dependencies throughout the
entire boot process.
- **Simplified troubleshooting:** The tools and logs available during the boot
process will be the same as those used once the system is fully booted,
allowing you to troubleshoot problems with familiar tools (`journalctl`,
`systemctl`, ...)
- **Consistent Unit Files:** Since systemd uses the same unit files in the
initramfs as it does in the fully booted system, the configuration for many
tasks (like mounting filesystems) is unified, reducing duplication of
configuration files.
- **TPM Unlocking Support:** Systemd has built-in support for requesting data
from TPM, allowing for a setup with TPM auto-unlocking an encrypted root
partition, without having to specify the decryption password.
- **Parallel Service Startup:** Systemd is known for the ability to start
services in parallel, which can potentially **speed up the boot process**
compared to sequential script-based approach.
- **Integrated Mount Handling:** With systemd, managing complex mount setup
(e.g. LVM RAID) can be more seamless, since it natively supports these and can
handle them with less custom scripting.
That said, it's important to also mention some downsides and reasons why you
might not want to use systemd-based initramfs:
- **Simplicity:** If you prefer a simple, more minimalistic approach,
BusyBox-based initramfs might be sufficient and easier to manage.
- **Size:** A systemd-based initramfs might be larger than a minimal
BusyBox-based initramfs, which could be a concern on systems with very limited
space.
- **Compatibility:** If you're running some custom scripts or hooks, they might
not work with a systemd-based initramfs.
## Switching to systemd initramfs
Open `/etc/mkinitcpio.conf` and find a line that starts with `HOOKS=`
- Change `udev` to `systemd`
- Change `keymap consolefont` to `sd-vconsole`
- Add `sd-encrypt` before `block`, and remove `encrypt`
- If you were using `mkinitcpio-numlock`, also remove `numlock`, it doesn't work
with systemd (we'll go over how to auto-enable numlock later)
Additionally, with systemd initramfs, you shouldn't be specifying `root` nor
`cryptdevice` kernel arguments, as systemd can actually pick those up
automatically (they'll be discovered by [systemd-cryptsetup-generator] and
auto-mounted from initramfs via [systemd-gpt-auto-generator]). We will however
still need the `rootflags` argument for selecting the btrfs subvolume (unless
your default subvolume is the root partition subvolume).
[systemd-cryptsetup-generator]: https://wiki.archlinux.org/title/Dm-crypt/System_configuration#Using_systemd-cryptsetup-generator
[systemd-gpt-auto-generator]: https://wiki.archlinux.org/title/Systemd#GPT_partition_automounting
So, let's edit our kernel parameters:
```bash
echo "rw loglevel=3" > /etc/kernel/cmdline # overwrite the existing cmdline
echo "rootflags=subvol=/@" >> /etc/kernel/cmdline
```
You'll also need to modify the `/etc/fstab`, as systemd will not use the
`/dev/mapper/cryptfs` name, but rather you'll have a `/dev/gpt-auto-root`
(there'll also be `/dev/gpt-auto-root-luks`, which is the encrypted partition).
If you prefer using a mapper device, you can also use `/dev/mapper/root`.
Alternatively, you can use the label to mount. (if you followed the
installation guide, that would be `/dev/disk/by-label/FS`.)
```bash
vim /etc/fstab
```
Finally, regenerate the initramfs with: `pacman -S linux` (you could also do
`mkinitcpio -P`, however that won't trigger the pacman hook which auto-signs our
UKI images for secure boot, so you'd have to re-sign them with `sbctl` manually,
if you're using secure-boot) and reboot to check if it worked.
## Activating numlock
Since we had to remove `mkinitcpio-numlock`, as that hook isintended for BusyBox
based initrd, we'll want to have an alternative available.
First though, we should also remove the package: `pacman -R mkinitcpio-numlock`.
### The simple, but imperfect option
There is a `systemd-numlockontty` AUR package which creates a systemd service
that enables numlock in TTYs after booting (you'll need to enable it), this
however doesn't happen in initramfs directly, only afterwards.
Depending on what you will need, this may be sufficient. If you are going to be
typing a decryption password at this early stage and you wish to have numlock
support there, you will need to do some more work.
### The proper solution
To enable numlock before you're prompted for the decryption password, we'll need
to create a custom initcpio hook, that will return a systemd service which will
do the enabling. We'll put this hook into `/usr/lib/initcpio/install/numlock`,
with the following content:
```bash
#!/bin/bash
build() {
add_binary /bin/bash
add_binary /usr/bin/setleds
add_binary /usr/local/bin/numlock
cat >"$BUILDROOT/usr/lib/systemd/system/numlock.service" <<EOF
[Unit]
Description=Enable numlock
Before=cryptsetup-pre.target
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/numlock
EOF
add_systemd_unit cryptsetup-pre.target
cd "$BUILDROOT/usr/lib/systemd/system/sysinit.target.wants" || exit
ln -sf /usr/lib/systemd/system/cryptsetup-pre.target cryptsetup-pre.target
ln -sf /usr/lib/systemd/system/numlock.service numlock.service
}
help() {
cat <<EOF
This hook adds support to enable numlock before sd-encrypt hook is run.
EOF
}
```
This script is also present in my dotfiles, so you can just copy it from there:
```bash
cp ~/dots/root/usr/lib/initcpio/install/numlock /usr/lib/initcpio/install
```
Next we will need to create that `/usr/local/bin/numlock` script. This script
will do the actual enabling of numlock. Note that we can only use the binaries
that we explicitly included in our hook inside our script.
```bash
#!/bin/bash
for tty in /dev/tty[0-9]; do
/usr/bin/setleds -D +num < "$tty"
done
```
If you ran the `install_root.sh` script from my dotfiles during
[INSTALLATION](./01_INSTALLATION.md), this script will already be present in
your `/usr/local/bin`
Now we will need to add our custom new `numlock` hook to
`/etc/mkinitcpio.conf`, before the `sd-encrypt` hook (assuming you're using
encryption), but after the `keyboard` and `sd-vconsole` hooks.
Finally, we'll need to rebuild initramfs, which we should trigger with `sudo
pacman -S linux`, to make sure the secure-boot signing also runs. When
re-building the initramfs, pay attention on the output, you should see it pass
with no errors:
```text
-> Running build hook: [base]
-> Running build hook: [systemd]
-> Running build hook: [autodetect]
-> Running build hook: [microcode]
-> Running build hook: [modconf]
-> Running build hook: [kms]
-> Running build hook: [keyboard]
-> Running build hook: [sd-vconsole]
-> Running build hook: [numlock] # <-- make sure this is present
-> Running build hook: [sd-encrypt]
-> Running build hook: [block]
-> Running build hook: [filesystems]
-> Running build hook: [fsck]
```
> [!NOTE]
> If you see some warnings there, like:
> `==> WARNING: Possibly missing firmware for module: 'xyz'`, you can usually
> safely ignore these. Just make sure there's no `==> ERROR: ...`
If you didn't see any errors, you can now reboot.
> [!IMPORTANT]
> In some cases, the numlock led indicator might not turn on immediately, even
> though numlock was actually turned on. This may mislead you towards thinking
> it is not on, even though it actually is. I'd recommend trying it out by
> actually typing something it at this time.
>
> Note that after this early boot stage, the indicator should light up
> eventually.

227
guides/06_TPM_UNLOCKING.md Normal file
View file

@ -0,0 +1,227 @@
# TPM Unlocking
This will explain how to set up TPM (Trusted Platform Module) based automatic
unlocking of your LUKS encrypted partition(s). Encryption usually requires that
you manually type the password in each time you boot. This can however be pretty
annoying (especially if you use a long password, like I do). This guide aims to
fix this problem, without compromising security.
Once finished, this will basically store another decryption key(s) to your
encrypted partition(s) in the TPM module. During boot, while in initrd, we will
request this decryption key from TPM, which will only release it under certain
conditions, to ensure safety.
The guide assumes you have already a working Arch Linux system, that uses LUKS
encryption, having followed the [INSTALLATION guide](./01_INSTALLATION.md). You
will also need to set up secure-boot, as described in
[SECURE_BOOT](./04_SECURE_BOOT.md). This is a requirement, as while it is
possible to set up TPM unlocking without it, doing so is incredibly insecure,
and might lead to unauthorized users getting TPM to release your decryption
keys. Additionally, you will need to be using a [SYSTEMD BASED
INITRAMFS](./05_SYSTEMD_INITRAMFS.md), as the default BusyBox one doesn't
support TPM unlocking.
> [!WARNING]
> This solution will be mostly safe, however, it is technically possible to hook
> up wires to the motherboard, to listen to the communication coming from the
> TPM chip. In that case, the attacker would be able to observe the key as it
> gets released by the chip. They could then take out your SSD/HDD, and mount it
> on their machine, using these obtained keys to decrypt the contents. See:
> <https://astralvx.com/stealing-the-bitlocker-key-from-a-tpm/>
>
> If you can't afford to be vulnerable to this type of attack, you can still
> follow through with this, however instead of the TPM seamlessly releasing the
> decryption password, you can require a password to be entered, without which
> TPM won't release the decryption password.
>
> This can be useful if you use a very long encryption passwords, and you want
> to be able to enter a shorter passphrase instead (TPM has brute-force
> protection, so a short password isn't actually that unsafe to use).
## Check if you actually have the TPM module
First, you will want to verify that your machine even has the TPM v2 module. To
do so, you can use the following command:
```bash
bootctl status
```
You should see `TPM2 Support: yes` in the output.
## Choosing PCRs
PCR stands for Platform Configuration Register, and all TPM v2 modules have a
bunch of these registers, which hold hashes about the system's state. These
registers are read-only, and their value is set by the TPM module itself.
The data held by the TPM module (our LUKS encryption key) can then only be
accessed when all of the selected PCR registers contain the expected values. You
can find a list of the PCR registers on [Arch
Wiki](https://wiki.archlinux.org/title/Trusted_Platform_Module#Accessing_PCR_registers).
You can look at the current values of these registers with this command:
```bash
systemd-analyze pcrs
```
For our purposes, we will choose these:
- **PCR0:** Hash of the UEFI firmware executable code (may change if you update
UEFI)
- **PCR7:** Secure boot state - contains the certificates used to validate each
boot application
- **PCR12:** Overridden kernel command line, credentials
> [!IMPORTANT]
> If you're using a boot loader (rather than booting directly from the Unified
> Kernel Images - EFI files), it is crucial that we choose all 3, including
> PCR12, as many tutorials only recommend 0 and 7, which would however lead to a
> security hole, where an attacker would be able to remove the drive with the
> (unencrypted) EFI partition, and modify the boot loader config. (With
> systemd-boot, this would be `loaders/loader.conf`).
>
> From there, the attacker could simply add a kernel argument like
> `init=/bin/bash`, or just enable editor support, allowing them to edit the
> parameters from the boot menu on the fly (The editor is actually enabled by
> default for systemd-boot). This would then bypass systemd as the init system
> and instead make the kernel run bash executable as the PID=1 (init) program.
> This would mean you would get directly into bash console that is running as
> root, without any need to enter a password.
>
> From that bash console, they could get the TPM to release the decryption
> password manually, as all of the selected PCRs do match.
>
> This wouldn't violate secure boot, as the `.efi` image files were unchanged,
> and are still signed, so the attacker would be able to boot into the system
> without issues.
>
> However, with PCR12, this is prevented, as it detects that the kernel cmdline
> arguments which were used, and if they don't match the recorded parameters
> during enrollment, TPM will not release the key.
>
> The nice thing about also selecting PCR12 is that it will actually allow us to
> securely keep systemd-boot editor support, which can be very useful for
> debugging, as all that will happen if we do edit the kernel command line will
> be that the TPM module will not release the credentials, and the initrd will
> just ask us to enter the password manually.
Optionally, you may also consider these:
- **PCR1:** Hash of the UEFI firmware data (changes when you change your BIOS settings)
- **PCR4:** Boot manager (changes when you change the boot manager)
> [!NOTE]
> You may be tempted to also add **PCR11**, which is a hash of the Unified
> Kernel Image, so that no other UKI can be booted, but this isn't necessary,
> as we're signing our UKIs, which means untrusted ones wouldn't pass secure
> boot, and if secure boot got disabled, PCR7 wouldn't pass.
>
> Additionally, enabling PCR11 would mean that you'd need to update the TPM
> every time your kernel/microcode/initrd/... is updated, as these will change
> the UKI file.
## Enroll a new key into TPM
The following command will enroll a new randomly generated key into the TPM
module and add it as a new keyslot of the specified LUKS2 encrypted device.
We also specify `--tpm2-pcrs=0+7+12`, which selects the PCR registers that we
decided on above.
```bash
sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7+12 /dev/gpt-auto-root-luks
```
<!-- markdownlint-disable MD028 -->
> [!NOTE]
> If you already have something in the tpm2 module, you'll want to add
> `--wipe-slot=tpm2` too.
>
> Note that wiping the slot will also remove the LUKS key slot that was added
> in the partition.
> [!TIP]
> If you're extra paranoid, you can also provide `--tpm2-with-pin=yes`, to
> prompt for a PIN code (passphrase) on each boot.
>
> I have mentioned why you may want to do this in the beginning.
>
> In case you do want to go with a PIN, you can also safely drop PCR12, as you
> will be asked for credentials each time anyways, and at that point, the TPM
> unlocking is basically just as secure as regular passphrase unlocking, which
> systemd would fall back to if PCR12 wasn't met.
<!-- markdownlint-enable MD028 -->
You will now be prompted for an existing LUKS password (needed to add a new LUKS
keyslot).
## Reboot
All that remains now is rebooting. The system should now get unlocked
automatically, without prompting for the password / prompting for the TPM PIN
instead of a decryption password.
If you're using a bootloader, I'd recommend also trying to modify the kernel
parameters, to make sure that TPM does not release the key anymore, and you will
be prompted to enter it manually.
## Moving to a recovery key
Once you have confirmed that TPM unlocking is working, you can now optionally
get rid of your original LUKS key, in favor of a randomly generated recovery
key.
You might want to do this as this recovery key will be guaranteed to have high
entropy, likely making it a lot more secure than your original key, further
improving your chances, if someone attempts a brute-force decryption of your
drive.
To generate a recovery key, you can actually also just use `systemd-cryptenroll`
(though you can also do it manually with `cryptsetup`):
```bash
systemd-cryptenroll /dev/gpt-auto-root-luks --recovery-key
```
This will give you a randomized key, using characters that are easy to type. You
will even be given a QR code that can be scanned directly to save the password
on your phone.
Before proceeding with removing your own key, let's first make absolutely
certain that the recovery key you saved does in fact work. Without doing this,
you may get locked out!
```bash
cryptsetup luksOpen /dev/gpt-auto-root-luks crypttemp # enter the recovery key
cryptsetup luksClose crypttemp
```
If this worked, proceed to:
```bash
cryptsetup luksRemoveKey /dev/gpt-auto-root-luks # Enter the original key to be deleted
```
## Removing the key from TPM
In case you'd ever want to remove the LUKS key from TPM, you can do so simply
with:
```bash
csystemd-cryptenroll --wipe-slot=tpm2
```
This will actually also remove the LUKS key from the `/dev/gpt-auto-root-luks`
device as well as wiping it from the TPM2 chip.
## Sources / Attribution
- <https://nixos.wiki/wiki/TPM>
- <https://discourse.nixos.org/t/full-disk-encryption-tpm2/29454/6>
- <https://wiki.archlinux.org/title/systemd-cryptenroll>
- <https://wiki.archlinux.org/title/Trusted_Platform_Module#Accessing_PCR_registers>
- <https://pawitp.medium.com/full-disk-encryption-on-arch-linux-backed-by-tpm-2-0-c0892cab9704>

View file

@ -0,0 +1,280 @@
# Battery Optimizations
This guide goes over the various optimizations for laptops that you can
configure to improve your battery life.
> [!IMPORTANT]
> You will need to follow this guide even if you're using my dotfiles, as it
> requires enabling certain services which I don't enable automatically from
> the installation scripts.
>
> This is because not all devices need power management services running
> (desktop devices don't have a battery).
## UPower
UPower is a DBus service that provides power management support to
applications, which can request data about the current power state through this
DBus interface.
Additionally, UPower can perform a certain action when your battery life
reaches a critical point, like entering hibarnation when below 2%.
```bash
pacman -S upower
systemctl start --now upower
```
You can adjust UPower configuration in `/etc/UPower/UPower.conf`, I quite like
the defaults settings here. The relevant settings to look at are:
```conf
PercentageLow=20.0
PercentageCritical=5.0
PercentageAction=2.0
CriticalPowerAction=HybridSleep
```
## Acpid
Acpid is a daemon that can deliver ACPI power management events. When an event
occurs, it executes a program to handle that event. These events are:
- Pressing special keys, including the Power/Sleep/Suspend button, but also
things like wlan/airplane mode toggle button, volume buttons, brightness, ...
- Closing a notebook lid
- (Un)Plugging an AC power adapter from a notebook
- (Un)Plugging phone jack etc.
By default, these events would otherwise go unhandled, which isn't ideal.
```bash
pacman -S acpid
systemctl enable --now acpid
```
> [!TIP]
> By default `acpid` already has some basic handling of these ACPI events, so
> you shouldn't need to change anything, however, if you would want to run
> something custom on one of these events, you can configure it to do so in
> `/etc/acpi/handler.sh`
## Systemd suspend-then-hibernate
I like to use `systemctl suspend-then-hibernate` command when entering a
suspend state (usually configured from an idle daemon, such as hypridle or
swayidle). This command allows my system to remain suspended for some amount of
time, after which it will enter hibernation. This is really nice, because if I
forget that I had my laptop suspended and leave it like that while unplugged
for a long amount of time, this will prevent the battery from being drained for
no reason.
To configure automatic hibernation with this command, we'll want to modify
`/etc/systemd/sleep.conf`, and add:
```conf
HibernateDelaySec=10800
```
That will configure automatic hibernation after 3 hours of being in a suspend
state.
## Power Profiles Daemon
Many people like using something complex like TLP to manage power, however, in
many cases, you can achieve good results with something much simpler:
`power-profiles-daemon`.
Simply put, `power-profiles-daemon` is a CPU throttle, allowing you to switch
between various "power profiles" (power-saver, balanced, performance). I like
using a custom shell-script that checks the current battery percentage and
status (charging/discharging) and dynamically set the power profile based on
these values.
<!-- markdownlint-disable MD028 -->
> [!NOTE]
> Power Profiles Daemon only performs a subset of what TLP would do. Which of
> these tools you wish to use depends on your workfload and preferences:
>
> - If the laptop frequently runs under medium or high load, such as during
> video playback or compiling, using `power-saver` profile with
> `power-profiles-daemon` can provide similar energy savings as TLP.
> - However, TLP offers advantages over `power-profiles-daemon` when the laptop
> is idle, such as during periods of no user input or low load operations
> like text editing or browsing.
>
> In my personal opinion, `power-profiles-daemon` is quite sufficient and I
> don't have a great need for TLP. Also TLP is actually quite limiting in it's
> configuration in comparison to being able to use something like a shell script
> and switch profiles depending on both the charging state & the current
> percentage or any other custom rules whereas TLP only exposes some simple
> configuration options, that will enable performance/balanced mode when on AC
> power and power-safe when on battery power, but you can't really mess with
> anything more dynamic.
> [!TIP]
> If you think you'd prefer TLP over `power-profiles-daemon`, feel free to skip
> this section, the section below will cover TLP as an alternative to this.
> [!TIP]
> It may be worth it to look into
> [`system76-power`](https://github.com/pop-os/system76-power) as an
> alternative to `power-profiles-daemon`.
<!-- markdownlint-enable MD028 -->
To set up power-profiles-daemon, we'll first install it and enable it as a
systemd service:
```bash
pacman -S power-profiles-daemon
systemctl enable --now power-profiles-daemon
```
### Setting power profile manually
To try things out, you can set the power profile manually, using
`powerprofilesctl` command:
```bash
powerprofilesctl set power-saver
powerprofilesctl set balanced
powerprofilesctl set performance # won't work on all machines
```
However, having to set your power profile manually each time wouldn't be very
convenient, so I'm only showing this as an example / something you can try out
initially to see what results it can give you.
### Setting power profiles automatically
To make `power-profiles-daemon` actually useful and seamless, I like using a
shell script that monitors the battery state and switches the power mode
depending on certain conditions. I like placing my system-wide scripts into
`/usr/local/bin`, so let's use: `/usr/local/bin/power-profiles-monitor`:
<!-- markdownlint-disable MD013 -->
```bash
#!/usr/bin/env bash
set -euo pipefail
if [ "$EUID" -ne 0 ]; then
echo "You must run this script as root"
exit 1
fi
BAT=$(echo /sys/class/power_supply/BAT*) # only supports single-battery systems
BAT_STATUS="$BAT/status"
BAT_CAP="$BAT/capacity"
OVERRIDE_FLAG="/tmp/power-monitor-override"
POWER_SAVE_PERCENT=50 # Enter power-save mode if on bat and below this capacity
HAS_PERFORMANCE="$(powerprofilesctl list | grep "performance" || true)" # the || true ignores grep failing with non-zero code
# monitor loop
prev=0
while true; do
# check if override is set
if [ -f "$OVERRIDE_FLAG" ]; then
echo "Override flag set, waiting for release"
inotifywait -qq "$OVERRIDE_FLAG"
continue
fi
# read the current state
status="$(cat "$BAT_STATUS")"
capacity="$(cat "$BAT_CAP")"
if [[ $status == "Discharging" ]]; then
if [[ $capacity -le $POWER_SAVE_PERCENT ]]; then
profile="power-saver"
else
profile="balanced"
fi
else
if [[ -n $HAS_PERFORMANCE ]]; then
profile="performance"
else
profile="balanced"
fi
fi
# Set the new profile
if [[ "$profile" != "$prev" ]]; then
echo -en "Setting power profile to ${profile}\n"
powerprofilesctl set $profile
prev=$profile
fi
# wait for changes in status or capacity files
# i.e. for the next power change event
inotifywait -qq "$BAT_STATUS" "$BAT_CAP"
done
```
<!-- markdownlint-enable MD013 -->
> [!NOTE]
> You will need `inotify-tools` package installed for the `inotifywait` command
> to work.
As you can see, it's a pretty simple script, that will run forever, but spend
most time just waiting for the battery status to change, re-running once it
does.
We could now run this script manually, but that's not a great solution,
instead, we can create a custom systemd service which will run it for us
automatically. To do this, we'll create a new file:
`/etc/systemd/system/power-profiles-monitor.service` with the following
content:
```systemd
[Unit]
Description=Monitor the battery status, switching power profiles accordingly
Wants=power-profiles-daemon.service
[Service]
ExecStart=/usr/local/bin/power-profiles-monitor
Restart=on-failure
Type=simple
[Install]
WantedBy=default.target
```
With that, we can now enable our service:
```bash
systemctl daemon-reload # make systemd aware of the new service
systemctl enable --now power-profiles-monitor
```
> [!TIP]
> You may have noticed that the script
## TLP
> [!IMPORTANT]
> TLP is an alternative solution to handle power management, it cannot be used
> in combination with `power-profiles-daemon`.
TODO: This section is work-in-progress, as I'm not using TLP right now.
If you wish to set up TLP, I'd suggest that you check out the official [TLP
documentation](https://linrunner.de/tlp/introduction.html), alongside with a
guide on achieving a similar profile switching behavior as
`power-profiles-daemon` offers with it:
[here](https://linrunner.de/tlp/faq/ppd.html). Additionally, there is an [Arch
Linux Wiki page for TLP](https://wiki.archlinux.org/title/TLP).
## Sources
- <https://wiki.archlinux.org/title/Power_management>
- <https://wiki.archlinux.org/title/Acpid>
- <https://gitlab.freedesktop.org/upower/power-profiles-daemon>
- <https://linrunner.de/tlp/introduction.html>
- <https://linrunner.de/tlp/faq/ppd.html>
- <https://wiki.archlinux.org/title/TLP>

152
guides/99_GREETD.md Normal file
View file

@ -0,0 +1,152 @@
# Greetd
This guide goes over how to setup `greetd`, which is a minimalistic Display
Manager (DM) that starts right after boot and asks the user to log in.
A DM is useful for letting you pick which session you wish to load after
logging in (e.g. which WM/DE), but also to provide a slightly nicer UI in
comparison to the default `agetty` TTY based login screen.
Another neat feature that greetd offers is automatic login, which will allow
you to skip the login process entirely, logging you in right after the boot.
This can be useful if you're already typing in your LUKS encryption password
each time after a boot, which already acts as a sufficient layer of protection
against attackers trying to enter your system.
<!-- markdownlint-disable MD028 -->
> [!WARNING]
> If you've set up TPM unlocking for your LUKS encryption, setting up automatic
> login is not safe, unless you're using a TPM passphrase/PIN.
> [!IMPORTANT]
> If you're following while using my dotfiles, you will need to manually place
> the greetd config from the repo into `/etc/greed/config.toml`. The
> installation scripts don't do this, as many people prefer not using a
> greeter.
>
> You will also need to follow the installation instructions to download greetd
> and enable it.
<!-- markdownlint-enable MD028 -->
## Greetd + tuigreet
Since I prefer a minimalistic approach to most things in my system, I like to
use a terminal based greeter. Greetd itself is just a daemon that supports
various greeters. Most of these greeters are graphical, but there are terminal
based ones too, most notably `tuigreet`, which works right from the TTY.
First, install and enable greetd, to make sure it gets started on boot.
```bash
sudo pacman -S greetd greetd-tuigreet
sudo systemctl enable greetd
```
Now, we will want to define our greetd configuration in
`/etc/greetd/config.toml`. There should already be a default configuraion that
uses `agreety` greeter, which is similar to `agetty`, we'll want to change that
to `tuigreet`, which in my opinion looks a lot better. We can use the following
config:
<!-- markdownlint-disable MD013 -->
```toml
[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 1
# The default session, also known as the greeter.
[default_session]
command = "tuigreet --time --remember --remember-user-session --asterisks --greeting 'Stop staring and log in already' --theme 'border=magenta;text=cyan;prompt=green;time=red;action=white;button=yellow;container=black;input=gray' --sessions /usr/share/wayland-sessions --xsessions /usr/share/xsessions --session-wrapper /usr/local/bin/greetd-session-wrapper --xsession-wrapper /usr/local/bin/greetd-session-wrapper startx /usr/bin/env"
# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "greeter"
```
<!-- markdownlint-enable MD013 -->
> [!NOTE]
> I know the `tuigreet` command is really hard to orient in when written in a
> single line like this, however, attempting to use a multi-line string doesn't
> seem to work with greetd (even though it is a part of the TOML standard).
> This issue has already been
> [reported](https://lists.sr.ht/~kennylevinsen/greetd/<trinity-082b25fc-e1fa-4772-950c-d458f065024a-1648717080362@3c-app-mailcom-bs08>),
> yet it doesn't seem like it was addressed.
You may have noticed that I've referred to a
`/usr/local/bin/greetd-session-wrapper` script here, that's a custom script that
I wrote to get greetd to run the command to start the WM/DE session within a
running user shell (bash/zsh), so that the appropriate environment variables
will be set when the WM is launched.
This is the content of that script:
```bash
#!/bin/bash
set -euo pipefail
# This is a helper wrapper script for greetd.
#
# It will run the session / application using the appropriate shell configured for
# this user. That way, we can make sure all of the environment variables are set
# before the WM/DE session is started.
#
# This is very important, as without it, variables for things like qt theme
# will not be set, and applications executed by the WM/DE will not be themed properly.
script_name="$0"
shell="$(getent passwd "$USER" | awk -F: '{print $NF}')"
command=("$@")
exec "$shell" -c 'exec "$@"' "$script_name" "${command[@]}"
```
With this configuration, you can now reboot and check whether greetd works
properly. (You will still be asked for a password.)
```bash
reboot
```
If everything worked properly, you should've been presented with a custom
tuigreet login screen after booting.
> [!TIP]
> Feel free to adjust the `tuigreet` settings to your liking by editing the
> `command` in the greetd settings. If you need a reference for what settings
> are available, you can check out the
> [`tuigreet`](https://github.com/apognu/tuigreet) project page.
## Configuring automatic Login
To configure automatic login, we'll need to modify the `greetd` settings in
`/etc/greetd/config.toml` and add an initial session section:
```toml
[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 1
# Auto-login session, triggered right after boot.
# If the user logs out, greetd will render the default session
[initial_session]
user = "itsdrike" # TODO: CHANGE THIS
command = "/usr/local/bin/greetd-session-wrapper Hyprland"
# The default session, also known as the greeter.
[default_session]
command = "tuigreet --time --remember --remember-user-session --asterisks --greeting 'Stop staring and log in already' --theme 'border=magenta;text=cyan;prompt=green;time=red;action=white;button=yellow;container=black;input=gray' --sessions /usr/share/wayland-sessions --xsessions /usr/share/xsessions --session-wrapper /usr/local/bin/greetd-session-wrapper --xsession-wrapper /usr/local/bin/greetd-session-wrapper startx /usr/bin/env"
# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "greeter"
```

76
guides/99_PRINTING.md Normal file
View file

@ -0,0 +1,76 @@
# Printing
This guide explains how to set up printing and scanning on Arch Linux.
<!-- markdownlint-disable MD028 -->
> [!NOTE]
> This guide is still WIP and isn't very informative, I wrote it just as a quick
> reference for myself.
> [!NOTE]
> This guide focuses on HP brand printers. If you have a printer from another
> brand, you will not be able to fully follow it.
<!-- markdownlint-enable MD028 -->
## Installing
First, we'll need to install and enable `cups`, which is the printing daemon for
Linux.
```bash
sudo pacman -S --needed cups
systemctl enable --now cups
```
### HP printers
You'll want to use `hplip` if you're using an HP brand printer.
```bash
sudo pacman -S --needed hplip
```
> [!NOTE]
> You will only want to use the hplip package for terminal based interactions.
>
> Hplip should support UI too, however, it uses Qt 4, for which the necessary
> libraries are no longer shipped by pacman, as it's incredibly outdated. It is
> technically possible to install these through the AUR, but due to the nature
> of some of the dependencies for these outdated libraries, it would mean having
> to install python2 and a bunch of related packages.
>
> Additionally, because hplip was written for very early python 3, you are
> likely to see a lot of warnings when you run most commands. That said, the
> commands should work, as these are just warnings.
>
> Aren't drivers written by big companies that have no clue about Linux just the
> best?
To set up your printer, run:
```bash
sudo hp-setup -i
```
This will register the printer with CUPS and you should now be able to pick it
in the printing dialog.
## Scanning
To get scanning support, you will need to have `sane`:
```bash
sudo pacman -S sane
```
If you're using `hplip`, you can now trigger a scan with the following command:
```bash
hp-scan -o scan.png
```
> [!TIP]
> If the specified filename ends with `.pdf`, hplip will store a PDF document
> instead of a PNG image.

668
guides/99_THEMING.md Normal file
View file

@ -0,0 +1,668 @@
# Theming
This guide will go over setting up Qt and GTK themes on Arch Linux.
My preferred setup uses:
- [BreezeX-RosePine-Linux](https://github.com/rose-pine/cursor) cursor theme,
size 24.
- [Papirus-Dark](https://github.com/catppuccin/papirus-folders) icon theme from
catppuccin papirus folders, specifically the blue accent & mocha flavor
variant.
- The default font of my choice is [Noto
Sans](https://fonts.google.com/noto/specimen/Noto+Sans), size 10
- The default monospace font of my choice is [Monaspace
Krypton](https://monaspace.githubnext.com/)
- For GTK theme, I'm using
[Tokyonight-Dark](https://github.com/Fausto-Korpsvart/Tokyonight-GTK-Theme).
- For QT theme, I'm using
[Catppuccin-Mocha-Blue](https://github.com/catppuccin/Kvantum) kvantum theme.
> [!NOTE]
> My dotfiles already include most of the necessary theme configuration files,
> so if you're using them, you can skip a lot of the steps I mention here. This
> guide assumes a completely un-themed system, to make it easy for anyone to
> follow.
>
> If there is something that you're expected to do even if you've copied over
> all of the configuration files from my dotfiles repo, it will be explicitly
> mentioned in an _important_ markdown block.
## Packages
First, we'll install all the required packages:
```bash
paru -S --needed \
rose-pine-cursor \
papirus-folders-catppuccin-git \
noto-fonts otf-monaspace \
tokyonight-gtk-theme-git \
kvantum kvantum-qt5 qt5ct qt6ct kvantum-theme-catppuccin-git
```
## Dconf / Gsettings
Dconf is a low-level configuration system that works through D-Bus, serving as
backend to GSettings. It's a simple key-based config systems, with the keys
existing in an unstructured database.
You can use the `dconf` command manually to set specific keys to given values,
but it's often more a better idea to use `gsettings`, which provide some
abstractions and does consistency checking, but ultimately it will just store
the configured values into the `dconf` database.
Dconf is used by a lot of applications for various things, but a lot of the
dconf settings are related to theming and it's crucial that we set them, as some
applications will follow these instead of the configuration files.
> [!IMPORTANT]
> You will need to perform this step even if you're using my dotfiles. The
> dconf database is not a part of my dotfiles, so these values won't be set.
```bash
# Global configuration that tells applications to prefer dark mode
gsettings set org.gnome.desktop.interface color-scheme prefer-dark
# GTK theme
gsettings set org.gnome.desktop.interface gtk-theme Tokyonight-Dark
# Font settings
gsettings set org.gnome.desktop.interface font-name 'Noto Sans 10'
gsettings set org.gnome.desktop.interface document-font-name 'Noto Sans 10'
gsettings set org.gnome.desktop.interface monospace-font-name 'Source Code Pro 10'
# Cursor settings
gsettings set org.gnome.desktop.interface cursor-theme 'BreezeX-RosePine-Linux'
gsettings set org.gnome.desktop.interface cursor-size 24
```
> [!TIP]
> You can find all registered dconf schemas with `gsettings list-schemas`. To
> include the keys, you can `gsettings list-recursively`.
>
> You might want to set some of these according to your preferences.
## XSettings
Similarly to dconf/gsettings specification, there's also an XSETTINGS
specification, that is used by some Xorg applications (most notably GTK, Java
and Wine based apps). It is less useful on Wayland, but since a lot of
applications still don't have native wayland support, it may be worth setting
up anyways. XWayland applications may still depend on this.
Applications that rely on this specification will ask for the settings from the
Xorg server, which itself gets them from a daemon service. On GNOME desktop,
this would be `gnome-settings-daemon`, but anywhere else, you'll want to use
[`xsettingsd`](https://codeberg.org/derat/xsettingsd), which is a lightweight
alternative.
<!-- markdownlint-disable MD028 -->
> [!NOTE]
> This part of the guide is optional, you don't have to set up xsettings, most
> applications will work just fine without it.
> [!IMPORTANT]
> If you do wish to set up xsettings, you will need to follow these
> instructions, even if you've populated your system with the configuration
> files from my dotifiles, as it requires installing a package and activating a
> systemd service.
<!-- markdownlint-enable MD028 -->
First, you will want to install `xsettingd` package and activate the systemd
service, so that applications can ask for this daemon a specific setting:
```bash
pacman -S xsettingsd
systemctl --user enable --now xsettingsd
```
These settings can control various things, but for us, we'll focus on the
theming. XSettings are configured simply through a config file in:
`~/.config/xsettingsd/xsettingsd.conf`.
To configure theming in xsettings, you can put the following settings into your
`xsettingsd.conf` file:
```conf
Net/ThemeName "Tokyonight-Dark"
Net/IconThemeName "Papirus-Dark"
Gtk/CursorThemeName "BreezeX-RosePine-Linux"
Net/EnableEventSounds 1
EnableInputFeedbackSounds 0
Xft/Antialias 1
Xft/Hinting 1
Xft/HintStyle "hintslight"
Xft/RGBA "rgb"
```
## GTK
> [!TIP]
> We'll be setting things up manually, however, if you wish, you can also use
> [`nwg-look`](https://github.com/nwg-piotr/nwg-look) to configure GTK from a
> graphical settings application. Do note though that by default, it doesn't
> support GTK 4 theming (see: [this github
> issue](https://github.com/nwg-piotr/nwg-look/issues/22)).
>
> `nwg-look` is inspired by the more popular `lxappearance`, however, it is
> made for native wayland. That said, either will work, so you can also try
> `lxappearance` if you wish, even on wayland.
### GTK 2
For GTK 2, we'll first want to change the location of the `gtkrc` configuration
file, to follow proper XDG base directory specification and avoid it cluttering
`$HOME`. To do this, we'll need to set the following environment variable to be
exported by your shell:
```bash
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc":"$XDG_CONFIG_HOME/gtk-2.0/gtkrc.mine"
```
We'll now create `~/.config/gtk-2.0` directory, and a `gtkrc` file inside of it,
with the following content:
```text
gtk-theme-name = "Tokyonight-Dark"
gtk-icon-theme-name = "Papirus-Dark"
gtk-cursor-theme-name = "BreezeX-RosePine-Linux"
gtk-cursor-theme-size = 24
gtk-font-name = "Noto Sans 10"
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=0
gtk-enable-input-feedback-sounds=0
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"
```
### GTK 3
For GTK 3, we'll put the following into `~/.config/gtk-3.0/settings.ini`:
```conf
[Settings]
gtk-application-prefer-dark-theme=true
gtk-theme-name=Tokyonight-Dark
gtk-icon-theme-name=Papirus-Dark
gtk-cursor-theme-name=BreezeX-RosePine-Linux
gtk-cursor-theme-size=24
gtk-font-name=Noto Sans 10
gtk-enable-animations=true
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=0
gtk-enable-input-feedback-sounds=0
gtk-error-bell=0
gtk-decoration-layout=appmenu:none
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintslight
```
### GTK 4
For GTK 4, we'll put the following into `~/.config/gtk-4.0/settings.ini`:
```conf
[Settings]
gtk-application-prefer-dark-theme=true
gtk-theme-name=Tokyonight-Dark
gtk-icon-theme-name=Papirus-Dark
gtk-cursor-theme-name=BreezeX-RosePine-Linux
gtk-cursor-theme-size=24
gtk-font-name=Noto Sans 10
gtk-enable-event-sounds=0
gtk-enable-input-feedback-sounds=0
gtk-error-bell=0
gtk-decoration-layout=appmenu:none
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintslight
```
For `libadwaita` based GTK 4 applications, you will need to force a GTK theme
with an environment variable, so you will also want to export the following:
```bash
export GTK_THEME="Tokyonight-Dark"
```
<!-- markdownlint-disable MD028 -->
> [!WARNING]
> This will only work if your theme has GTK 4 support.
> [!TIP]
> As an alternative to exporting the `GTK_THEME` env var like this, you can
> also install `libadwaita-without-adwaita-git` AUR package, which contains a
> patch to prevent GTK from overriding the system theme.
>
> Another option would be to import the theme in `gtk.css`: `~/.config/gtk-4.0/gtk.css`:
>
> ```css
> /**
> * GTK 4 reads the theme configured by gtk-theme-name, but ignores it.
> * It does however respect user CSS, so import the theme from here.
> **/
> @import url("file:///usr/share/themes/Tokyonight-Dark/gtk-4.0/gtk.css");
> ```
<!-- markdownlint-enable MD028 -->
### Make GTK follow XDG portal settings
Certain things, such as dialogs or file-pickers can be controlled via XDG
desktop portals, however, by default, GTK apps will not follow these settings.
To force them into doing so, you can export an environment variable:
```bash
export GTK_USE_PORTAL=1
```
## Qt
This section goes over configuring QT styles for qt 5 and qt 6.
### Kvantum
I like using `kvantum` to configure QT themes. Kvantum is an SVG style
customizer/engine, for which there's a bunch of plugins. It then turns these
plugins / kvantum themes into full QT themes. For theme creators, it simplifies
making a full QT theme.
> [!NOTE]
> Kvantum will only be useful for you if you actually want to use a kvantum
> theme. If you wish to use a full QT theme that doesn't need kvantum, you can
> skip this and instead achieve the same with qtct. (I'll say a bit more about
> qtct in icon theme section.)
Kvantum works as a Qt style instead of a Qt platform theme. To set kvantum for
all Qt applications, you can export the following env variable:
```bash
export QT_STYLE_OVERRIDE=kvantum
```
> [!NOTE]
> For backwards compatibility, in addition to the `kvantum` package, you will
> also need `kvantum-qt5` (`kvantum` works with qt6). If you followed the
> initial install instructions, you will have both installed already.
### Theme
We will now want to tell kvantum which theme to use. To do this, we will need to
create a settings file for Kvantum in `~/.config/Kvantum/kvantum.kvconfig`, with
the following content:
```conf
[General]
theme=catppuccin-mocha-blue
```
> [!TIP]
> The system-wide kvantum themes are located in `/usr/share/Kvantum`. The theme
> variable has to match the directory name of one of these themes.
>
> If you wish to use a custom theme that isn't available as a package, you can
> also add it as a user theme directly into `~/.config/Kvantum/`.
### Icon theme & qtct
As a theme qt engine, kvantum can't handle icons. For those, we will use qtct
platform theme.
> [!NOTE]
> You will need to install `qt5ct` & `qt6ct` packages. These will also be
> installed already if you followed the initial install command though.
Now we'll set the QT platform theme through an environment variable:
```bash
export QT_QPA_PLATFORMTHEME="qt5ct" # keep this value even for qt6ct
```
Finally, we can add a qtct configuration to use our preferred icon theme:
`~/.config/qt5ct/qt5ct.conf`:
```conf
[Appearance]
icon_theme=Papirus-Dark
```
Same thing for `~/.config/qt6ct/qt6ct.conf`.
> [!NOTE]
> qtct is a platform theme and it can do a lot more than just set the icon
> theme, however, we chose kvantum to serve as our style, so we don't need
> anything else from qtct.
>
> If you wish to instead use qtct for picking the qt style, unset the
> `QT_STYLE_OVERRIDE` variable and pick your theme in both `qt5ct` & `qt6ct`
> applications. This will modify the `qt5ct.conf` and the qt 6 variant.
### Additional things
There are some extra things that you'll probably want to set. To do so, we will
yet again use more environment variables. Specifically:
```bash
# Enables automatic scaling, based on the monitor's pixel density.
export QT_AUTO_SCREEN_SCALE_FACTOR="1"
# Run QT applications using the wayland plugin, falling back to xcb (X11) plugin
export QT_QPA_PLATFORM="wayland;xcb"
# Disable client side decorations
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
```
## Cursor
### XCursor
XCursor is the default cursor format for cursor themes. Even though the name
might imply that it's connected to X11, it will work just fine on wayland too.
To select a cursor theme to be used, you'll want to export the following
environment variables:
```bash
export XCURSOR_THEME="BreezeX-RosePine-Linux"
export XCURSOR_SIZE="24"
```
Additionally, you might want to also modify/set `XCURSOR_PATH`, to make sure
that it includes `~/.local/share/icons`, as otherwise, xcursor will not look
here for cursor themes by default on some DEs/WMs.
```bash
export XCURSOR_PATH=$XCURSOR_PATH${XCURSOR_PATH:+:}~/.local/share/icons
```
### Default cursor config
The cursor theme name "default" is used by an application if it cannot pick up
on a configuration. The default cursor theme can live in:
`~/.local/share/icons/default` or `/usr/share/icons/default`.
To set the default cursor for your user, create a
`~/.local/share/icons/default/index.theme` file with the following:
```conf
[Icon Theme]
Name=Default
Comment=Default Cursor Theme
Inherits=BreezeX-RosePine-Linux
```
> [!TIP]
> Alternatively, we could also symlink the cursor theme into the `default`
> directory, like so:
>
> ```bash
> ln -s /usr/share/icons/BreezeX-RosePine-Linux/ ~/.local/share/icons/default
> ```
>
> That said, I prefer using `Inherits` here, as it allows me to easily store the
> default cursor config in my dotfiles.
### Cursor config for GTK
You may have noticed earlier that we've already touched on specifying the cursor
configuration for GTK in the gtkrc/gtk settings, this is done via the
`gtk-cursor-theme-name` and `gtk-cursor-theme-size` setting options. Because of
that, there's no need to do anything extra to get GTK apps to use the correct
cursor theme.
### Cursor config for Qt
There is no Qt configuration for cursors. Qt programs may pick up a cursor theme
from the desktop environment (server-side cursors), X resources, or lastly the
"default" cursor theme.
### Hyprcursor
[hyprcursor](https://github.com/hyprwm/hyprcursor) is a new and efficient a
cursor format, that allow for SVG based cursors, resulting in a much better
scaling experience and more space-efficient themes.
Hyprcursor is supported out of the box by Hyprland, so if you're using Hyprland,
you can benefit from it. That said, this part is entirely optional and you can
just stick with xcursor if you wish.
If you do want to use hyprcursor, you will want to install [hyprcursor version
of the rose-pine-cursor
theme](https://github.com/ndom91/rose-pine-cursor-hyprcursor). You can simply
git clone this repository right into `~/.local/share/icons` (sadly, there isn't
an AUR package available at this time):
```bash
cd ~/.local/share/icons
git clone https://github.com/ndom91/rose-pine-cursor-hyprcursor
```
Finally, you will want to set the following environment variables:
```bash
export HYPRCURSOR_THEME="rose-pine-hyprcursor"
export HYPRCURSOR_SIZE="24"
```
Alternatively, you can also set these variables right from your hyprland config:
```hyprlang
env = HYPRCURSOR_THEME,rose-pine-hyprcursor
env = HYPRCURSOR_SIZE,24
```
> [!WARNING]
> Make sure to keep the existing xcursor environment variables and themes, as
> although many apps do support server-side cursors (e.g. Qt, Chromium,
> Electron, ...), some still don't (looking at you GTK, but also some other,
> less common things). These applications will then fall back to XCursor (unless
> they have built-in hyprcursor support, which is rare).
>
> I would therefore also recommend leaving the default theme point to the
> XCursor theme, not to a hyprcursor theme.
## Fonts
Some applications use `gsettings`/`dconf` to figure out what font to use. We've
already configured these settings, so those applications should pick up which
font to use correctly.
Other applications will use GTK config to figure out the default fonts. We've
configured this earlier too. (Note that GTK config doesn't support specifying a
monospace font).
The rest of the applications will use generic font family names ("standard"
fonts), as defined through `fontconfig`.
Applications also often provide configuration files where you can define which
font you wish to be using, so sometimes, you will need to set the font on a
per-application basis. We will not cover this, as each application is different.
### Installing fonts
In the installation instructions above, I did specify the 2 default font
packages that I wanted to use for my system. That said, I did not specify an
emoji font there and there are many fonts that are just useful to have on the
system, for things like text editing. The command below will install most of the
fonts that you might need:
```bash
paru -S --needed \
libxft xorg-font-util \
ttf-joypixels otf-jost lexend-fonts-git ttf-sarasa-gothic \
ttf-roboto ttf-work-sans ttf-comic-neue \
gnu-free-fonts tex-gyre-fonts ttf-liberation otf-unifont \
inter-font ttf-lato ttf-dejavu noto-fonts noto-fonts-cjk \
noto-fonts-emoji ttf-material-design-icons-git \
ttf-font-awesome ttf-twemoji otf-openmoji \
adobe-source-code-pro-fonts adobe-source-han-mono-otc-fonts \
adobe-source-sans-fonts ttf-jetbrains-mono otf-monaspace \
ttf-ms-fonts
```
#### Nerd fonts
I have intentionally left out the `nerd-fonts` package from the above command,
as it is fairly large (about 8 gigabytes). If you wish, you can install it, as
it does contain some pretty useful fonts, however, if this package is too big
for you, you can instead install the fonts individually, as arch does ship all
nerd fonts in the package manager individually.
To install all nerd fonts, you can simply:
```bash
paru -S --needed nerd-fonts
```
If you instead wish to only install specific nerd fonts, you can use the
following command. Note that you may want to add more fonts from nerd-fonts.
```bash
paru -S --needed \
ttf-firacode-nerd otf-firamono-nerd ttf-iosevka-nerd ttf-nerd-fonts-symbols \
ttf-hack-nerd ttf-heavydata-nerd ttf-gohu-nerd
```
> [!IMPORTANT]
> If you wish to use all of nerd-fonts, you will need to run the above command
> even after going through the install scripts from my dotfiles, as they only
> install specific nerd fonts (the above).
### Setting standard fonts
These standard fonts are:
- `sans-serif`: Standard font for regular text (articles, menus, ...)
- `serif`: Like sans-serif, but pure sans fonts shouldn't have the decorative
lines or tapers (also known as "tails" or "feet"). Note that these should fall
back to `sans-serif` if unset.
- `monospace`: Standard font for fixed-width fonts (text editors, calculators,
...)
- `emoji`: Standard font for emoji glyphs
It is possible to register multiple fonts for the standard font, ordered by
priorities. That way, if the first font isn't found, or it doesn't contain the
given glyph, the search will fall back to the next font in line.
To set a standard font, you will need to create a fontconfig configuration file.
You can do this on a per-user basis, in `~/.config/fontconfig/fonts.conf` (or
`~/.config/fontconfig/conf.d/`) or system-wide in `/etc/fonts/local.conf` (don't
modify `/etc/fonts/fonts.conf` nor the files in `/etc/fonts/conf.d`, these are
managed by the package manager and could get overwritten). Note that the user
font settings will take priority if there are overlapping settings.
I prefer using the system-wide settings (`/etc/fonts/local.conf`):
```xml
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias binding="same">
<family>sans-serif</family>
<prefer>
<family>Noto Sans</family>
<family>Jost</family>
<family>Lexend</family>
<family>Iosevka Nerd Font</family>
<family>Symbols Nerd Font</family>
<family>Noto Color Emoji</family>
</prefer>
</alias>
<alias binding="same">
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<family>Iosevka Nerd Font</family>
<family>Symbols Nerd Font</family>
<family>Noto Color Emoji</family>
</prefer>
</alias>
<alias binding="same">
<family>monospace</family>
<prefer>
<family>Monaspace Krypton</family>
<family>Source Code Pro Medium</family>
<family>Source Han Mono</family>
<family>Iosevka Nerd Font</family>
<family>Symbols Nerd Font</family>
<family>Noto Color Emoji</family>
</prefer>
</alias>
<alias binding="same">
<family>emoji</family>
<prefer>
<family>Noto Color Emoji</family>
<family>Iosevka Nerd Font</family>
<family>Symbols Nerd Font</family>
<family>Noto Color Emoji</family>
</prefer>
</alias>
</fontconfig>
```
You will now need to rebuild the font cache with:
```bash
fc-cache -vf
```
### Disable Caskaydia Cove Nerd Font
For some reason, having the Caskaydia font installed was causing some issues
with other fonts for me. Caskaydia comes from `nerd-fonts`, so if you installed
them, you might want to follow along with this too, if you're also facing
issues. I'm honestly not sue why that is, however, all that's needed to solve it
is disabling this font entirely. To do so, add the following to your
`fontconfig` config:
```xml
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<selectfont>
<rejectfont>
<glob>/usr/share/fonts/nerd-fonts-git/TTF/Caskaydia*</glob>
</rejectfont>
</selectfont>
</fontconfig>
```
### Font Manager
To preview the installed fonts, I like using `font-manager`:
```bash
paru -S --needed font-manager
```
## Sources
- <https://askubuntu.com/questions/22313/what-is-dconf-what-is-its-function-and-how-do-i-use-it>
- <https://man.archlinux.org/man/dconf.1.en>
- <https://wiki.archlinux.org/title/Xsettingsd>
- <https://www.reddit.com/r/gnome/comments/wt8oml/is_gnomesettingsdaemon_no_longer_a_program_i_can/>
- <https://wiki.archlinux.org/title/GTK>
- <https://wiki.archlinux.org/title/XDG_Base_Directory>
- <https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications>
- <https://wiki.archlinux.org/title/Qt>
- <https://wiki.archlinux.org/title/Cursor_themes>
- <https://wiki.hyprland.org/Hypr-Ecosystem/hyprcursor/>
- <https://wiki.archlinux.org/title/Font_configuration>
- <https://bbs.archlinux.org/viewtopic.php?id=275434>

37
guides/hibernation.md Normal file
View file

@ -0,0 +1,37 @@
# Hibernation
Hibernation, also called **S4** sleeping or Suspend to disk, is the process of saving the machine's state into swap
space, and completely powering off the machine. This means that there will be no power consumption until the next
power on.
This can be an extremely nice feature to have on laptops, allowing you to save the state at any point without
worrying of running out of battery (like you might with regular Suspend / **S3** sleeping, which keeps the RAM
powered on).
To be able to hibernate, you will need to have a swap partition or file (although using a swap file could be
problematic if you use encryption, so a swap partition is recommended), which should ideally be as big as your RAM
(though even if your swsp is smaller than RAM, you still have a good chance of hibernating successfully).
## Initramfs
First thing we'll need to do is set up initramfs with support to restore the previous state after hibernation.
- When using a busybox-based initramfs (with `udev` in your `HOOKS`), you will need to add a `resume` hook anywhere
after `udev`.
- With `systemd` based initramfs (you have `systemd` in your `HOOKS`), a resume mechanism is already provided, no
need to add any extra hooks.
## Kernel parameters
To be able to resume from hibernation, you will need to let the kernel know where to resume from, that is, your swap
partition. You can do that with the `resume` parameter, like this:
- `resume=UUID=...`
- `resume="PARTLABEL=Swap partition`
- `resume=/dev/archVolumeGroup/archLogicalVolume`
### Swap File
If you'd like to use a swap file, set `resume` parameter to the partition on which your swap file lives, and set
`resume_offset`, which you can find with `filefrag -v /path/to/swapfile` command. (When on btrfs, the `filefrag`
command will not work, instead you should use `btrfs inspect-internal map-swapfile -r /path/to/swapfile`)

View file

@ -1 +0,0 @@

View file

@ -0,0 +1,3 @@
[General]
theme=catppuccin-mocha-blue

View file

@ -15,13 +15,13 @@
# environment variables. Some entries may override variables
# set by alacritty itself.
#env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
#TERM: alacritty
window:
# Window dimensions (changes require restart)
@ -88,10 +88,10 @@ window:
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# GTK theme variant (Linux/BSD only)
#
@ -126,38 +126,38 @@ font:
# Bold font face
#bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
#family: Source Code Pro
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
#family: Source Code Pro
# The `style` can be specified to pick a specific face.
#style: Bold
# The `style` can be specified to pick a specific face.
#style: Bold
# Italic font face
#italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
#family: Source Code Pro
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
#family: Source Code Pro
# The `style` can be specified to pick a specific face.
#style: Italic
# The `style` can be specified to pick a specific face.
#style: Italic
# Bold italic font face
#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: monospace
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
#family: monospace
# The `style` can be specified to pick a specific face.
#style: Bold Italic
# The `style` can be specified to pick a specific face.
#style: Bold Italic
# Point size
size: 11.0
@ -189,8 +189,8 @@ draw_bold_text_with_bright_colors: false
colors:
# Default colors
primary:
background: '#191919'
foreground: '#d8dee9'
background: "#191919"
foreground: "#d8dee9"
#background: '#1d1f21'
#foreground: '#c5c8c6'
@ -227,18 +227,18 @@ colors:
#
# Colors used for the search bar and match highlighting.
#search:
# Allowed values are CellForeground and CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#matches:
# foreground: '#000000'
# background: '#ffffff'
#focused_match:
# foreground: CellBackground
# background: CellForeground
# Allowed values are CellForeground and CellBackground, which reference the
# affected cell, or hexadecimal colors like #ff00ff.
#matches:
# foreground: '#000000'
# background: '#ffffff'
#focused_match:
# foreground: CellBackground
# background: CellForeground
#bar:
# background: '#c5c8c6'
# foreground: '#1d1f21'
#bar:
# background: '#c5c8c6'
# foreground: '#1d1f21'
# Line indicator
#
@ -263,36 +263,36 @@ colors:
# Normal colors
normal:
#black: '#191919'
black: '#46494d'
red: '#b02626'
green: '#40a62f'
yellow: '#f2e635'
blue: '#314ad0'
magenta: '#b30ad0'
cyan: '#32d0fc'
white: '#acadb1'
black: "#46494d"
red: "#b02626"
green: "#40a62f"
yellow: "#f2e635"
blue: "#314ad0"
magenta: "#b30ad0"
cyan: "#32d0fc"
white: "#acadb1"
# Bright colors
bright:
black: '#666666'
red: '#ce2727'
green: '#47c930'
yellow: '#fff138'
blue: '#2e4bea'
magenta: '#cc15ed'
cyan: '#54d9ff'
white: '#dbdbdb'
black: "#666666"
red: "#ce2727"
green: "#47c930"
yellow: "#fff138"
blue: "#2e4bea"
magenta: "#cc15ed"
cyan: "#54d9ff"
white: "#dbdbdb"
# Dim colors
dim:
black: '#676f78'
red: '#b55454'
green: '#78a670'
yellow: '#faf380'
blue: '#707fd0'
magenta: '#c583d0'
cyan: '#8adaf1'
white: '#e0e3e7'
black: "#676f78"
red: "#b55454"
green: "#78a670"
yellow: "#faf380"
blue: "#707fd0"
magenta: "#c583d0"
cyan: "#8adaf1"
white: "#e0e3e7"
# Indexed Colors
#
@ -303,94 +303,93 @@ colors:
# `- { index: 16, color: '#ff00ff' }`
#
#indexed_colors: []
# Bell
#
# The bell is rung every time the BEL control character is received.
#bell:
# Visual Bell Animation
#
# Animation effect for flashing the screen when the visual bell is rung.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#animation: EaseOutExpo
# Visual Bell Animation
#
# Animation effect for flashing the screen when the visual bell is rung.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#animation: EaseOutExpo
# Duration of the visual bell flash in milliseconds. A `duration` of `0` will
# disable the visual bell animation.
#duration: 0
# Duration of the visual bell flash in milliseconds. A `duration` of `0` will
# disable the visual bell animation.
#duration: 0
# Visual bell animation color.
#color: '#ffffff'
# Visual bell animation color.
#color: '#ffffff'
# Bell Command
#
# This program is executed whenever the bell is rung.
#
# When set to `command: None`, no command will be executed.
#
# Example:
# command:
# program: notify-send
# args: ["Hello, World!"]
#
#command: None
# Bell Command
#
# This program is executed whenever the bell is rung.
#
# When set to `command: None`, no command will be executed.
#
# Example:
# command:
# program: notify-send
# args: ["Hello, World!"]
#
#command: None
#selection:
# This string contains all characters that are used as separators for
# "semantic words" in Alacritty.
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# This string contains all characters that are used as separators for
# "semantic words" in Alacritty.
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
#cursor:
# Cursor style
#style:
# Cursor shape
#
# Values for `shape`:
# - ▇ Block
# - _ Underline
# - | Beam
#shape: Block
# Cursor style
#style:
# Cursor shape
#
# Values for `shape`:
# - ▇ Block
# - _ Underline
# - | Beam
#shape: Block
# Cursor blinking state
#
# Values for `blinking`:
# - Never: Prevent the cursor from ever blinking
# - Off: Disable blinking by default
# - On: Enable blinking by default
# - Always: Force the cursor to always blink
#blinking: Off
# Cursor blinking state
#
# Values for `blinking`:
# - Never: Prevent the cursor from ever blinking
# - Off: Disable blinking by default
# - On: Enable blinking by default
# - Always: Force the cursor to always blink
#blinking: Off
# Vi mode cursor style
#
# If the vi mode cursor style is `None` or not specified, it will fall back to
# the style of the active value of the normal cursor.
#
# See `cursor.style` for available options.
#vi_mode_style: None
# Vi mode cursor style
#
# If the vi mode cursor style is `None` or not specified, it will fall back to
# the style of the active value of the normal cursor.
#
# See `cursor.style` for available options.
#vi_mode_style: None
# Cursor blinking interval in milliseconds.
#blink_interval: 750
# Cursor blinking interval in milliseconds.
#blink_interval: 750
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Thickness of the cursor relative to the cell width as floating point number
# from `0.0` to `1.0`.
#thickness: 0.15
# Thickness of the cursor relative to the cell width as floating point number
# from `0.0` to `1.0`.
#thickness: 0.15
# Live config reload (changes require restart)
#live_config_reload: true
@ -420,39 +419,39 @@ colors:
#alt_send_esc: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
#url:
# URL launcher
#
# This program is executed when clicking on a text which is recognized as a
# URL. The URL is always added to the command as the last parameter.
#
# When set to `launcher: None`, URL launching will be disabled completely.
#
# Default:
# - (macOS) open
# - (Linux/BSD) xdg-open
# - (Windows) explorer
#launcher:
# program: xdg-open
# args: []
#url:
# URL launcher
#
# This program is executed when clicking on a text which is recognized as a
# URL. The URL is always added to the command as the last parameter.
#
# When set to `launcher: None`, URL launching will be disabled completely.
#
# Default:
# - (macOS) open
# - (Linux/BSD) xdg-open
# - (Windows) explorer
#launcher:
# program: xdg-open
# args: []
# URL modifiers
#
# These are the modifiers that need to be held down for opening URLs when
# clicking on them. The available modifiers are documented in the key
# binding section.
#modifiers: None
# URL modifiers
#
# These are the modifiers that need to be held down for opening URLs when
# clicking on them. The available modifiers are documented in the key
# binding section.
#modifiers: None
# Mouse bindings
#
@ -685,132 +684,132 @@ colors:
# If the same trigger is assigned to multiple actions, all of them are executed
# in the order they were defined in.
#key_bindings:
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, }
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop, }
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp, }
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop, }
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
# Vi Mode
#- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom }
#- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode }
#- { key: Escape, mode: Vi|~Search, action: ClearSelection }
#- { key: I, mode: Vi|~Search, action: ScrollToBottom }
#- { key: I, mode: Vi|~Search, action: ToggleViMode }
#- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode }
#- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp }
#- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown }
#- { key: G, mode: Vi|~Search, action: ScrollToTop }
#- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom }
#- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp }
#- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown }
#- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp }
#- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown }
#- { key: Y, mode: Vi|~Search, action: Copy }
#- { key: Y, mode: Vi|~Search, action: ClearSelection }
#- { key: Copy, mode: Vi|~Search, action: ClearSelection }
#- { key: V, mode: Vi|~Search, action: ToggleNormalSelection }
#- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection }
#- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection }
#- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection }
#- { key: Return, mode: Vi|~Search, action: Open }
#- { key: K, mode: Vi|~Search, action: Up }
#- { key: J, mode: Vi|~Search, action: Down }
#- { key: H, mode: Vi|~Search, action: Left }
#- { key: L, mode: Vi|~Search, action: Right }
#- { key: Up, mode: Vi|~Search, action: Up }
#- { key: Down, mode: Vi|~Search, action: Down }
#- { key: Left, mode: Vi|~Search, action: Left }
#- { key: Right, mode: Vi|~Search, action: Right }
#- { key: Key0, mode: Vi|~Search, action: First }
#- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last }
#- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied }
#- { key: H, mods: Shift, mode: Vi|~Search, action: High }
#- { key: M, mods: Shift, mode: Vi|~Search, action: Middle }
#- { key: L, mods: Shift, mode: Vi|~Search, action: Low }
#- { key: B, mode: Vi|~Search, action: SemanticLeft }
#- { key: W, mode: Vi|~Search, action: SemanticRight }
#- { key: E, mode: Vi|~Search, action: SemanticRightEnd }
#- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft }
#- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight }
#- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd }
#- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket }
#- { key: Slash, mode: Vi|~Search, action: SearchForward }
#- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward }
#- { key: N, mode: Vi|~Search, action: SearchNext }
#- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious }
# Vi Mode
#- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom }
#- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode }
#- { key: Escape, mode: Vi|~Search, action: ClearSelection }
#- { key: I, mode: Vi|~Search, action: ScrollToBottom }
#- { key: I, mode: Vi|~Search, action: ToggleViMode }
#- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode }
#- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp }
#- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown }
#- { key: G, mode: Vi|~Search, action: ScrollToTop }
#- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom }
#- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp }
#- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown }
#- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp }
#- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown }
#- { key: Y, mode: Vi|~Search, action: Copy }
#- { key: Y, mode: Vi|~Search, action: ClearSelection }
#- { key: Copy, mode: Vi|~Search, action: ClearSelection }
#- { key: V, mode: Vi|~Search, action: ToggleNormalSelection }
#- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection }
#- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection }
#- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection }
#- { key: Return, mode: Vi|~Search, action: Open }
#- { key: K, mode: Vi|~Search, action: Up }
#- { key: J, mode: Vi|~Search, action: Down }
#- { key: H, mode: Vi|~Search, action: Left }
#- { key: L, mode: Vi|~Search, action: Right }
#- { key: Up, mode: Vi|~Search, action: Up }
#- { key: Down, mode: Vi|~Search, action: Down }
#- { key: Left, mode: Vi|~Search, action: Left }
#- { key: Right, mode: Vi|~Search, action: Right }
#- { key: Key0, mode: Vi|~Search, action: First }
#- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last }
#- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied }
#- { key: H, mods: Shift, mode: Vi|~Search, action: High }
#- { key: M, mods: Shift, mode: Vi|~Search, action: Middle }
#- { key: L, mods: Shift, mode: Vi|~Search, action: Low }
#- { key: B, mode: Vi|~Search, action: SemanticLeft }
#- { key: W, mode: Vi|~Search, action: SemanticRight }
#- { key: E, mode: Vi|~Search, action: SemanticRightEnd }
#- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft }
#- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight }
#- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd }
#- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket }
#- { key: Slash, mode: Vi|~Search, action: SearchForward }
#- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward }
#- { key: N, mode: Vi|~Search, action: SearchNext }
#- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious }
# Search Mode
#- { key: Return, mode: Search|Vi, action: SearchConfirm }
#- { key: Escape, mode: Search, action: SearchCancel }
#- { key: C, mods: Control, mode: Search, action: SearchCancel }
#- { key: U, mods: Control, mode: Search, action: SearchClear }
#- { key: W, mods: Control, mode: Search, action: SearchDeleteWord }
#- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious }
#- { key: N, mods: Control, mode: Search, action: SearchHistoryNext }
#- { key: Up, mode: Search, action: SearchHistoryPrevious }
#- { key: Down, mode: Search, action: SearchHistoryNext }
#- { key: Return, mode: Search|~Vi, action: SearchFocusNext }
#- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious }
# Search Mode
#- { key: Return, mode: Search|Vi, action: SearchConfirm }
#- { key: Escape, mode: Search, action: SearchCancel }
#- { key: C, mods: Control, mode: Search, action: SearchCancel }
#- { key: U, mods: Control, mode: Search, action: SearchClear }
#- { key: W, mods: Control, mode: Search, action: SearchDeleteWord }
#- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious }
#- { key: N, mods: Control, mode: Search, action: SearchHistoryNext }
#- { key: Up, mode: Search, action: SearchHistoryPrevious }
#- { key: Down, mode: Search, action: SearchHistoryNext }
#- { key: Return, mode: Search|~Vi, action: SearchFocusNext }
#- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious }
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward }
#- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward }
#- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Plus, mods: Control, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward }
#- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward }
#- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Plus, mods: Control, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory }
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Plus, mods: Command, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection }
#- { key: H, mods: Command, action: Hide }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: SpawnNewInstance }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#- { key: F, mods: Command, mode: ~Search, action: SearchForward }
#- { key: B, mods: Command, mode: ~Search, action: SearchBackward }
# (macOS only)
#- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" }
#- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory }
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Plus, mods: Command, action: IncreaseFontSize }
#- { key: NumpadAdd, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection }
#- { key: H, mods: Command, action: Hide }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: N, mods: Command, action: SpawnNewInstance }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#- { key: F, mods: Command, mode: ~Search, action: SearchForward }
#- { key: B, mods: Command, mode: ~Search, action: SearchBackward }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - Off
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Log level
#
# Values for `log_level`:
# - Off
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Print all received window events.
#print_events: false
# Print all received window events.
#print_events: false

View file

@ -1,10 +0,0 @@
[Desktop Entry]
Name=Discord
StartupWMClass=discord
Comment=All-in-one voice and text chat for gamers that's free, secure, and works on both your desktop and phone.
GenericName=Internet Messenger
Exec=/opt/discord/Discord --start-minimized
Icon=discord
Type=Application
Categories=Network;InstantMessaging;
Path=/usr/bin

View file

@ -1,10 +0,0 @@
[Desktop Entry]
Name=Element
StartupWMClass=element
Comment=Chat client for matrix protocl
GenericName=Internet Messenger
Exec=/usr/bin/element-desktop --hidden
Icon=element
Type=Application
Categories=Network;InstantMessaging;
Path=/usr/bin

View file

@ -1,16 +0,0 @@
[Desktop Entry]
Type=Application
Name=OpenSnitch
Exec=/bin/sh -c 'pkill -15 opensnitch-ui; opensnitch-ui'
Icon=opensnitch-ui
GenericName=OpenSnitch Firewall
GenericName[hu]=OpenSnitch-tűzfal
Comment=Application firewall
Comment[es]=Firewall de aplicaciones
Comment[hu]=Alkalmazási tűzfal
Terminal=false
NoDisplay=false
Categories=System;Filesystem;Network;
Keywords=system;firewall;policies;security;polkit;policykit;
X-GNOME-Autostart-Delay=3
X-GNOME-Autostart-enabled=true

2
home/.config/black Normal file
View file

@ -0,0 +1,2 @@
[tool.black]
line-length=119

View file

@ -1,112 +0,0 @@
#? Config file for bpytop v. 1.0.56
#* Color theme, looks for a .theme file in "/usr/[local/]share/bpytop/themes" and "~/.config/bpytop/themes", "Default" for builtin default theme.
#* Prefix name by a plus sign (+) for a theme located in user themes folder, i.e. color_theme="+monokai"
color_theme="Default"
#* If the theme set background should be shown, set to False if you want terminal background transparency
theme_background=True
#* Manually set which boxes to show. Available values are "cpu mem net proc", seperate values with whitespace.
shown_boxes="cpu mem net proc"
#* Update time in milliseconds, increases automatically if set below internal loops processing time, recommended 2000 ms or above for better sample times for graphs.
update_ms=400
#* Processes update multiplier, sets how often the process list is updated as a multiplier of "update_ms".
#* Set to 2 or higher to greatly decrease bpytop cpu usage. (Only integers)
proc_update_mult=2
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive",
#* "cpu lazy" updates top process over time, "cpu responsive" updates top process directly.
proc_sorting="memory"
#* Reverse sorting order, True or False.
proc_reversed=False
#* Show processes as a tree
proc_tree=True
#* Which depth the tree view should auto collapse processes at
tree_depth=3
#* Use the cpu graph colors in the process list.
proc_colors=True
#* Use a darkening gradient in the process list.
proc_gradient=True
#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
proc_per_core=False
#* Show process memory as bytes instead of percent
proc_mem_bytes=True
#* Check cpu temperature, needs "osx-cpu-temp" on MacOS X.
check_temp=True
#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
cpu_sensor=Auto
#* Show temperatures for cpu cores also if check_temp is True and sensors has been found
show_coretemp=True
#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
draw_clock="%X"
#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
background_update=True
#* Custom cpu model name, empty string to disable.
custom_cpu_name=""
#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with a comma ",".
#* Begin line with "exclude=" to change to exclude filter, oterwise defaults to "most include" filter. Example: disks_filter="exclude=/boot, /home/user"
disks_filter=""
#* Show graphs instead of meters for memory values.
mem_graphs=False
#* If swap memory should be shown in memory box.
show_swap=True
#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
swap_disk=True
#* If mem box should be split to also show disks info.
show_disks=True
#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
only_physical=True
#* Read disks list from /etc/fstab. This also disables only_physical.
use_fstab=False
#* Set fixed values for network graphs, default "10M" = 10 Mibibytes, possible units "K", "M", "G", append with "bit" for bits instead of bytes, i.e "100mbit"
net_download="10M"
net_upload="10M"
#* Start in network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
net_auto=True
#* Sync the scaling for download and upload to whichever currently has the highest scale
net_sync=False
#* If the network graphs color gradient should scale to bandwith usage or auto scale, bandwith usage is based on "net_download" and "net_upload" values
net_color_fixed=False
#* Starts with the Network Interface specified here.
net_iface=
#* Show battery stats in top right if battery is present
show_battery=True
#* Show init screen at startup, the init screen is purely cosmetical
show_init=False
#* Enable check for new version from github.com/aristocratos/bpytop at start.
update_check=True
#* Set loglevel for "~/.config/bpytop/error.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
log_level=WARNING

245
home/.config/btop/btop.conf Normal file
View file

@ -0,0 +1,245 @@
#? Config file for btop v. 1.3.0
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
color_theme = "Default"
#* If the theme set background should be shown, set to False if you want terminal background transparency.
theme_background = True
#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
truecolor = True
#* Set to true to force tty mode regardless if a real tty has been detected or not.
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
force_tty = False
#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
#* Use whitespace " " as separator between different presets.
#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty"
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"
#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
vim_keys = False
#* Rounded corners on boxes, is ignored if TTY mode is ON.
rounded_corners = True
#* Default symbols to use for graph creation, "braille", "block" or "tty".
#* "braille" offers the highest resolution but might not be included in all fonts.
#* "block" has half the resolution of braille but uses more common characters.
#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY.
#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view.
graph_symbol = "braille"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_cpu = "default"
# Graph symbol to use for graphs in gpu box, "default", "braille", "block" or "tty".
graph_symbol_gpu = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_mem = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_net = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_proc = "default"
#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace.
shown_boxes = "cpu mem net proc"
#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
update_ms = 2000
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
proc_sorting = "memory"
#* Reverse sorting order, True or False.
proc_reversed = False
#* Show processes as a tree.
proc_tree = True
#* Use the cpu graph colors in the process list.
proc_colors = True
#* Use a darkening gradient in the process list.
proc_gradient = True
#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
proc_per_core = False
#* Show process memory as bytes instead of percent.
proc_mem_bytes = True
#* Show cpu graph for each process.
proc_cpu_graphs = True
#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
proc_info_smaps = False
#* Show proc box on left side of screen instead of right.
proc_left = False
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
proc_filter_kernel = False
#* In tree-view, always accumulate child process resources in the parent process.
proc_aggregate = False
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_upper = "total"
#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_lower = "total"
#* If gpu info should be shown in the cpu box. Available values = "Auto", "On" and "Off".
show_gpu_info = "Auto"
#* Toggles if the lower CPU graph should be inverted.
cpu_invert_lower = True
#* Set to True to completely disable the lower CPU graph.
cpu_single_graph = False
#* Show cpu box at bottom of screen instead of top.
cpu_bottom = False
#* Shows the system uptime in the CPU box.
show_uptime = True
#* Show cpu temperature.
check_temp = True
#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
cpu_sensor = "Auto"
#* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
show_coretemp = True
#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries.
#* Example: "4:0 5:1 6:3"
cpu_core_map = ""
#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine".
temp_scale = "celsius"
#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
base_10_sizes = False
#* Show CPU frequency.
show_cpu_freq = True
#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime
clock_format = "%X"
#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
background_update = True
#* Custom cpu model name, empty string to disable.
custom_cpu_name = ""
#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ".
#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user".
disks_filter = ""
#* Show graphs instead of meters for memory values.
mem_graphs = True
#* Show mem box below net box instead of above.
mem_below_net = False
#* Count ZFS ARC in cached and available memory.
zfs_arc_cached = True
#* If swap memory should be shown in memory box.
show_swap = True
#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
swap_disk = True
#* If mem box should be split to also show disks info.
show_disks = True
#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
only_physical = True
#* Read disks list from /etc/fstab. This also disables only_physical.
use_fstab = True
#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool)
zfs_hide_datasets = False
#* Set to true to show available disk space for privileged users.
disk_free_priv = False
#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
show_io_stat = True
#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
io_mode = False
#* Set to True to show combined read/write io graphs in io mode.
io_graph_combined = False
#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
#* Example: "/mnt/media:100 /:20 /boot:1".
io_graph_speeds = ""
#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False.
net_download = 100
net_upload = 100
#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
net_auto = True
#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
net_sync = True
#* Starts with the Network Interface specified here.
net_iface = ""
#* Show battery stats in top right if battery is present.
show_battery = True
#* Which battery to use if multiple are present. "Auto" for auto detection.
selected_battery = "Auto"
#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
log_level = "WARNING"
#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards.
nvml_measure_pcie_speeds = True
#* Horizontally mirror the GPU graph.
gpu_mirror_graph = True
#* Custom gpu0 model name, empty string to disable.
custom_gpu_name0 = ""
#* Custom gpu1 model name, empty string to disable.
custom_gpu_name1 = ""
#* Custom gpu2 model name, empty string to disable.
custom_gpu_name2 = ""
#* Custom gpu3 model name, empty string to disable.
custom_gpu_name3 = ""
#* Custom gpu4 model name, empty string to disable.
custom_gpu_name4 = ""
#* Custom gpu5 model name, empty string to disable.
custom_gpu_name5 = ""

View file

@ -0,0 +1 @@
--ozone-platform-hint=auto

View file

@ -1,13 +0,0 @@
{
"BACKGROUND_COLOR": "#202225",
"IS_MAXIMIZED": false,
"IS_MINIMIZED": false,
"WINDOW_BOUNDS": {
"x": 912,
"y": 42,
"width": 990,
"height": 1020
},
"DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING": true,
"SKIP_HOST_UPDATE": true
}

View file

@ -5,16 +5,17 @@
# Which monitor should the notifications be shown on
monitor = 0
# Display notifications on focused monitor. Possible modes:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# keyboard needs a window manager that exports
# _NET_ACTIVE_WINDOW propery! This should be the case for almost
# all modern window managers.
# "keyboard" needs a window manager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern window managers.
#
# If this option isn't none, monitor option will be ignored.
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = mouse
### Geometry ###
@ -25,8 +26,8 @@
# width = 300
width = 270
# The maximum height of a single notification, excluding the frame.
height = 300
# The dynamic height of a single notification, excluding the frame.
height = (0, 300)
# Position the notification in the top right corner
origin = top-right
@ -38,7 +39,7 @@
scale = 0
# Maximum number of notifications (0 means no limit)
notification_limit = 0
notification_limit = 10
### Progress bar ###
@ -59,6 +60,20 @@
# Set the maximum width for the progress bar
progress_bar_max_width = 300
# Corner radius for the progress bar. 0 disables rounded corners.
progress_bar_corner_radius = 0
# Define which corners to round when drawing the progress bar. If progress_bar_corner_radius
# is set to 0 this option will be ignored.
progress_bar_corners = all
# Corner radius for the icon image.
icon_corner_radius = 0
# Define which corners to round when drawing the icon image. If icon_corner_radius
# is set to 0 this option will be ignored.
icon_corners = all
# Show how many messages are currently hidden (because of
# notification_limit).
indicate_hidden = yes
@ -68,8 +83,10 @@
# present (e.g. xcompmgr, compiz, picom, etc.). (X11 only)
transparency = 20
# Draw a line of "separator_height" pixel height between two
# notifications. Set to 0 to disable.
# Draw a line of "separator_height" pixel height between two
# notifications.
# Set to 0 to disable.
# If gap_size is greater than 0, this setting will be ignored.
separator_height = 2
# Padding between text and separator.
@ -86,7 +103,13 @@
frame_width = 3
# Defines color of the frame around the notification window
frame_color = "#aaaaaa"
frame_color = "#27292c";
# Size of gap to display between notifications - requires a compositor.
# If value is greater than 0, separator_height will be ignored and a border
# of size frame_width will be drawn around each notification instead.
# Click events on gaps do not currently propagate to applications below.
gap_size = 0
# Define a color for the separator.
# possible values are:
@ -96,19 +119,26 @@
# * anything else will be interpreted as a X color.
separator_color = frame
# Sort messages by urgency.
# Sort type.
# possible values are:
# * id: sort by id
# * urgency_ascending: sort by urgency (low then normal then critical)
# * urgency_descending: sort by urgency (critical then normal then low)
# * update: sort by update (most recent always at the top)
sort = yes
# Don't remove messages if the user is idle (no mouse/keyboard input)
# for longer than idle_threshold seconds (0 to disable)
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
# A client can set the 'transient' hint to bypass this. See the rules
# section for how to disable this if necessary
idle_threshold = 120
### Text ###
font = JetBrains Mono 11
# The spacing between the lines. If the height is smaller than the
# The spacing between lines. If the height is smaller than the
# font height, it will get raised to the font height.
line_height = 0
@ -120,7 +150,7 @@
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
# <https://docs.gtk.org/Pango/pango_markup.html>.
#
# strip: This setting is provided for compatibility with some broken
# clients that send markup even though it's not enabled on the
@ -160,17 +190,18 @@
# of the noticication. If set to no, longer sententences will be truncated
word_wrap = yes
# Specify where to make an ellipsis in the long lines.
# Possible values are "start", "middle", "end".
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Specify where to make an ellipsis in long lines.
# Possible values are "start", "middle" and "end".
ellipsize = middle
# Ignore newlines '\n' in notifications.
ignore_newline = no
# Show age of message if message is older than show_age_threshold seconds
# Set to -1 to disable, 0 to always show.
show_age_threshold = 60
# Merge multiple notifications with the same content
stack_duplicates = true
@ -182,6 +213,15 @@
### Icons ###
# Recursive icon lookup. You can set a single theme, instead of having to
# define all lookup paths.
enable_recursive_icon_lookup = true
# Set icon theme (only used for recursive icon lookup)
# You can also set multiple icon themes, with the leftmost one being used first.
# icon_theme = "Adwaita, breeze"
icon_theme = Papirus-Dark, Adwaita
# Align icons left/right/off
icon_position = left
@ -193,8 +233,8 @@
# Scale larger icons down to this size, set to 0 to disable
max_icon_size = 32
# Paths to default icons
icon_path = /usr/share/icons/hicolor/16x16/status/:/usr/share/icons/hicolor/16x16/devices/:/usr/share/icons/hicolor/16x16/apps/
# Paths to default icons (only necessary when not using recursive icon lookup)
#icon_path = /usr/share/icons/hicolor/16x16/status/:/usr/share/icons/hicolor/16x16/devices/:/usr/share/icons/hicolor/16x16/apps/
### History ###
@ -229,6 +269,13 @@
# notification height to avoid clipping text and/or icons.
corner_radius = 0
# Define which corners to round when drawing the window. If the corner radius
# is set to 0 this option will be ignored.
#
# Comma-separated list of the corners. The accepted corner values are bottom-right,
# bottom-left, top-right, top-left, top, bottom, left, right or all.
corners = all
# Ignore the dbus closeNotification message.
# Useful to enforce the timeout set by dunst configuration. Without this
# parameter, an application may close the notification sent before the
@ -293,8 +340,9 @@
foreground = "#ffffff"
timeout = 5
# Icon for notifications with low urgency, uncomment to enable
#icon = /path/to/icon
#default_icon = /path/to/icon
[urgency_normal]
highlight = "#fe6c5a"
@ -303,8 +351,9 @@
foreground = "#ffffffff"
timeout = 10
# Icon for notifications with normal urgency, uncomment to enable
#icon = /path/to/icon
#default_icon = /path/to/icon
[urgency_critical]
highlight = "#fe6c5a"
@ -313,7 +362,10 @@
foreground = "#ffffffff"
timeout = 0
override_pause_level = 60
icon = arbt
# Icon for notifications with critical urgency, uncomment to enable
#icon = /path/to/icon
@ -352,6 +404,7 @@
# ellipsize
# alignment
# hide_text
# override_pause_level
#
# Shell-like globbing will get expanded.
#
@ -359,6 +412,10 @@
# GLib based applications export their desktop-entry name. In comparison to the appname,
# the desktop-entry won't get localized.
#
# You can also allow a notification to appear even when paused. Notification will appear whenever notification's override_pause_level >= dunst's paused level.
# This can be used to set partial pause modes, where more urgent notifications get through, but less urgent stay paused. To do that, you can override the following in the rules:
# override_pause_level = X
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.

View file

@ -0,0 +1,43 @@
$rosewater: #f5e0dc;
$flamingo: #f2cdcd;
$pink: #f5c2e7;
$mauve: #cba6f7;
$red: #f38ba8;
$maroon: #eba0ac;
$peach: #fab387;
$yellow: #f9e2af;
$gold: #efcb10;
$green: #a6e3a1;
$lime: #78db32;
$teal: #94e2d5;
$sky: #89dceb;
$sapphire: #74c7ec;
$blue: #89b4fa;
$lavender: #b4befe;
$orange: #ffa500;
$text: #cdd6f4;
$subtext1: #bac2de;
$subtext0: #a6adc8;
$overlay2: #9399b2;
$overlay1: #7f849c;
$overlay0: #6c7086;
$surface2: #585b70;
$surface1: #45475a;
$surface0: #313244;
$base-a: rgba(30, 30, 40, 0.65);
$base: rgba(30, 30, 40, 1);
$base1-a: rgba(49, 50, 68, 0.85);
$base1: rgba(49, 50, 68, 1);
$mantle: #181825;
$crust: #11111b;
$fg: $text;
$bg-a: $base-a;
$bg: $base;
$bg1: $base1;
$bg1-a: $base1-a;
$border: #28283d;
$shadow: $crust;

View file

@ -0,0 +1,55 @@
@keyframes blink {
0%{
opacity: 0;
}
50%{
opacity: 0.7;
}
100%{
opacity: 0;
}
}
// .unplugged.low {
// color: #0000ff;
// }
.battery {
.icon, .icon label {
font-family: "Material Symbols Outlined";
.extra, .extra label {
font-family: "Font Awesome 6 Free";
}
}
.critical {
.unplugged {
color: #f00;
.extra { animation: blink 1.2s linear infinite; }
}
.plugged {
.icon { color: $orange }
.extra { color: $green; }
}
}
.normal {
.unplugged {
.icon { color: $orange }
}
.plugged {
.icon { color: $green; }
}
}
.full {
.icon { color: $green; }
.extra { color: $lime; }
}
.extra { margin-right: 5px; }
.icon { margin-right: 5px; }
}

View file

@ -0,0 +1,3 @@
.bitcoin {
.icon { margin-right: 6px; color: $gold; }
}

View file

@ -0,0 +1,4 @@
.clock {
// color: $sapphire;
.icon { margin-right: 6px; color: $sapphire; }
}

View file

@ -0,0 +1,3 @@
.cpu {
.icon { color: $lime; }
}

View file

@ -0,0 +1,7 @@
.gammarelay {
.icon {
color: $peach;
margin-left: 2px;
margin-right: 2px;
}
}

View file

@ -0,0 +1,3 @@
.kernel {
.icon { color: $lavender; }
}

View file

@ -0,0 +1,3 @@
.memory {
.icon { color: $maroon; }
}

View file

@ -0,0 +1,3 @@
.uptime {
.icon { color: $green; }
}

View file

@ -0,0 +1,9 @@
.volume {
.icon { color: $peach; }
.speaker {
.icon {
margin-left: 8px;
margin-right: 5px;
}
}
}

View file

@ -0,0 +1,4 @@
.window_name {
font-family: "Monaspace Krypton";
font-size: 1.4rem;
}

View file

@ -0,0 +1,29 @@
.workspaces {
background-color: $bg1-a;
border-radius: 25px;
.icon,
.icon label {
font-family: "JetBrainsMono Nerd Font", "Material Symbols Outlined";
font-size: 1.2rem;
}
.value {
margin: 0 10px;
}
.focused {
// text-decoration: underline;
// text-decoration-color: red;
// text-decoration-style: double;
color: $fg;
}
.active {
color: #bbb;
}
.inactive {
color: #555;
}
}

View file

@ -0,0 +1,32 @@
.calendar-win {
@include window;
background-color: $bg;
border: 1px solid $border;
color: $fg;
padding: .2em;
}
calendar {
padding: 5px;
:selected {
color: $mauve;
}
.header {
color: $subtext1;
}
.highlight {
color: $maroon;
font-weight: bold;
}
.button {
color: $sapphire;
}
:indeterminate {
color: $overlay0;
}
}

View file

@ -0,0 +1,46 @@
.radio-menu-box {
@include window;
background-color: $bg;
border: 1px solid $border;
color: $text;
font-family: "Jost *", "JetBrains Mono", "Font Awesome 6 Free", sans-serif;
.icon, .icon label {
font-family: "Material Symbols Outlined";
font-size: 1.15rem;
}
.text-row {
margin: 1rem 1.5rem 0;
.title { font-size: 1.2rem; }
}
.element-row {
margin: .5rem .7rem;
label {
font-size: 1rem;
margin: 0 .1rem;
}
}
.element {
@include rounding;
background-color: $surface0;
margin: .3rem;
button {
@include rounding;
padding: .5rem;
label {
font-size: 1.5rem;
}
&:hover {
background-color: $overlay0;
}
}
}
}

114
home/.config/eww/eww.scss Normal file
View file

@ -0,0 +1,114 @@
@import "css/colors";
@mixin rounding {
border-radius: 16px;
}
@mixin window {
border: 1px solid $border;
box-shadow: 0 2px 3px $shadow;
margin: 5px 5px 10px;
@include rounding;
}
* {
all: unset;
transition: 200ms ease;
}
@import "css/windows/calendar";
@import "css/windows/radio_menu";
@import "css/modules/clock";
@import "css/modules/volume";
@import "css/modules/bitcoin";
@import "css/modules/cpu";
@import "css/modules/memory";
@import "css/modules/uptime";
@import "css/modules/kernel";
@import "css/modules/battery";
@import "css/modules/workspaces";
@import "css/modules/gammarelay";
@import "css/modules/window_name";
.bar {
background-color: $bg-a;
color: $fg;
font-family: "JetBrains Mono";
label {
font-size: 14px;
}
// TODO: Use percentages (for some reason it fails now)
min-width: 1900px;
}
tooltip {
background: $bg;
border: 1px solid $border;
border-radius: 8px;
label {
font-size: 1rem;
}
}
.icon,
.icon label {
font-family: "Font Awesome 6 Free", "Material Symbols Outlined";
}
.module {
margin: 0 5px;
}
.separ {
color: $surface0;
font-size: 1.5rem;
padding-bottom: 2px;
}
scale trough {
background-color: $bg1-a;
border-radius: 24px;
margin: 0 1rem;
min-height: 10px;
min-width: 70px;
}
.tray {
margin-right: 12px;
}
menu {
background: $bg1;
border-bottom-left-radius: 12px;
border-bottom-right-radius: 12px;
border: 2px solid rgba($crust, 0.5);
padding: 0.5rem 0;
}
menu menu {
border-top-left-radius: 12px;
border-top-right-radius: 12px;
}
menu > menuitem {
padding: 0.4em 1rem;
background: transparent;
transition: 0.2s ease background;
}
menu > menuitem:hover {
background: rgba($overlay1, 0.4);
}
menu > menuitem check:checked ~ label {
color: $bg1-a;
font-weight: 600;
}
menubar > menuitem {
margin-left: 0.6rem;
}

94
home/.config/eww/eww.yuck Normal file
View file

@ -0,0 +1,94 @@
(defvar terminal "kitty -e")
(include "./modules/variables.yuck")
(include "./modules/clock.yuck")
(include "./modules/volume.yuck")
(include "./modules/bitcoin.yuck")
(include "./modules/cpu.yuck")
(include "./modules/memory.yuck")
(include "./modules/uptime.yuck")
; (include "./modules/kernel.yuck")
(include "./modules/battery.yuck")
(include "./modules/window_name.yuck")
(include "./modules/workspaces.yuck")
(include "./modules/gammarelay.yuck")
(include "./windows/calendar.yuck")
(include "./windows/radio-menu.yuck")
(defwidget sep []
(label :class "separ module" :text "|"))
(defwidget left []
(box
:space-evenly false
:halign "start"
(gammarelay_module)
(sep)
(window_name_module)
))
(defwidget right []
(box
:space-evenly false
:halign "end"
; (kernel_module)
; (sep)
(volume_module)
(sep)
(battery_module)
(sep)
(bitcoin_module)
(sep)
(cpu_module)
(sep)
(memory_module)
(sep)
; (uptime_module)
; (sep)
(clock_module)
(sep)
(systray
:pack-direction "left"
:class "module tray"
)
))
(defwidget center []
(box
:space-evenly false
:halign "center"
(workspaces_module)
))
(defwidget bar []
(centerbox
:class "bar"
:orientation "horizontal"
(left)
(center)
(right)))
(defwindow bar0
:monitor 0
:geometry (geometry :x "0%"
:y "0%"
:width: "100%"
:height "32px"
:anchor "top center")
:stacking "fg"
:exclusive true
(bar))
(defwindow bar1
:monitor 1
:geometry (geometry :x "0%"
:y "0%"
:width: "100%"
:height "32px"
:anchor "top center")
:stacking "fg"
:exclusive true
(bar))

View file

@ -0,0 +1,24 @@
(defwidget battery_module []
(eventbox
:class "module battery"
(box
:class {battery.critical ? "critical" : battery.full ? "full" : "normal"}
(box
:space-evenly false
:class {battery.plugged ? "plugged" : "unplugged" }
(box
:class "icon"
:space-evenly false
(label
:class "extra"
:text {battery.extra_icon})
(label
:text {battery.capacity_icon}))
(label
:class "value"
:text "${battery.percent}%"
)
))))

View file

@ -0,0 +1,14 @@
(defwidget bitcoin_module []
(eventbox
:onclick "bitcoin | xargs -I{} ${EWW_CMD} update bitcoin={}"
:class "module bitcoin"
(box
:space-evenly false
(label
:class "icon"
:text "")
(label :text {bitcoin}))
)
)

View file

@ -0,0 +1,18 @@
(defwidget clock_module []
(eventbox
:tooltip {time.day}
:class "module clock"
:onclick "${EWW_CMD} open --toggle calendar"
(box
:space-evenly false
(label
:class "icon"
:text "")
(label
:class "value"
:text "${time.date} ${time.hour}:${time.minute}")
)))

View file

@ -0,0 +1,15 @@
(defwidget cpu_module []
(eventbox
:class "module cpu"
(box
:space-evenly false
(label
:class "icon"
:text " ")
(label
:class "value"
:text "${round(EWW_CPU.avg,2)}%"
)
)))

View file

@ -0,0 +1,41 @@
(defwidget gammarelay_module []
(box
:class "module gammarelay"
(eventbox
:onscroll "scripts/gammarelay temperature scroll {}"
:onclick "scripts/gammarelay temperature set toggle"
:onrightclick "scripts/gammarelay temperature set off"
:tooltip "${temperature} K"
:class "temperature"
(box
(label
:class "icon"
:text "")
))
(eventbox
:onscroll "scripts/gammarelay brightness scroll {}"
:onclick "scripts/gammarelay brightness set toggle"
:onrightclick "scripts/gammarelay brightness set off"
:tooltip "${brightness}%"
:class "brightness"
(box
(label
:class "icon"
:text "")
))
; (eventbox
; :onscroll "scripts/gammarelay gamma scroll {}"
; :onclick "scripts/gammarelay gamma set toggle"
; :onrightclick "scripts/gammarelay gamma set off"
; :tooltip "${gamma}%"
; :class "gamma"
; :valign "top"
; (box
; (label
; :class "icon"
; :text "γ")
; ))
))

View file

@ -0,0 +1,15 @@
(defwidget kernel_module []
(eventbox
:class "module kernel"
(box
:space-evenly false
(label
:class "icon"
:text " ")
(label
:class "value"
:text {kernel}
)
)))

View file

@ -0,0 +1,15 @@
(defwidget memory_module []
(eventbox
:class "module memory"
(box
:space-evenly false
(label
:class "icon"
:text " ")
(label
:class "value"
:text "${round(EWW_RAM.used_mem / 1000000000,1)}G: ${round(EWW_RAM.used_mem_perc,0)}%"
)
)))

View file

@ -0,0 +1,3 @@
(deflisten nightlight
:initial `{"running": false,"temperature": 0}`
`scripts/nightlight --state`)

View file

@ -0,0 +1,15 @@
(defwidget uptime_module []
(eventbox
:class "module uptime"
(box
:space-evenly false
(label
:class "icon"
:text " ")
(label
:class "value"
:text {uptime}
)
)))

View file

@ -0,0 +1,60 @@
(defpoll time
:interval "5s"
:initial '{"date": "01 Jan", "hour": "00", "minute": "00", "day": "Monday"}'
`date +'{"date": "%d %b", "hour": "%H", "minute": "%M", "day": "%A"}'`)
(deflisten volume
:initial '{ "speaker_vol": "100", "speaker_mute": false, "speaker_icon": "", "microphone_mute": false, "microphone_vol": "100", "microphone_icon": "" }'
`scripts/volume loop`)
(deflisten window_name
:initial `{"class":"","name":"","formatted_name":""}`
`scripts/window_name`)
(deflisten workspaces
:initial `[{"id": 1,"name": "N/A","monitor": "N/A","windows": 1,"hasfullscreen": false,"lastwindow": "N/A","lastwindowtitle": "N/A","format_name": "N/A","active": true}]`
`scripts/workspaces --loop`)
(defpoll battery
:interval "1s"
:initial '{"percent":"0","plugged":"false","status":"N/A","capacity_icon":"","extra_icon":"","manufacturer":"N/A","model_name":"N/A","technology":"N/A","energy_now":"0","enerfy_full":"0","enerfy_full_design":"0","cycle_count":"0","critical":"false","full":"false"}'
`scripts/battery`)
(defpoll uptime
:interval "1m"
:initial 'N/A'
`uptime -p | sed \\
-e 's/^up //' \\
-e 's/ years\\?,\\?/y/' \\
-e 's/ months\\?,\\?/m/' \\
-e 's/ weeks\\?,\\?/w/' \\
-e 's/ days\\?,\\?/d/' \\
-e 's/ hours\\?,\\?/h/' \\
-e 's/ minutes\\?,\\?/m/' \\
-e 's/ seconds\\?,\\?/s/' \\
| cut -d' ' -f-2`)
(defpoll bitcoin
:interval "5m"
:initial "$N/A"
`bitcoin`)
; TODO: Figure out how to store this one-time
(defpoll kernel
:interval "10000h"
:initial 'N/A'
; `uname -r | sed -r 's/(.+)-arch(.+)/\\1/'`
`uname -r`)
(deflisten temperature `scripts/gammarelay temperature watch`)
(deflisten brightness `scripts/gammarelay brightness watch`)
(deflisten gamma `scripts/gammarelay gamma watch`)
(defpoll net
:interval "3s"
:initial '{"essid":"N/A","icon":"󱛇","state":"unknown","signal":"0"}'
`scripts/net status`)
(defpoll bluetooth
:interval "3s"
:initial '{"icon":"󰂲","status":"unknown","name":"","mac":"","battery":""}'
`scripts/bluetooth status`)

View file

@ -0,0 +1,40 @@
(defvar mic_rev false)
(defwidget volume_module []
(box
:class "module volume"
:space-evenly false
(eventbox
:onscroll "scripts/volume setvol SOURCE 0.5 {}"
:onclick "scripts/volume togglemute SOURCE"
:onrightclick "${terminal} pulsemixer &"
:onhover "${EWW_CMD} update mic_rev=true"
:onhoverlost "${EWW_CMD} update mic_rev=false"
:class "microphone"
(box
(label
:class "icon"
:text {volume.microphone_icon})
(label
:visible {mic_rev && !volume.microphone_mute}
:class "value"
:text "${volume.microphone_vol}%")
))
(eventbox
:onscroll "scripts/volume setvol SINK 0.5 {}"
:onclick "scripts/volume togglemute SINK"
:onrightclick "${terminal} pulsemixer &"
:class "speaker"
(box
(label
:class "icon"
:text {volume.speaker_icon})
(label
:visible {!volume.speaker_mute}
:class "value"
:text "${volume.speaker_vol}%")
))
))

View file

@ -0,0 +1,11 @@
; Consider making the window name clickable, opening up a full window that's showing
; the selected window details (class, unformatted name, and perhaps even more, like
; xwayland status, ...)
(defwidget window_name_module []
(box
:class "module window_name"
(label
:class "value"
:text "${window_name.formatted_name}")
))

View file

@ -0,0 +1,21 @@
; (defwidget sep []
; (label :class "separ module" :text "|"))
; Consider making the window name clickable, opening up a full window that's showing
; the selected window details (class, unformatted name, and perhaps even more, like
; xwayland status, ...)
(defwidget workspaces_module []
(box
:class "module workspaces"
(for workspace in workspaces
(eventbox
:class {workspace.active ? 'focused' : workspace.windows > 0 ? 'active' : 'inactive'}
:onclick `scripts/workspaces --switch ${workspace.id}`
(label
:class "value icon"
:text {workspace.format_name}))
)
))

View file

@ -0,0 +1,11 @@
[flake8]
max-line-length=119
extend-ignore=E203
extend-select=B902,B904
exclude=.venv,.git,.cache
ignore=
ANN002, # *args annotation
ANN003, # **kwargs annotation
ANN101, # self param annotation
ANN102, # cls param annotation
ANN204, # return type annotation for special methods

View file

@ -0,0 +1,85 @@
#!/usr/bin/env bash
# shellcheck source=include
source "./scripts/include"
# $BATTERY and $ADAPTER env vars can be set manually, being the names of the
# devices (in /sys/class/power_supply/) i.e. BATTERY=BAT0 ADAPTER=ADP0
# or, if left unset, they will be automatically picked.
CAPACITY_ICONS=("󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹")
CHARGING_ICON=""
DISCHARGING_ICON=""
FULL_ICON="" # Plugged in, but no longer charging (fully charged)
CRITICAL_ICON=""
CRITICAL_PERCENTAGE=15
if [ -z "$BATTERY" ]; then
# shellcheck disable=SC2010
BATTERY="$(\ls -t /sys/class/power_supply | grep "BAT" | head -n 1)"
fi
if [ -z "$ADAPTER" ]; then
# shellcheck disable=SC2010
ADAPTER="$(\ls -t /sys/class/power_supply | grep -E "ADP|AC" | head -n 1)"
fi
get_bat_info() {
cat /sys/class/power_supply/"$BATTERY"/"$1"
}
get_adp_info() {
cat /sys/class/power_supply/"$ADAPTER"/"$1"
}
manufacturer="$(get_bat_info manufacturer)"
model_name="$(get_bat_info model_name)"
technology="$(get_bat_info technology)"
energy_now="$(get_bat_info energy_now)"
energy_full="$(get_bat_info energy_full)"
energy_full_design="$(get_bat_info energy_full_design)"
cycle_count="$(get_bat_info cycle_count)"
capacity="$(get_bat_info capacity)"
status="$(get_bat_info status)"
[ "$(get_adp_info online)" -eq 1 ] && adp_connected="true" || adp_connected="false"
# Quick overrides to showcase how battery works
# capacity=100
# adp_connected="true"
# status="Charging"
# status="Not charging"
# status="Discharging"
full="false"
capacity_icon="$(pick_icon "$capacity" 0 100 "${CAPACITY_ICONS[@]}")"
if [ "$status" = "Not charging" ] || [ "$status" = "Full" ] && [ "$adp_connected" = "true" ]; then
extra_icon="$FULL_ICON"
full="true"
elif [ "$status" = "Discharging" ] && [ "$capacity" -le "$CRITICAL_PERCENTAGE" ]; then
extra_icon="$CRITICAL_ICON"
elif [ "$status" = "Discharging" ]; then
extra_icon="$DISCHARGING_ICON"
elif [ "$status" = "Charging" ]; then
extra_icon="$CHARGING_ICON"
fi
[ "$capacity" -le "$CRITICAL_PERCENTAGE" ] && critical="true" || critical="false"
jq -n -c --monochrome-output \
--arg percent "$capacity" \
--arg plugged "$adp_connected" \
--arg status "$status" \
--arg capacity_icon "$capacity_icon" \
--arg extra_icon "$extra_icon" \
--arg manufacturer "$manufacturer" \
--arg model_name "$model_name" \
--arg technology "$technology" \
--arg energy_now "$energy_now" \
--arg energy_full "$energy_full" \
--arg energy_full_design "$energy_full_design" \
--arg cycle_count "$cycle_count" \
--arg critical "$critical" \
--arg full "$full" \
'$ARGS.named'

View file

@ -0,0 +1,85 @@
#!/usr/bin/env bash
ICON_IDLE="󰂯"
ICON_CONNECTED="󰂱"
ICON_OFF="󰂲"
toggle() {
status=$(rfkill -J | jq -r '.rfkilldevices[] | select(.type == "bluetooth") | .soft' | head -1)
if [ "$status" = "unblocked" ]; then
rfkill block bluetooth
else
rfkill unblock bluetooth
if ! systemctl -q is-active bluetooth.service; then
# This will use polkit for privillege elevation
systemctl start bluetooth
fi
fi
}
get_report() {
status=$(rfkill -J | jq -r '.rfkilldevices[] | select(.type == "bluetooth") | .soft' | head -1)
if [ "$status" = "blocked" ] || ! systemctl -q is-active bluetooth.service || ! command -v bluetoothctl >/dev/null 2>&1; then
jq -n -c --monochrome-output \
--arg icon "$ICON_OFF" \
--arg status "unknown" \
--arg name "" \
--arg mac "" \
--arg battery "" \
'$ARGS.named'
return
fi
status="$(bluetoothctl show)"
powered="$(echo "$status" | grep Powered | cut -d' ' -f 2-)"
if [ "$powered" != "yes" ]; then
jq -n -c --monochrome-output \
--arg icon "$ICON_OFF" \
--arg status "unpowered" \
--arg name "" \
--arg mac "" \
--arg battery "" \
'$ARGS.named'
return
fi
status="$(bluetoothctl info)"
if [ "$status" == "Missing device address argument" ]; then
jq -n -c --monochrome-output \
--arg icon "$ICON_IDLE" \
--arg status "idle" \
--arg name "" \
--arg mac "" \
--arg battery "" \
'$ARGS.named'
return
fi
name="$(echo "$status" | grep Name | cut -d' ' -f 2-)"
mac="$(echo "$status" | head -1 | awk '{print $2}' | tr ':' '_')"
if [ "$(echo "$status" | grep Percentage)" != "" ] && command -v upower >/dev/null 2>&1; then
battery="$(upower -i /org/freedesktop/UPower/devices/headset_dev_"$mac" | grep percentage | awk '{print $2}' | cut -f 1 -d '%')%"
else
battery=""
fi
jq -n -c --monochrome-output \
--arg icon "$ICON_CONNECTED" \
--arg status "connected" \
--arg name "$name" \
--arg mac "$mac" \
--arg battery "$battery" \
'$ARGS.named'
}
case "$1" in
"status") get_report ;;
"toggle") toggle ;;
*) >&2 echo "Invalid usage, argument '$1' not recognized."; exit 1 ;;
esac

View file

@ -0,0 +1,82 @@
#!/usr/bin/env bash
if [ "$1" = "temperature" ]; then
watch_cmd="{t}"
update_cmd="UpdateTemperature"
update_signature="n"
set_cmd="Temperature"
set_signature="q"
default_val=6500
click_val=4500
scroll_change=100
cmp_op="<"
elif [ "$1" = "brightness" ]; then
watch_cmd="{bp}"
update_cmd="UpdateBrightness"
update_signature="d"
set_cmd="Brightness"
set_signature="d"
default_val=1
click_val=0.8
scroll_change=0.02
cmp_op="<"
elif [ "$1" = "gamma" ]; then
watch_cmd="{g}"
update_cmd="UpdateGamma"
update_signature="d"
set_cmd="Gamma"
set_signature="d"
default_val=1
click_val=1.1
scroll_change=0.02
cmp_op=">"
else
>&2 echo "Invalid option, first argument must be one of: temperature, brightness, gamma"
exit 1
fi
if [ "$2" = "watch" ]; then
exec wl-gammarelay-rs watch "$watch_cmd"
elif [ "$2" = "get" ]; then
exec busctl --user get-property rs.wl-gammarelay / rs.wl.gammarelay "$set_cmd" | cut -d' ' -f2
elif [ "$2" = "scroll" ]; then
if [ "$3" = "up" ]; then
sign="+"
elif [ "$3" = "down" ]; then
sign="-"
else
>&2 echo "Invalid sign, second argument must be one of: up, down"
exit 1
fi
exec busctl --user -- call rs.wl-gammarelay / rs.wl.gammarelay "$update_cmd" "$update_signature" ${sign}${scroll_change}
elif [ "$2" = "set" ]; then
mode="$3"
if [ "$mode" = "toggle" ]; then
cur_val="$(busctl --user get-property rs.wl-gammarelay / rs.wl.gammarelay "$set_cmd" | cut -d' ' -f2)"
if [ "$(echo "$cur_val $cmp_op $default_val" | bc -l)" = "1" ]; then
mode="off"
else
mode="on"
fi
fi
if [ "$mode" = "on" ]; then
exec busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay "$set_cmd" "$set_signature" "$click_val"
elif [ "$mode" = "off" ]; then
exec busctl --user -- set-property rs.wl-gammarelay / rs.wl.gammarelay "$set_cmd" "$set_signature" "$default_val"
else
>&2 echo "Invalid mode, third argument, must be one of: toggle, on, off"
exit 1
fi
else
>&2 echo "Invalid operation, second argument must be one of: watch, scroll, set"
exit 1
fi

View file

@ -0,0 +1,50 @@
#!/usr/bin/env bash
# $1: Current number
# $2: Range minimum
# $3: Range maximum
# $4-: Icons as individual arguments
pick_icon() {
cur="$1"
min="$2"
max="$3"
shift 3
icons=("$@")
index="$(echo "($cur-$min)/(($max-$min)/${#icons[@]})" | bc)"
# Print the picked icon, handling overflows/underflows, i.e. if our index is <0 or >len(icons)
if [ "$index" -ge "${#icons[@]}" ]; then
index=-1
elif [ "$index" -lt 0 ]; then
index=0
fi
echo "${icons[index]}"
}
# Will block and listen to the hyprland socket messages and output them
# Generally used like: hyprland_ipc | while read line; do handle $line; done
# Read <https://wiki.hyprland.org/IPC/> for output format and available events
# Note: requires openbsd version of netcat.
# $1 - Optional event to listen for (no event filtering will be done if not provided)
hyprland_ipc() {
if [ -z "$HYPRLAND_INSTANCE_SIGNATURE" ]; then
>&2 echo "Hyprland is not running, IPC not available"
exit 1
fi
SOCKET_PATH="${XDG_RUNTIME_DIR:-/run/user/$UID}/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
#SOCKET_PATH="/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
if [ -z "$1" ]; then
nc -U "$SOCKET_PATH" | while read -r test; do
echo "$test"
done
else
nc -U "$SOCKET_PATH" | while read -r test; do
# shellcheck disable=SC2016
echo "$test" | grep --line-buffered -E "^$1>>" | stdbuf -oL awk -F '>>' '{print $2}'
done
fi
}

52
home/.config/eww/scripts/net Executable file
View file

@ -0,0 +1,52 @@
#!/usr/bin/env bash
# shellcheck source=include
source "./scripts/include"
STRENGTH_ICONS=("󰤫" "󰤯" "󰤟" "󰤢" "󰤥" "󰤨")
DISCONNECTED_ICON="󰤮"
WIFI_OFF="󰖪"
toggle() {
status=$(rfkill -J | jq -r '.rfkilldevices[] | select(.type == "wlan") | .soft' | head -1)
if [ "$status" = "unblocked" ]; then
rfkill block wlan
else
rfkill unblock wlan
fi
}
get_report() {
connection_details="$(nmcli -t -f NAME,TYPE,DEVICE connection show --active | grep wireless | head -n1)"
essid="$(echo $connection_details | cut -d':' -f1)"
device="$(echo $connection_details | cut -d':' -f3)"
if [ -n "$device" ]; then
state="$(nmcli -t -f DEVICE,STATE device status | grep "$device" | head -n1 | cut -d':' -f2)"
signal="$(nmcli -t -f in-use,signal dev wifi | grep "\*" | cut -d':' -f2)"
else
state="unknown"
signal="0"
fi
if [ "$state" = "disconnected" ] ; then
icon="$DISCONNECTED_ICON"
elif [ "$state" = "unknown" ]; then
icon="$WIFI_OFF"
else
icon="$(pick_icon "$signal" 0 100 "${STRENGTH_ICONS[@]}")"
fi
jq -n -c --monochrome-output \
--arg essid "$essid" \
--arg icon "$icon" \
--arg state "$state" \
--arg signal "$signal" \
'$ARGS.named'
}
case "$1" in
"toggle") toggle ;;
"status") get_report ;;
*) >&2 echo "Invalid usage, argument '$1' not recognized."; exit 1 ;;
esac

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# shellcheck source=include
source "./scripts/include"
# Consider usning a file as a flag for whether nightlight is on or off
# as we might be in transition state and just killing the program might
# not be enough.
if [ "$1" = "toggle" ]; then
gammastep -x
fi

View file

@ -0,0 +1,12 @@
[tool.black]
line-length = 119
extend-exclude = "^/.cache"
[tool.isort]
profile = "black"
line_length = 119
atomic = true
order_by_type = false
case_sensitive = true
combine_as_imports = true
skip = [".venv", ".git", ".cache"]

View file

@ -0,0 +1,35 @@
#!/usr/bin/env bash
MOUNTPOINTS=("/" "/mnt/ext")
data="$(df -H)"
as_json() {
mountpoint="$1"
res="$2"
arr_res=($res)
jq -n -c --monochrome-output \
--arg mountpoint "$mountpoint" \
--arg size "${arr_res[0]}" \
--arg used "${arr_res[1]}" \
--arg avail "${arr_res[2]}" \
--arg percent "${arr_res[3]}" \
'$ARGS.named'
}
output_json="[]"
for mountpoint in "${MOUNTPOINTS[@]}"; do
res="$(echo "$data" | awk -v m="$mountpoint" '$6 == m {print $2 " " $3 " " $4 " " $5}')"
out="$(as_json "$mountpoint" "$res")"
# echo "$output_json $out" | jq -c -s
jq --argjson arr1 "$output_json" --argjson arr2 "[$out]" -n \
'$arr1 + $arr2'
# mount_data+=("$mountpoint" $res)
# echo "${mount_data[@]}"
done
# echo "${mount_data[@]}"

7
home/.config/eww/scripts/temp Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
# shellcheck source=include
source "./scripts/include"
#hyprland_ipc "workspace|createworkspace|destroyworkspace|activewindow"
hyprland_ipc

112
home/.config/eww/scripts/volume Executable file
View file

@ -0,0 +1,112 @@
#!/usr/bin/env bash
# Define some icons
SPEAKER_ICONS=("" "" "")
SPEAKER_MUTED_ICON=""
MIC_ICON=""
MIC_MUTED_ICON=""
# Define some helper functions for getting/setting audio data using wireplumber (wpctl)
# $1 can either be "SINK" (speaker) or "SOURCE" (microphone)
get_vol() {
wpctl get-volume "@DEFAULT_AUDIO_${1}@" | awk '{print int($2*100)}'
}
# $1 can either be "SINK" (speaker) or "SOURCE" (microphone)
# #2 is the voulme (as percentage) to set the volume to
# $3 is optional, if set, it can be '+' or '-', which then adds/decreases volume, instead of setting
set_vol() {
wpctl set-volume "@DEFAULT_AUDIO_${1}@" "$(awk -v n="$2" 'BEGIN{print (n / 100)}')$3"
}
# $1 can either be "SINK" (speaker) or "SOURCE" (microphone)
check_mute() {
wpctl get-volume "@DEFAULT_AUDIO_${1}@" | grep -i muted >/dev/null
echo $?
}
# $1 can either be "SINK" (speaker) or "SOURCE" (microphone)
toggle_mute() {
wpctl set-mute "@DEFAULT_AUDIO_${1}@" toggle
}
get_report() {
spkr_vol="$(get_vol "SINK")"
mic_vol="$(get_vol "SOURCE")"
if [ "$(check_mute "SINK")" == "0" ]; then
spkr_mute="true"
spkr_icon="$SPEAKER_MUTED_ICON"
else
spkr_mute="false"
index="$(awk -v n="$spkr_vol" -v m="${#SPEAKER_ICONS[@]}" 'BEGIN{print int(n/(100/m))}')"
# We might end up with an higher than the length of icons, if the volume is over 100%
# in this case, set the index to last icon
if [ "$index" -ge "${#SPEAKER_ICONS[@]}" ]; then
spkr_icon="${SPEAKER_ICONS[-1]}"
else
spkr_icon="${SPEAKER_ICONS[$index]}"
fi
fi
if [ "$(check_mute "SOURCE")" = "0" ]; then
mic_mute="true"
mic_icon="$MIC_MUTED_ICON"
else
mic_mute="false"
mic_icon="$MIC_ICON"
fi
echo "{ \"speaker_vol\": \"$spkr_vol\", \"speaker_mute\": $spkr_mute, \"speaker_icon\": \"$spkr_icon\", \"microphone_mute\": $mic_mute, \"microphone_vol\": \"$mic_vol\", \"microphone_icon\": \"$mic_icon\" }"
}
# Continually run and report every volume change (into stdout)
loop() {
get_report
pactl subscribe | grep --line-buffered "change" | while read -r _; do
get_report
done
}
case "$1" in
"loop") loop ;;
"once") get_report ;;
"togglemute")
if [ "$2" != "SOURCE" ] && [ "$2" != "SINK" ]; then
>&2 echo "Invalid usage, expected second argument to be 'SINK' or 'SOURCE', got '$2'"
exit 1
fi
toggle_mute "$2"
;;
"setvol")
if [ "$2" != "SOURCE" ] && [ "$2" != "SINK" ]; then
>&2 echo "Invalid usage, expected second argument to be 'SINK' or 'SOURCE', got '$2'"
exit 1
fi
if [[ "$3" =~ ^[+-]?[0-9]*\.?[0-9]+$ ]]; then
case "$4" in
"") set_vol "$2" "$3" ;;
up | +) set_vol "$2" "$3" "+" ;;
down | -) set_vol "$2" "$3" "-" ;;
*)
>&2 echo "Invalid usage, expected fourth argument to be up/down or +/-, got '$4'"
exit 1
;;
esac
else
>&2 echo "Invalid usage, exepcted third argument to be a number, got '$3'"
exit 1
fi
;;
*)
>&2 echo "Invalid usage, argument '$1' not recognized."
exit 1
;;
esac

View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# shellcheck source=include
source "./scripts/include"
hyprland_ipc "activewindow" | ./scripts/window_name.py

View file

@ -0,0 +1,116 @@
#!/usr/bin/env python3
"""This is a utility script for regex remaps on window names.
This is done in python, because of the complex regex logic, which would be pretty hard to
recreate in bash. This python script is expected to be called from the bash script controlling
the window names. Window name and class are obtained from piped stdin, to prevent having to
needlessly keep restarting this program, which takes a while due to the interpreter starting
overhead.
"""
import json
import re
import sys
from typing import Iterator, Optional
class RemapRule:
__slots__ = ("name_pattern", "output_pattern", "class_pattern")
def __init__(
self,
name_pattern: str,
output_pattern: str,
class_pattern: Optional[str] = None,
):
self.name_pattern = re.compile(name_pattern)
self.output_pattern = output_pattern
self.class_pattern = re.compile(class_pattern) if class_pattern else None
def apply(self, window_name: str, window_class: str) -> str:
"""Returns new name after this remap rule was applied."""
if self.class_pattern is not None:
if not self.class_pattern.fullmatch(window_class):
# Rule doesn't apply, class mismatch, return original name
return window_name
res = self.name_pattern.fullmatch(window_name)
if not res:
# Rule doesn't apply, name mismatch, return original name
return window_name
# NOTE: This is potentially unsafe, since output_pattern might be say {0.__class__}, etc.
# meaning this allows arbitrary attribute access, however it doesn't allow running functions
# here. That said, code could still end up being run if there's some descriptor defined,
# and generally I wouldn't trust this in production. However, this code is for my personal
# use here, and all of the output patterns are hard-coded in this file, so in this case, it's
# fine. But if you see this code and you'd like to use it in your production code, maybe don't
return self.output_pattern.format(*res.groups())
# Rules will be applied in specified order
REMAP_RULES: list[RemapRule] = [
RemapRule(r"", "", ""),
RemapRule(r"(.*) — Mozilla Firefox", "{}", "firefox"),
RemapRule(r"Mozilla Firefox", " Mozilla Firefox", "firefox"),
RemapRule(r"Alacritty", " Alacritty", "Alacritty"),
RemapRule(
r"zsh;#toggleterm#1 - \(term:\/\/(.+)\/\/(\d+):(.+)\) - N?VIM",
" Terminal: {0}",
),
RemapRule(r"(.+) \+ \((.+)\) - N?VIM", "{0} ({1}) [MODIFIED]"),
RemapRule(r"(.+) \((.+)\) - N?VIM", "{0} ({1})"),
RemapRule(r"(?:\[\d+\] )?\*?WebCord - (.+)", "{}", "WebCord"),
RemapRule(r"(.+) - Discord", "{}", "discord"),
RemapRule(r"(?:\(\d+\) )?Discord \| (.+)", "{}", "vesktop"),
RemapRule(r"(.+) - mpv", "{}", "mpv"),
RemapRule(r"Stremio - (.+)", " Stremio - {}", r"(Stremio)|(com.stremio.stremio)"),
RemapRule(r"Spotify((?: Premium)?)", " Spotify{}", "[Ss]potify"),
RemapRule(r"pulsemixer", " Pulsemixer"),
RemapRule(r"(.*)", "{}", "Pcmanfm"),
RemapRule(r"(.*)", "{}", "pcmanfm-qt"),
# Needs to be last
RemapRule(r"(.*)", "{}", "kitty"),
]
MAX_LENGTH = 65
def iter_window() -> Iterator[tuple[str, str]]:
"""Listen for the window parameters from stdin/pipe, yields (window_name, window_class)."""
for line in sys.stdin:
line = line.removesuffix("\n")
els = line.split(",", maxsplit=1)
if len(els) != 2:
raise ValueError(
f"Expected 2 arguments from stdin line (name, class), but got {len(els)}"
)
yield els[1], els[0]
def main() -> None:
for window_name, window_class in iter_window():
formatted_name = window_name
for remap_rule in REMAP_RULES:
new_name = remap_rule.apply(formatted_name, window_class)
if new_name != formatted_name:
formatted_name = new_name
break
formatted_name = formatted_name.split("\n")[0]
if len(formatted_name) > MAX_LENGTH:
formatted_name = formatted_name[: MAX_LENGTH - 3] + "..."
ret = json.dumps(
{
"name": window_name,
"class": window_class,
"formatted_name": formatted_name,
}
)
print(ret)
sys.stdout.flush()
if __name__ == "__main__":
main()

View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# shellcheck source=include
source "./scripts/include"
if [ "$1" = "--switch" ]; then
hyprctl dispatch focusworkspaceoncurrentmonitor "$2" >/dev/null
elif [ "$1" = "--loop" ]; then
hyprland_ipc "workspace|createworkspace|destroyworkspace" | ./scripts/workspaces.py "$@"
else
./scripts/workspaces.py "$@"
fi

View file

@ -0,0 +1,188 @@
#!/usr/bin/env python3
import argparse
import json
import subprocess
import sys
from typing import TypedDict, TYPE_CHECKING
if TYPE_CHECKING:
from _typeshed import SupportsRichComparison
class WorkspaceInfo(TypedDict):
id: int
name: str
monitor: str
windows: int
hasfullscreen: bool
lastwindow: str
lastwindowtitle: str
class ActiveWorkspaceInfo(TypedDict):
id: int
name: str
class MonitorInfo(TypedDict):
id: int
name: str
description: str
make: str
model: str
width: int
height: int
refreshRate: float
x: int
y: int
activeWorkspace: ActiveWorkspaceInfo
reserved: list[int]
scale: float
transform: int
focused: bool
dpmsStatus: bool
vrr: bool
class OutputWorkspaceInfo(WorkspaceInfo):
format_name: str
active: bool
monitor_id: int
# workspace id -> remapped name
REMAPS = {
1: "󰞷",
2: "󰈹",
3: "󱕂",
4: "󰭹",
5: "󰝚",
6: "󰋹",
7: "7",
8: "8",
9: "9",
}
# Skip the special (scratchpad) workspace
SKIP = {-99}
def workspace_sort(obj: OutputWorkspaceInfo) -> "SupportsRichComparison":
"""Returns a key to sort by, given the current element."""
return obj["id"]
def fill_blank_workspaces(open: list[OutputWorkspaceInfo]) -> list[OutputWorkspaceInfo]:
"""Add in the rest of the workspaces which don't have any open windows on them.
This is needed because hyprland deletes workspaces with nothing in them.
Note that this assumes all available workspaces were listed in REMAPS, and will
only fill those. These blank workspaces will have most string values set to "N/A",
and most int values set to 0.
"""
# Work on a copy, we don't want to alter the original list
lst = open.copy()
for remap_id, format_name in REMAPS.items():
# Skip for already present workspaces
if any(ws_info["id"] == remap_id for ws_info in lst):
continue
blank_ws: OutputWorkspaceInfo = {
"id": remap_id,
"name": str(remap_id),
"monitor": "N/A",
"windows": 0,
"hasfullscreen": False,
"lastwindow": "N/A",
"lastwindowtitle": "N/A",
"active": False,
"format_name": format_name,
"monitor_id": 0,
}
lst.append(blank_ws)
return lst
def get_workspaces() -> list[OutputWorkspaceInfo]:
"""Obtain workspaces from hyprctl, sort them and add format_name arg."""
proc = subprocess.run(["hyprctl", "workspaces", "-j"], stdout=subprocess.PIPE)
proc.check_returncode()
try:
workspaces: list[WorkspaceInfo] = json.loads(proc.stdout)
except json.JSONDecodeError:
sys.stderr.writelines([
"Error decoding json response from hyprctl, returning empty workspaces",
f"Actual captured output from hyprctl: {proc.stdout!r}"
])
sys.stderr.flush()
workspaces = []
proc = subprocess.run(["hyprctl", "monitors", "-j"], stdout=subprocess.PIPE)
proc.check_returncode()
monitors: list[MonitorInfo] = json.loads(proc.stdout)
active_workspaces = {monitor["activeWorkspace"]["id"] for monitor in monitors}
out: list[OutputWorkspaceInfo] = []
for workspace in workspaces:
if workspace["id"] in SKIP:
continue
format_name = REMAPS.get(workspace["id"], workspace["name"])
active = workspace["id"] in active_workspaces
try:
mon_id = [monitor["id"] for monitor in monitors if monitor["name"] == workspace["monitor"]][0]
except IndexError: # Sometimes workspace["monitor"] is "?", which doesn't match any monitor
mon_id = -1
out.append({**workspace, "format_name": format_name, "active": active, "monitor_id": mon_id})
out = fill_blank_workspaces(out)
out.sort(key=workspace_sort)
return out
def print_workspaces() -> None:
wks = get_workspaces()
ret = json.dumps(wks)
print(ret)
sys.stdout.flush()
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument(
"--oneshot",
action="store_true",
help="Don't listen to stdout for updates, only run once and quit",
)
parser.add_argument(
"--loop",
action="store_true",
help="Listen to stdout input, once something is received, re-print workspaces"
)
args = parser.parse_args()
if args.loop and args.oneshot:
print("Can't use both --oneshot and --loop", file=sys.stdout)
sys.exit(1)
if args.loop is None and args.oneshot is None:
print("No option specified!", file=sys.stdout)
sys.exit(1)
# Print workspaces here immediately, we don't want to have to wait for the first
# update from stdin as we only receive those on actual workspace change.
print_workspaces()
if args.oneshot:
# We've already printed the workspaces once, we can exit now
return
# Reprint workspaces on each stdin update (flush)
for _ in sys.stdin:
print_workspaces()
if __name__ == "__main__":
main()

View file

@ -0,0 +1,14 @@
(defwidget calendar-win []
(box
:class "calendar-win"
(calendar)))
(defwindow calendar
:monitor 0
:geometry (geometry
:x "0%"
:y "0%"
:anchor "top right"
:width "0px"
:height "0px")
(calendar-win))

View file

@ -0,0 +1,78 @@
(defwidget radio-menu-win []
(box
:class "radio-menu-box"
:space-evenly false
:orientation "v"
(box
:class "text-row"
:space-evenly false
(label
:class "title"
:text "Radio/Connections Panel"))
(box
:class "element-row"
(box
:class "wifi-box"
:space-evenly false
:orientation "v"
(box
:class "element icon"
:space-evenly false
:halign "center"
(button
:class "wifi-button"
:tooltip "${net.state} (strength: ${net.signal}%)"
:onclick "scripts/net toggle"
{net.icon})
(label
:class "separator"
:text "│")
(button
:class "wifi-arrow-btn"
:onclick "eww close radio-menu && nm-connection-editor &"
"󰅂"))
(label
:text {net.essid}
:xalign 0.5
:limit-width 15))
(box
:class "bluetooth-box"
:space-evenly false
:orientation "v"
(box
:class "element icon"
:space-evenly false
:halign "center"
(button
:class "bluetooth-button"
:onclick "scripts/bluetooth toggle"
:tooltip "${bluetooth.name} (${bluetooth.mac}) ${bluetooth.battery}"
{bluetooth.icon})
(label
:class "separator"
:text "│")
(button
:class "bluetooth-arrow-btn"
:onclick "eww close radio-menu && blueberry"
"󰅂"))
(label
:text {bluetooth.name}
:xalign 0.5
:tooltip "${bluetooth.name} (${bluetooth.mac}) ${bluetooth.battery}"
:limit-width 15)))
))
(defwindow radio-menu
:stacking "fg"
:monitor 0
:geometry (geometry
:x "0"
:y "0"
:width "0%"
:height "0%"
:anchor "right top")
(radio-menu-win))

View file

@ -1,44 +0,0 @@
[General]
contrastOpacity=188
disabledTrayIcon=true
drawColor=#ad00ff
drawThickness=1
filenamePattern=Screenshot_%Y-%m-%d_%H-%M-%S
savePath=/home/itsdrike/Pictures/Screenshots
savePathFixed=false
setSaveAsFileExtension=Portable Network Graphic file (PNG) (*.png)
showStartupLaunchMessage=true
startupLaunch=true
[Shortcuts]
TYPE_ARROW=A
TYPE_CIRCLE=C
TYPE_CIRCLECOUNT=
TYPE_COMMIT_CURRENT_TOOL=Ctrl+Return
TYPE_COPY=Ctrl+C
TYPE_DELETE_CURRENT_TOOL=Del
TYPE_DRAWER=D
TYPE_EXIT=Ctrl+Q
TYPE_MARKER=M
TYPE_MOVESELECTION=Ctrl+M
TYPE_MOVE_DOWN=Down
TYPE_MOVE_LEFT=Left
TYPE_MOVE_RIGHT=Right
TYPE_MOVE_UP=Up
TYPE_OPEN_APP=Ctrl+O
TYPE_PENCIL=P
TYPE_PIN=
TYPE_PIXELATE=B
TYPE_RECTANGLE=R
TYPE_REDO=Ctrl+Shift+Z
TYPE_RESIZE_DOWN=Shift+Down
TYPE_RESIZE_LEFT=Shift+Left
TYPE_RESIZE_RIGHT=Shift+Right
TYPE_RESIZE_UP=Shift+Up
TYPE_SAVE=Ctrl+S
TYPE_SELECTION=S
TYPE_SELECTIONINDICATOR=
TYPE_SELECT_ALL=Ctrl+A
TYPE_TEXT=T
TYPE_TOGGLE_PANEL=Space
TYPE_UNDO=Ctrl+Z

View file

@ -1,7 +1,7 @@
[user]
name = ItsDrike
email = itsdrike@protonmail.com
signingkey = B014E761034AF742
signingkey = FA2745890B7048C0
[alias]
quickclone = "clone --single-branch --depth=1"
bareclone = "!sh -c 'git clone --bare \"$0\" \"$1\"/.bare; echo \"gitdir: ./.bare\" > \"$1/.git\"'"
@ -9,10 +9,13 @@
cleanup = "!default_branch=$(git remote show origin | awk '/HEAD branch/ {print $NF}'); git remote prune origin && git checkout -q $default_branch && git for-each-ref refs/heads/ '--format=%(refname:short)' | while read branch; do mergeBase=$(git merge-base $default_branch $branch) && [[ $(git cherry $default_branch $(git commit-tree $(git rev-parse $branch^{tree}) -p $mergeBase -m _)) == '-'* ]] && git branch -D $branch; done"
m = "merge"
p = "push"
pl = "pull"
f = "fetch"
p = "push"
pu = "!git push --set-upstream origin `git symbolic-ref --short HEAD`"
pf = "push --force"
pl = "pull"
s = "status --short --branch"
ss = "status"
@ -39,6 +42,7 @@
ds = "diff --staged"
dw = "diff --word-diff"
dcm = "!sh -c 'git diff $0~ $0'"
linediff = "!sh -c 'git diff --unified=0 $1 $2 | grep -Po \"(?<=^\\+)(?!\\+\\+).*\" '"
b = "branch"
ba = "branch --all"
@ -46,21 +50,38 @@
bD = "branch --delete --force"
bm = "branch --move"
bM = "branch --move --force"
bb = "!better-git-branch"
r = "rebase"
ri = "rebase -i"
rc = "rebase --continue"
l = "log --oneline --decorate --all --graph"
lp = "log --patch"
lo = "log --pretty=oneline --abbrev-commit --graph"
lg = "log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
loog = "log --format=fuller --show-signature --all --color --decorate --graph"
make-patch = "diff --no-prefix --relative"
set-upstream = "!git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD`"
fixup-picker = "!git log -n 50 --pretty=format:'%h %s' --no-merges | fzf | cut -c -7 | xargs -o git commit --fixup";
staash = "stash --all";
stash-staged = "!sh -c 'git stash --keep-index; git stash push -m \"staged\" --keep-index; git stash pop stash@{1}'"
reauthor-all = "-c rebase.instructionFormat='%s%nexec GIT_COMMITTER_DATE=\"%cD\" GIT_AUTHOR_DATE=\"%aD\" git commit --amend --no-edit --no-verify --reset-author' rebase --root"
find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"
show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'"
comitter-lines = "!git log --author=\"$1\" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\\n\", add, subs, loc }' #"
total-lines = "!git ls-files | xargs cat | wc -l"
tracked-files = "ls-tree --full-tree --name-only -r HEAD"
tracked-text-files = "!git tracked-files | while IFS= read -r file; do mime_type=$(file -b --mime-type "$file"); [[ $mime_type == text/* ]] && echo "$file"; done"
total-lines = "!git tracked-text-files | xargs cat | wc -l"
total-files = "!git tracked-files | wc -l"
total-commits = "!git log --oneline | wc -l"
comitter-lines = "!git log --author=\"$1\" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\\n\", add, subs, loc }' #"
[credential]
helper = store --file ~/.config/git/git-credentials
[core]
@ -81,3 +102,4 @@
gpgsign = true
[init]
defaultBranch = main
templatedir = ~/.config/git/templates

View file

@ -0,0 +1,156 @@
#!/usr/bin/env bash
set -euo pipefail
# A hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
# This script focuses on enforcing semantic commit message specification.
#
# It primarily focuses on the commit title, however, it also enforces some
# the mandatory newline between the title and the body.
LIGHT_GRAY="\033[0;37m"
YELLOW="\033[33m"
CYAN="\033[36m"
RED="\033[31m"
UNDO_COLOR="\033[0m"
check_dependencies() {
if ! [ -x "$(command -v jq)" ]; then
echo "\`commit-msg\` hook failed. Please install jq."
exit 1
fi
}
load_config() {
config_file="$PWD/.commit-msg-config.json"
if [ ! -f "$config_file" ]; then
exit 0
fi
enabled=$(jq -r .enabled "$config_file")
if [ "$enabled" != "true" ]; then
exit 0
fi
title_semver_enabled=$(jq -r .semver_structure "$config_file")
mapfile -t special_types < <(jq -r '.special_types[]' "$config_file")
mapfile -t types < <(jq -r '.types[]' "$config_file")
mapfile -t scopes < <(jq -r '.scopes[]' "$config_file")
title_min_length=$(jq -r '.length.min' "$config_file")
title_max_length=$(jq -r '.length.max' "$config_file")
}
# Build a dynamic regex for the commit message
build_title_regex() {
regexp="^("
# Special types
if [ ${#special_types[@]} -eq 0 ]; then
for s_type in "${special_types[@]}"; do
regexp="${regexp}$s_type|"
done
regexp="${regexp%|})"
regexp="${regexp}(: .+)?"
regexp="${regexp}$|^("
fi
# Types
if [ ${#types[@]} -eq 0 ]; then
regexp="${regexp}.+"
else
for type in "${types[@]}"; do
regexp="${regexp}$type|"
done
regexp="${regexp%|})"
fi
# Scope
regexp="${regexp}(\("
if [ ${#scopes[@]} -eq 0 ]; then
regexp="${regexp}.+"
else
for scope in "${scopes[@]}"; do
regexp="${regexp}$scope|"
done
regexp="${regexp%|}"
fi
regexp="${regexp}\))?"
# Breaking change indicator
regexp="${regexp}(!)?"
regexp="${regexp}: (.+)$"
}
error_header() {
echo -e "${RED}[Invalid Commit Message]${UNDO_COLOR}"
echo -e "------------------------"
}
# ---------------------------------------------
INPUT_FILE="$1"
check_dependencies
load_config
# Get the actual commit message, excluding comments
commit_message=$(sed '/^#/d' <"$INPUT_FILE")
# Don't do any checking on empty commit messages.
# Git will abort empty commits by default anyways.
if [ -z "$commit_message" ]; then
exit 0
fi
commit_title=$(echo "$commit_message" | head -n1 "$INPUT_FILE")
# Check the semver commit title structure first
if [ "$title_semver_enabled" == "true" ]; then
build_title_regex
if [[ ! $commit_title =~ $regexp ]]; then
error_header
echo -e "${LIGHT_GRAY}Valid types: ${UNDO_COLOR}${CYAN}${types[*]}${UNDO_COLOR}"
echo -e "${LIGHT_GRAY}Valid special types: ${UNDO_COLOR}${CYAN}${special_types[*]}${UNDO_COLOR}"
if [ ${#scopes[@]} -eq 0 ]; then
echo -e "${LIGHT_GRAY}Valid scopes: any${UNDO_COLOR}"
else
echo -e "${LIGHT_GRAY}Valid scopes: ${UNDO_COLOR}${CYAN}${scopes[*]}${UNDO_COLOR}"
fi
#echo -e "${LIGHT_GRAY}Expected regex: ${UNDO_COLOR}${CYAN}${regexp}${UNDO_COLOR}"
echo -e "Actual commit title: ${YELLOW}${commit_title}${UNDO_COLOR}"
exit 1
fi
fi
# Then check the length of the commit title
commit_title_len=${#commit_title}
if { [ "$title_min_length" != "null" ] && [ "$commit_title_len" -lt "$title_min_length" ]; } ||
{ [ "$title_max_length" != "null" ] && [ "$commit_title_len" -gt "$title_max_length" ]; }; then
error_header
echo -e "${LIGHT_GRAY}Expected title (first line) length: Min=${CYAN}$title_min_length${UNDO_COLOR} Max=${CYAN}$title_max_length${UNDO_COLOR}"
echo -e "Actual length: ${YELLOW}${commit_title_len}${UNDO_COLOR}"
exit 1
fi
# Check for a newline between the title and the body
if [ "$(echo "$commit_message" | wc -l)" -gt 1 ]; then
second_line=$(echo "$commit_message" | sed -n '2p')
third_line=$(echo "$commit_message" | sed -n '3p')
if [ "$second_line" != "" ] || [ "$third_line" == "" ]; then
error_header
echo -e "There must be exactly one blank line between the commit title and the body."
exit 1
fi
fi

View file

@ -1,11 +0,0 @@
[Filechooser Settings]
LocationMode=path-bar
ShowHidden=false
ShowSizeColumn=true
GeometryX=510
GeometryY=260
GeometryWidth=900
GeometryHeight=584
SortColumn=name
SortOrder=ascending
StartupMode=recent

View file

@ -1,19 +1,15 @@
# DO NOT EDIT! This file will be overwritten by LXAppearance.
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
include "/home/itsdrike/.gtkrc-2.0.mine"
gtk-theme-name="Adwaita-dark"
gtk-icon-theme-name="Papirus-Breeze-Dark"
gtk-font-name="Noto Sans, 10"
gtk-cursor-theme-name="BreezeX-Light"
gtk-cursor-theme-size=24
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-theme-name = "Tokyonight-Dark"
gtk-icon-theme-name = "Papirus-Dark"
gtk-cursor-theme-name = "BreezeX-RosePine-Linux"
gtk-cursor-theme-size = 24
gtk-font-name = "Noto Sans 10"
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-enable-event-sounds=0
gtk-enable-input-feedback-sounds=0
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-modules="colorreload-gtk-module:window-decorations-gtk-module:appmenu-gtk-module"
gtk-xft-rgba="rgb"

View file

@ -1,21 +1,19 @@
[Settings]
gtk-application-prefer-dark-theme=true
gtk-button-images=1
gtk-cursor-theme-name=BreezeX-Light
gtk-theme-name=Tokyonight-Dark
gtk-icon-theme-name=Papirus-Dark
gtk-cursor-theme-name=BreezeX-RosePine-Linux
gtk-cursor-theme-size=24
gtk-decoration-layout=icon:minimize,maximize,close
gtk-font-name=Noto Sans 10
gtk-enable-animations=true
gtk-font-name=Noto Sans, 10
gtk-icon-theme-name=Papirus-Breeze-Dark
gtk-button-images=1
gtk-menu-images=1
gtk-modules=colorreload-gtk-module:window-decorations-gtk-module:appmenu-gtk-module
gtk-primary-button-warps-slider=false
gtk-shell-shows-menubar=1
gtk-theme-name=Adwaita-dark
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-enable-event-sounds=0
gtk-enable-input-feedback-sounds=0
gtk-error-bell=0
gtk-decoration-layout=appmenu:none
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintslight

View file

@ -0,0 +1,5 @@
/**
* GTK 4 reads the theme configured by gtk-theme-name, but ignores it.
* It does however respect user CSS, so import the theme from here.
**/
@import url("file:///usr/share/themes/Tokyonight-Dark/gtk-4.0/gtk.css");

View file

@ -0,0 +1,14 @@
[Settings]
gtk-application-prefer-dark-theme=true
gtk-theme-name=Tokyonight-Dark
gtk-icon-theme-name=Papirus-Dark
gtk-cursor-theme-name=BreezeX-RosePine-Linux
gtk-cursor-theme-size=24
gtk-font-name=Noto Sans 10
gtk-enable-event-sounds=0
gtk-enable-input-feedback-sounds=0
gtk-error-bell=0
gtk-decoration-layout=appmenu:none
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle=hintslight

19
home/.config/hyfetch.json Normal file
View file

@ -0,0 +1,19 @@
{
"preset": "rainbow",
"mode": "rgb",
"light_dark": "dark",
"lightness": 0.65,
"color_align": {
"mode": "custom",
"custom_colors": {
"1": 1,
"2": 4
},
"fore_back": []
},
"backend": "neofetch",
"args": null,
"distro": null,
"pride_month_shown": [],
"pride_month_disable": false
}

View file

@ -0,0 +1,54 @@
general {
before_sleep_cmd = loginctl lock-session
ignore_dbus_inhibit = false
ignore_systemd_inhibit = false
}
# Warn about going idle (5 mins)
listener {
timeout = 300
# use hyprland notifications, in case regular notifs are paused or whatever
on-timeout = hyprctl notify 0 10000 "rgb(ff0000)" "fontsize:20 System going idle in 10 seconds..."
on-resume = hyprctl dismissnotify 1
}
# Dim the screen
listener {
timeout = 300
# Set the brightness to minimum (not exactly to 0 though for OLED screens)
on-timeout = brightnessctl -s set 10
on-resume = brightnessctl -r
}
# Turn off keyboard backlight
listener {
timeout = 300
# Attempt to find the keyboard backlight device, only proceeding if it exists
on-timeout = sh -c 'device=$(brightnessctl -l -m | grep -i kbd | cut -d"," -f1 | head -n 1) && [ -n "$device" ] && brightnessctl -s -d "$device" set 0'
on-resume = sh -c 'device=$(brightnessctl -l -m | grep -i kbd | cut -d"," -f1 | head -n 1) && [ -n "$device" ] && brightnessctl -r -d "$device"'
}
# Lock the session
listener {
timeout = 310
on-timeout = loginctl lock-session
}
# Turn off the screen after another 50s
listener {
timeout = 400
on-timeout = hyprctl dispatch dpms off
on-resume = hyprctl dispatch dpms on
}
# Enter suspend/sleep state (10 mins)
# On low battery, or after HibernateDelaySec (/etc/systemd/sleep.conf), the system
# will enter full hibernation
listener {
timeout = 600
on-timeout = systemctl suspend-then-hibernate
}
# vi: ft=hyprlang

View file

@ -0,0 +1,22 @@
general {
# cursor_inactive_timeout = 10
# no_cursor_warps = true
}
debug {
overlay = false
#disable_logs = false
enable_stdout_logs = true
}
source = ~/.config/hypr/hyprland.d/exec.conf
source = ~/.config/hypr/hyprland.d/layout.conf
source = ~/.config/hypr/hyprland.d/input.conf
source = ~/.config/hypr/hyprland.d/style.conf
source = ~/.config/hypr/hyprland.d/keybinds.conf
source = ~/.config/hypr/hyprland.d/window_rules.conf
source = ~/.config/hypr/hyprland.d/gestures.conf
source = ~/.config/hypr/hyprland.d/misc.conf
source = ~/.config/hypr/hyprland.d/plugins.conf
# vi: ft=hyprlang

View file

@ -0,0 +1,4 @@
exec-once = uwsm finalize
exec-once = uwsm app vesktop
# vi: ft=hyprlang

View file

@ -0,0 +1,11 @@
gestures {
workspace_swipe = true
workspace_swipe_fingers = 3
workspace_swipe_distance = 300
workspace_swipe_invert = false
workspace_swipe_min_speed_to_force = 20
workspace_swipe_cancel_ratio = 0.650000
}
# vi: ft=hyprlang

View file

@ -0,0 +1,34 @@
# ################
# ### MONITORS ###
# ################
# Should be configured per-profile
#monitor = HDMI-A-1, 1920x1080@60, 0x0, 1 # above
monitor = HDMI-A-1, 1920x1080@60, 1920x1080, 1 # left
monitor = eDP-1, 1920x1200@60, 0x1080, 1
monitor = , preferred, auto, 1
# Mirror the primary (laptop) monitor on externals
# monitor= , preferred, auto, 1, mirror, eDP-1
# #####################
# ### GENERAL INPUT ###
# #####################
input {
kb_layout = us, sk
kb_variant = ,qwerty
kb_options = grp:alt_shift_toggle
numlock_by_default=true
follow_mouse = 1
touchpad {
# Sending LMB + RMB = MMB
middle_button_emulation = true
# I'm not natural
natural_scroll = false;
}
}
# vi: ft=hyprlang

View file

@ -0,0 +1,290 @@
$MOUSE_LMB = mouse:272
$MOUSE_RMB = mouse:273
$MOUSE_MMB = mouse:274
$MOUSE_EX1 = mouse:275
$MOUSE_EX2 = mouse:276
$XF86Favorites = 164
# #####################
# ### ACTIVE WINDOW ###
# #####################
bind = SUPER, W, killactive,
bind = SUPER, F, togglefloating,
bind = SUPER, Space, fullscreen, 0 # regular fullscreen
bind = SUPER_SHIFT, Space, fullscreen, 1 # maximize without client fullscreen
bind = SUPER_CTRL, Space, fullscreenstate, 2, 0 # fullscreen without client knowing
bind = SUPER_CTRL_SHIFT, Space, fullscreenstate, 1, 2 # maximize with client being full-screen
bind = CTRL_SHIFT, Space, exec, toggle-fake-fullscreen # fake fullscreen + custom border
bind = SUPER_SHIFT, S, layoutmsg, togglesplit
# ################
# ### PROGRAMS ###
# ################
bind = SUPER, R, exec, uwsm app -- $(uwsm app -- wofi --show drun --define=drun-print_desktop_file=true)
bind = SUPER_SHIFT, V, exec, uwsm app -- clipman pick -t wofi
bind = SUPER, Return, exec, uwsm app -- kitty
bind = SUPER, X, exec, uwsm app -- pcmanfm-qt
bind = SUPER, B, exec, uwsm app -- firefox
bind = SUPER, C, exec, uwsm app -- qalculate-gtk
bind = , XF86Calculator, exec, uwsm app -- qalculate-gtk
# #####################
# ### DE/WM CONTROL ###
# #####################
bind = SUPER_SHIFT, Q, exec, uwsm app -- menuquit
bind = SUPER_CTRL, L, exec, loginctl lock-session
bind = SUPER_SHIFT, L, exec, uwsm app -- wlogout -p layer-shell
bind = SUPER_SHIFT, T, exec, toggle-idle
# ###################
# ### SCREENSHOTS ###
# ###################
# Screenshots (with custom screenshot script)
$SCREENSHOT_FORMAT = "${XDG_SCREENSHOTS_DIR:-$HOME/Media/Pictures/Screenshots}/Screenshot_$(date +%Y-%m-%d_%H-%M-%S).png"
$SCREENSHOT_DELAY = 2000
bind = ALT, Print, exec, wl-copy --type image/png "$(hyprpicker)" && notify-send 'Picked color' "$(wl-paste) (saved to clipboard)"
bind = , Print, exec, hyprland-screenshot --notify --copy --target area
#bindl = , Print, exec, hyprland-screenshot --notify --copy --target all # lockscreen screenshot (only enable when needed)
bind = SUPER, Print, exec, hyprland-screenshot --notify --copy --target area --edit
bind = SHIFT, Print, exec, hyprland-screenshot --notify --save $SCREENSHOT_FORMAT --target area
bind = CTRL, Print, exec, hyprland-screenshot --notify --copy --target area --delay $SCREENSHOT_DELAY
bind = SUPER_SHIFT, Print, exec, hyprland-screenshot --notify --save $SCREENSHOT_FORMAT --target area --edit
bind = SUPER_CTRL, Print, exec, hyprland-screenshot --notify --copy --target area --delay $SCREENSHOT_DELAY --edit
bind = SUPER_SHIFT_CTRL, Print, exec, hyprland-screenshot --notify --save $SCREENSHOT_FORMAT --target area --delay $SCREENSHOT_DELAY --edit
bind = SUPER_ALT, Print, exec, ocr && notify-send "OCR" "Text copied to clipboard"
# XF86Favorites key for recording
# (don't question me, I had it free)
bind = , 164, exec, uwsm app -- quick-record --notify toggle
bind = SUPER, 164, exec, uwsm -- app quick-record toggle
# #####################
# ### NOTIFICATIONS ###
# #####################
bind = CTRL, grave, exec, swaync-client --close-latest
bind = CTRL_SHIFT, grave, exec, swaync-client --close-all
bind = CTRL_ALT, grave, exec, swaync-client --hide-latest
bind = CTRL, period, exec, swaync-client --toggle-panel
bind = SUPER_SHIFT, D, exec, toggle-notifications
# ############################
# ### AUDIO/VOLUME CONTROL ###
# ############################
binde = SUPER, Down, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-
binde = SUPER, Up, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+
binde = , XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-
binde = , XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+
bind = , XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
bind = , XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
# ##########################
# ### BRIGHTNESS CONTROL ###
# ##########################
binde = SUPER, Right, exec, brightness -i 5% -n
binde = SUPER, Left, exec, brightness -d 5% -n
binde = , XF86MonBrightnessUp, exec, brightness -i 5% -n
binde = , XF86MonBrightnessDown, exec, brightness -d 5% -n
# #####################
# ### WINDOW GROUPS ###
# #####################
bind = SUPER, G, togglegroup,
bind = SUPER_SHIFT, G, lockactivegroup, toggle
bind = ALT, tab, changegroupactive, f
bind = ALT, grave, changegroupactive, b
# ######################################
# ### SPECIAL WORKSPACE (SCRATCHPAD) ###
# ######################################
bind = ALT, grave, movetoworkspace, special
bind = SUPER, grave, togglespecialworkspace,
# #########################
# ### MOVE WINDOW FOCUS ###
# #########################
bind = SUPER, h, movefocus, l
bind = SUPER, l, movefocus, r
bind = SUPER, k, movefocus, u
bind = SUPER, j, movefocus, d
# #######################################
# ### MOVE ACTIVE WINDOW IN DIRECTION ###
# #######################################
bind = SUPER_ALT, h, movewindow, l
bind = SUPER_ALT, l, movewindow, r
bind = SUPER_ALT, k, movewindow, u
bind = SUPER_ALT, j, movewindow, d
# #######################################
# ### MOVE FLOATING WINDOWS ###
# #######################################
$myMoveSize = 100
bind = SUPER_ALT, left, exec, hyprland-move-window $myMoveSiez l
bind = SUPER_ALT, right, exec, hyprland-move-window $myMoveSize r
bind = SUPER_ALT, up, exec, hyprland-move-window $myMoveSize u
bind = SUPER_ALT, down, exec, hyprland-move-window $myMoveSize d
# ################################################################
# ### OVERRIDE SPLIT DIRECTION FOR NEXT WINDOW (MANUAL TILING) ###
# ################################################################
bind = SUPER_ALT, left, layoutmsg, preselect l
bind = SUPER_ALT, right, layoutmsg, preselect r
bind = SUPER_ALT, up, layoutmsg, preselect u
bind = SUPER_ALT, down, layoutmsg, preselect d
# ######################################################
# ### SWITCH WORKSPACE (SWAPPING TO CURRENT MONITOR) ###
# ######################################################
bind = SUPER, 1, focusworkspaceoncurrentmonitor, 1
bind = SUPER, 2, focusworkspaceoncurrentmonitor, 2
bind = SUPER, 3, focusworkspaceoncurrentmonitor, 3
bind = SUPER, 4, focusworkspaceoncurrentmonitor, 4
bind = SUPER, 5, focusworkspaceoncurrentmonitor, 5
bind = SUPER, 6, focusworkspaceoncurrentmonitor, 6
bind = SUPER, 7, focusworkspaceoncurrentmonitor, 7
bind = SUPER, 8, focusworkspaceoncurrentmonitor, 8
bind = SUPER, 9, focusworkspaceoncurrentmonitor, 9
# ################################
# ### MOVE WINDOW TO WORKSPACE ###
# ################################
bind = SUPER_SHIFT, 1, movetoworkspacesilent, 1
bind = SUPER_SHIFT, 2, movetoworkspacesilent, 2
bind = SUPER_SHIFT, 3, movetoworkspacesilent, 3
bind = SUPER_SHIFT, 4, movetoworkspacesilent, 4
bind = SUPER_SHIFT, 5, movetoworkspacesilent, 5
bind = SUPER_SHIFT, 6, movetoworkspacesilent, 6
bind = SUPER_SHIFT, 7, movetoworkspacesilent, 7
bind = SUPER_SHIFT, 8, movetoworkspacesilent, 8
bind = SUPER_SHIFT, 9, movetoworkspacesilent, 9
# ###########################################
# ### MOVE WINDOW TO WORKSPACE + FOCUS IT ###
# ###########################################
bind = ALT, 1, movetoworkspace, 1
bind = ALT, 2, movetoworkspace, 2
bind = ALT, 3, movetoworkspace, 3
bind = ALT, 4, movetoworkspace, 4
bind = ALT, 5, movetoworkspace, 5
bind = ALT, 6, movetoworkspace, 6
bind = ALT, 7, movetoworkspace, 7
bind = ALT, 8, movetoworkspace, 8
bind = ALT, 9, movetoworkspace, 9
# ############################################
# ### CYCLE WORKSPACES (RELATIVE MOVEMENT) ###
# ############################################
bind = SUPER, mouse_down, workspace, +1
bind = SUPER, mouse_up, workspace, -1
bind = SUPER, bracketleft, workspace, -1
bind = SUPER, bracketright, workspace, +1
# ##########################################
# ### CYCLE MONITORS (RELATIVE MOVEMENT) ###
# ##########################################
bind = SUPER_SHIFT, bracketleft, focusmonitor, -1
bind = SUPER_SHIFT, bracketright, focusmonitor, +1
# #######################
# ### WINDOW RESIZING ###
# #######################
## Mouse window resizing
bindm = SUPER, $MOUSE_LMB, movewindow
bindm = SUPER, $MOUSE_RMB, resizewindow
## Quick keyboard resizing
binde = ALT, right, resizeactive, 10 0
binde = ALT, left, resizeactive, -10 0
binde = ALT, up, resizeactive, 0 -10
binde = ALT, down, resizeactive, 0 10
binde = ALT, H, resizeactive, -10 0
binde = ALT, K, resizeactive, 0 -10
binde = ALT, J, resizeactive, 0 10
binde = ALT, L, resizeactive, 10 0
## Precise keyboard resizing (submap)
bind = SUPER, slash, submap, resize
submap = resize
binde = , right, resizeactive, 10 0
binde = , left, resizeactive, -10 0
binde = , up, resizeactive, 0 -10
binde = , down, resizeactive, 0 10
binde = SUPER, right, resizeactive, 30 0
binde = SUPER, left, resizeactive, -30 0
binde = SUPER, up, resizeactive, 0 -30
binde = SUPER, down, resizeactive, 0 30
binde = SHIFT, right, resizeactive, 1 0
binde = SHIFT, left, resizeactive, -1 0
binde = SHIFT, up, resizeactive, 0 -1
binde = SHIFT, down, resizeactive, 0 1
binde = , H, resizeactive, -10 0
binde = , K, resizeactive, 0 -10
binde = , J, resizeactive, 0 10
binde = , L, resizeactive, 10 0
binde = , right, resizeactive, 10 0
binde = , left, resizeactive, -10 0
binde = , up, resizeactive, 0 -10
binde = , down, resizeactive, 0 10
binde = SUPER, H, resizeactive, -30 0
binde = SUPER, K, resizeactive, 0 -30
binde = SUPER, J, resizeactive, 0 30
binde = SUPER, L, resizeactive, 30 0
binde = SHIFT, H, resizeactive, -1 0
binde = SHIFT, K, resizeactive, 0 -1
binde = SHIFT, J, resizeactive, 0 1
binde = SHIFT, L, resizeactive, 1 0
bind = , escape, submap, reset
bind = , return, submap, reset
bind = SUPER, slash, submap, reset
submap = reset
# ########################################################
# ### GLOBAL KEYBINDS (PASSING KEYS TO OTHER PROGRAMS) ###
# ########################################################
bind = CTRL, F10, pass, ^(com\.obsproject\.Studio)$
# #######################
# ### ISOLATION GROUP ###
# #######################
# Isolating group to prevent keybind capturing (for games etc)
# SUPER + End
bind = SUPER, End, exec, hyprctl dispatch submap isolate && notify-send "Keybind isolation" "Keybind isolation on (Super + END to disable)"
submap = isolate
bind = SUPER, End, exec, hyprctl dispatch submap reset && notify-send "Keybind isolation" "Keybind isolation off"
submap = reset
# vi: ft=hyprlang

View file

@ -0,0 +1,23 @@
general {
layout = dwindle
}
dwindle {
# Don't change the split (side/top) regardless
# of what happens to the container
preserve_split = true
# Scale down special workspaces (bigger borders)
special_scale_factor = 0.9
}
group {
# Add new windows in the group after the current window
# rather than after the group tail window
insert_after_current = true
# Focus the window that was just moved out of the group
focus_removed_window = true
}
# vi: ft=hyprlang

View file

@ -0,0 +1,14 @@
misc {
# Disable redundant renders (covered by wallpaper)
disable_hyprland_logo = true
disable_splash_rendering = true
# follow requests from windows to be focused
focus_on_activate = true
# Enable DPMS on these actions
mouse_move_enables_dpms = true
key_press_enables_dpms = true
}
# vi: ft=hyprlang

View file

@ -0,0 +1,28 @@
# #######################
# ### LOADING PLUGINS ###
# #######################
exec-once=hyprpm reload -n
#exec-once=hyprctl plugin load $HOME/.local/share/hyprload/plugins/bin/dwindle-autogroup.so
# ################
# ### HYPRBARS ###
# ################
plugin {
hyprbars {
bar_height = 20
bar_color = rgb(505152)
col.text = rgb(ff0000)
bar_text_size = 10
# example buttons (R -> L)
# hyprbars-button = color, size, on-click
hyprbars-button = rgb(ff4040), 10, 󰖭, hyprctl dispatch killactive
hyprbars-button = rgb(eeee11), 10, , hyprctl dispatch fullscreen 1
}
}
# vi: ft=hyprlang

View file

@ -0,0 +1,130 @@
# ###################
# ### WINDOW GAPS ###
# ###################
general {
gaps_in = 5
gaps_out = 8
}
# ###############
# ### BORDERS ###
# ###############
decoration {
rounding = 8
}
general {
border_size = 2
# Regular windows
col.active_border = rgba(FFA500FF) # orange
#col.active_border = rgba(FFFFFFEE) # white
col.inactive_border = rgba(666666AA) # transparent gray
# Windows with nogroup property
col.nogroup_border_active = rgba(FF00FFFF) # purple
col.nogroup_border = rgba(FF00FFAA) # transparent purple
}
group {
# Groupped windows
col.border_active = rgba(00A500FF) # green
col.border_inactive = rgba(5AA500FF) # transparent green
# Locked groupped windows
col.border_locked_active = rgba(A0A500FF) # yellow
col.border_locked_inactive = rgba(A0A500AA) # transparent yellow
}
# #################
# ### GROUP BAR ###
# #################
group {
groupbar {
# Title box above window
render_titles = false # disable, looks kinda bad
font_family = Monaspace Krypton
font_size = 11
text_color = rgba(FFFFFFFF) # white
# Gradients should be enabled only if title rendering is also enabled
# on their own, they look really bad
gradients = false
col.active = rgba(FFA500FF) # light orange
col.inactive = rgba(00A500AA) # transparent green
col.locked_active = rgba(FF8000FF) # dark orange
col.locked_inactive = rgba(A0A500AA) # transparent yellow
# Scrolling in the groupbar shouldn't change the active window
scrolling = false
}
}
# ###################
# ### DROP SHADOW ###
# ###################
decoration {
shadow {
enabled = true # enable drop shadow
range = 20
render_power = 2
color = rgba(0F0F0FE6)
#color = rgba(FFA500FF)
color_inactive = rgba(0F0F0F99)
}
}
# ###################
# ### WINDOW BLUR ###
# ###################
decoration {
blur {
enabled = true
size = 8
passes = 1
}
}
# ########################
# ### INACTIVE WINDOWS ###
# ########################
decoration {
#dim_inactive = true
dim_strength = 0.05
dim_special = 0.2
# inactive_opacity = 0.9
}
# ##################
# ### ANIMATIONS ###
# ##################
animations {
enabled = true
first_launch_animation = true # fade in on first launch
animation = windows, 1, 3, default, popin 50%
animation = border, 1, 4, default
animation = fade, 1, 4, default
animation = workspaces, 1, 3, default
animation = specialWorkspace, 1, 2, default, slidefadevert
}
misc {
animate_manual_resizes = true
}
# #################
# ### WALLPAPER ###
# #################
# vi: ft=hyprlang

View file

@ -0,0 +1,109 @@
# ###########################
# ### ASSIGNED WORKSPACES ###
# ###########################
windowrulev2 = workspace 2, class:^(firefox)$
windowrulev2 = workspace 4, class:^(discord)$
windowrulev2 = workspace 4, class:^(vesktop)$
windowrulev2 = workspace 4, class:^(WebCord)$
windowrulev2 = workspace 5, class:^(Spotify)$
windowrulev2 = workspace 6, class:^(Stremio)$
windowrulev2 = workspace 6, class:^(com.stremio.stremio)$
# #######################
# ### IDLE INHIBITION ###
# #######################
windowrulev2 = idleinhibit focus, class:^(Stremio)$
windowrulev2 = idleinhibit focus, class:^(com.stremio.stremio)$
windowrulev2 = idleinhibit focus, class:^(mpv)$
windowrulev2 = idleinhibit focus, class:^(firefox)$,title:^(.+ - YouTube — Mozilla Firefox)$
windowrulev2 = idleinhibit focus, class:^(firefox)$,title:^(Picture-in-Picture)$
# ################################
# ### CORRECT SIZE / AUTO TILE ###
# ################################
windowrulev2 = size 800 550, class:^(qalculate-gtk)$
windowrulev2 = tile, class:^(Spotify)$
# ##################
# ### AUTO FLOAT ###
# ##################
windowrulev2 = float, class:^(Lxappearance)$
windowrulev2 = float, class:^(Rofi)$
windowrulev2 = float, class:^(feh)$
windowrulev2 = float, class:^(pavucontrol-qt)$
windowrulev2 = float, class:^(pavucontrol)$
windowrulev2 = float, class:^(file-roller)$
windowrulev2 = float, class:^(qalculate-gtk)$
windowrulev2 = float, class:^(com.github.wwmm.easyeffects)
windowrulev2 = float, class:^(opensnitch_ui)$
windowrulev2 = float, class:^(Brave-browser)$,title:^(_crx_.+)$
## Float hyprland-share-picker & some extra actions
windowrulev2 = float, class:^(hyprland-share-picker)$
windowrulev2 = center, class:^(hyprland-share-picker)$
windowrulev2 = animation slide, class:^(hyprland-share-picker)$
## Float firefox windows (like bookmark menus, or some extension windows)
windowrulev2 = float, class:^(firefox)$,title:^(Revert Bookmarks)$
windowrulev2 = float, class:^(firefox)$,title:^(Library)$
windowrulev2 = float, class:^(firefox)$,title:^(Extension: \(uBlock Origin\))
windowrulev2 = float, class:^(firefox)$,title:^(Extension: \(Bitwarden Password Manager\) - Bitwarden — Mozilla Firefox)$
windowrulev2 = float, class:^(firefox)$,title:^(Firefox — Sharing Indicator)$
windowrulev2 = float, class:^(firefox)$,title:^(Opening .+)$
windowrulev2 = float, class:^(firefox)$,title:^$
## Float some pcmanfm windows
windowrulev2 = float, class:^(pcmanfm-qt)$,title:^(Mount)$
windowrulev2 = float, class:^(pcmanfm-qt)$,title:^(Preferences)$
windowrulev2 = float, class:^(pcmanfm-qt)$,title:^(Move files)$
windowrulev2 = float, class:^(pcmanfm-qt)$,title:^(Search Files)$
windowrulev2 = float, class:^(pcmanfm-qt)$,title:^(Copy Files)$
windowrulev2 = float, class:^(pcmanfm-qt)$,title:^(Confirm to replace files)$
windowrulev2 = float, class:^(pcmanfm-qt|)$,title:^(Choose an Application)$
## Float some qimgv windows
windowrulev2 = float, class:^(qimgv)$,title:^(Add shortcut)$
windowrulev2 = float, class:^(qimgv)$,title:^(Preferences — qimgv)$
## Float some windows from other apps
windowrulev2 = float, class:^(Spotify)$,title:^(Ozone X11)$
windowrulev2 = float, class:^(python3)$,title:^(Tor Browser Launcher Settings)$
windowrulev2 = float, class:^(python3)$,title:^(Tor Browser)$
## General float rules
windowrulev2 = float, class:^(file_progress)$
windowrulev2 = float, class:^(confirm)$
windowrulev2 = float, class:^(dialog)$
windowrulev2 = float, class:^(download)$
windowrulev2 = float, class:^(notification)$
windowrulev2 = float, class:^(error)$
windowrulev2 = float, class:^(splash)$
windowrulev2 = float, class:^(confirmreset)$
windowrulev2 = float, class:^(floating)$
## Float all windows that don't have a title nor a class
windowrulev2 = float, class:^$,title:^$
# #############
# ### FIXES ###
# #############
# jetbrains
windowrulev2 = center, class:^(jetbrains-.*)$,title:^(splash)$,floating:1
windowrulev2 = nofocus, class:^(jetbrains-.*)$,title:^(splash)$,floating:1
windowrulev2 = noborder, class:^(jetbrains-.*)$,title:^(splash)$,floating:1
windowrulev2 = center, class:^(jetbrains-.*)$,title:^( )$,floating:1
windowrulev2 = stayfocused, class:^(jetbrains-.*)$,title:^( )$,floating:1
windowrulev2 = noborder, class:^(jetbrains-.*)$,title:^( )$,floating:1
windowrulev2 = nofocus, class:^(jetbrains-.*)$,title:^(win.*)$,floating:1
windowrulev2 = noinitialfocus, class:^(jetbrains-.*)$,title:^(win.*)$
# Don't add borders to grim selections when taking screenshots
layerrule = noanim, ^(selection)$
# vi: ft=hyprlang

View file

@ -0,0 +1,226 @@
# ######################
# ### GENERAL CONFIG ###
# ######################
general {
disable_loading_bar = false
hide_cursor = true
grace = 3
}
auth {
pam:enabled = true
#fingerprint:enabled = true
}
background {
path = ~/Media/Pictures/Wallpapers/Categories/Extra/origami.png
blur_passes = 3
blur_size = 6
#contrast = 0.7
#brightness = 0.7
noise = 0.01
contrast = 0.9
brightness = 0.6
}
# #######################
# ### PASSWORD CIRCLE ###
# #######################
# Use a swaylock-like circle, lighting up random segments as you type
input-field {
size = 300, 250
rounding = -1
outline_thickness = 30
outer_color = rgba(33ccffee)
inner_color = rgb(29, 31, 33)
font_color = rgb(100, 100, 100)
check_color = rgba(cc8822ff) # override outer_color while checking the pw (could take a while sometimes - pam lockouts)
fail_color = rgba(cc2222ff) # override outer_color and fail message color if auth failed
fail_transition = 500 # transition time in ms between normal outer_color and fail_color
fail_text = # Leave this empty (amt of attempts and fail reason shown with labels)
invert_numlock = true # use numlock_color instead of outer color when numlock is off, not on
capslock_color = rgba(fad03cff)
numlock_color = rgba(bdba03ff)
bothlock_color = rgba(dcc520ff)
hide_input = true
fade_on_empty = false
placeholder_text = # Leave this empty
position = 0, 0
halign = center
valign = center
}
# Show time (inside of the circle)
label {
text = cmd[update:200] date +'%H:%M:%S'
color = rgba(129, 162, 190, 1.0)
font_size = 35
font_family = Noto Sans
position = 0, 30
halign = center
valign = center
}
# Show date (inside of the circle, below time)
label {
text = cmd[update:1000] date +'%a, %x'
color = rgba(129, 162, 190, 1.0)
font_size = 20
font_family = Noto Sans
position = 0, -20
halign = center
valign = center
}
# Keyboard layout
label {
text = $LAYOUT
color = rgba(129, 162, 190, 1.0)
font_size = 10
font_family = Noto Sans
position = 0, -90
halign = center
valign = center
}
# ####################
# ### OTHER LABELS ###
# ####################
# Failed attempts count
label {
text = <i>Logged <span foreground='##FFA500'>$ATTEMPTS[0]</span> failure(s)</i>
color = rgba(153, 153, 153, 1.0) # gray
font_size = 14
font_family = Noto Sans
shadow_passes = 1
shadow_size = 1
shadow_boost = 1.0
position = 0, -200
halign = center
valign = center
}
# Fail reason
label {
text = <i>$FAIL</i>
color = rgba(255, 34, 34, 1.0) # red
font_size = 14
font_family = Noto Sans
shadow_passes = 1
shadow_size = 1
shadow_boost = 1.0
position = 0, -230
halign = center
valign = center
}
# Fingerprint scan status
label {
text = <i>$FPRINTPROMPT $FPRINTFAIL</i>
color = rgba(153, 153, 153, 1.0) # gray
font_size = 14
font_family = Noto Sans
shadow_passes = 1
shadow_size = 1
shadow_boost = 1.0
position = 0, 0
halign = center
valign = bottom
}
# Splash text
label {
text = Session Locked
color = rgba(255, 255, 255, 1.0)
font_size = 40
font_family = Monaspace Krypton
shadow_passes = 1
shadow_size = 5
shadow_boost = 1.8
position = 0, 220
halign = center
valign = center
}
# Device uptime
label {
text = cmd[update:1000] echo " $(uptime -p | sed -e 's/^up //' -e 's/ years\?,\?/y/' -e 's/ months\?,\?/m/' -e 's/ weeks\?,\?/w/' -e 's/ days\?,\?/d/' -e 's/ hours\?,\?/h/' -e 's/ minutes\?.\?/m/' -e 's/ seconds\?,\?/s/' | cut -d' ' -f-2)"
color = rgba(129, 162, 190, 1.0)
font_size = 11
font_family = Noto Sans
position = -90, -20
halign = right
valign = top
}
# Battery percentage
label {
text = cmd[update:1000] echo " $(cat /sys/class/power_supply/BAT0/capacity)%"
color = rgba(129, 162, 190, 1.0)
font_size = 11
font_family = Noto Sans
shadow_passes = 1
shadow_size = 5
shadow_boost = 1.8
position = -20, -20
halign = right
valign = top
}
# User account
label {
text =  $USER
color = rgba(129, 162, 190, 1.0)
font_size = 11
font_family = Noto Sans
shadow_passes = 1
shadow_size = 5
shadow_boost = 1.8
position = 20, -20
halign = left
valign = top
}
# Recovery email (lost device)
label {
text = recovery@itsdrike.com
color = rgba(129, 162, 190, 1.0)
font_size = 11
font_family = Noto Sans
shadow_passes = 1
shadow_size = 5
shadow_boost = 1.8
position = 20, 12
halign = left
valign = bottom
}
# vi: ft=hyprlang

View file

@ -0,0 +1,5 @@
$bg = $HOME/Media/Pictures/Wallpapers/active
preload=$bg
wallpaper=,$bg # same wallpaper on all monitors
ipc=off

Some files were not shown because too many files have changed in this diff Show more