mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-04-11 06:02:28 +00:00
Compare commits
443 commits
Author | SHA1 | Date | |
---|---|---|---|
2113835e41 | |||
ee6f059647 | |||
ddbfc640fa | |||
07d85ad240 | |||
ee9469230f | |||
fcf1762b1c | |||
409723adf6 | |||
c51ae232c6 | |||
bcff64f0fc | |||
fbc693674d | |||
1abeb1e9ab | |||
d68284ed85 | |||
35dceab233 | |||
3993fb896d | |||
510d01ef47 | |||
1a345713b3 | |||
c0e871af58 | |||
b93efba0fd | |||
f6f292306e | |||
6c5c3fb36c | |||
db58721f45 | |||
f871b7b427 | |||
9e946c7611 | |||
6fc5d3a03d | |||
9931adaec5 | |||
4b37fb8fb3 | |||
ffd352074f | |||
c8d1e94c0f | |||
df82f47ccb | |||
e11b3c9dd7 | |||
a3a0000c4a | |||
5a0132296b | |||
339e17716c | |||
c4928b163a | |||
9b3c5b20aa | |||
dacb4ac34c | |||
31ab2cdb8e | |||
75cc7d5102 | |||
63873fcccf | |||
8fcf3646fe | |||
867ba642c6 | |||
d9c71e2310 | |||
b9aaebc10c | |||
e90cada897 | |||
b0ca57ac4a | |||
d2f808f469 | |||
254181c0fc | |||
df585b737b | |||
11ef5e8a1c | |||
03608c5b1c | |||
934579abf0 | |||
98b3c35444 | |||
3c29dab3c5 | |||
e8136e9666 | |||
7a63d4df6f | |||
973bd59b59 | |||
b15a43697f | |||
60f77b7707 | |||
2320760c85 | |||
8a86b41b19 | |||
ff22d1e9d5 | |||
0ee56ce533 | |||
3325992ce4 | |||
7049bab02f | |||
42d4a02eb4 | |||
e621adedf3 | |||
7d28f984a5 | |||
fd5c9ed762 | |||
118cd7f676 | |||
9bb205b74d | |||
6404099438 | |||
545fd01ae4 | |||
da1b1f1c76 | |||
9bf79edda2 | |||
bd7f0b78a6 | |||
a5191afbf9 | |||
6527de32b5 | |||
c2564684da | |||
59c3b49d33 | |||
ae02222df1 | |||
a1f9a7c82d | |||
0d3c5f1db4 | |||
eba5d3fdbc | |||
b29dfb9af6 | |||
05e61f18a1 | |||
2d77f7d95c | |||
9bade74f02 | |||
e33d386521 | |||
f769f85293 | |||
d0c25b5901 | |||
6ff912d3b8 | |||
0e0dd92bb9 | |||
82ab38ae7f | |||
3c1362f7c9 | |||
0f78f4e61e | |||
292778fa9c | |||
cbb7fa714b | |||
ebe36051d5 | |||
ecac51aadb | |||
2f9a4044ba | |||
46de81f52b | |||
578559f8d2 | |||
461839260d | |||
2a57a33762 | |||
a473ed5cb3 | |||
f77786d892 | |||
d7bf3a044d | |||
dc4d6fd43f | |||
fe1fe28219 | |||
d199e7ab58 | |||
97459fc7e8 | |||
29583e07b7 | |||
40094c9628 | |||
56c1821716 | |||
e3d9c46c61 | |||
beb5e2ba30 | |||
770e9f46c1 | |||
9538d5c1b1 | |||
f16a5c999a | |||
2fec62fdd3 | |||
1cb455fba7 | |||
74b3df693c | |||
f20cbc479e | |||
3233c322b6 | |||
1a3327a37c | |||
77a8cced84 | |||
18252755b8 | |||
525c6ee5a8 | |||
29159b9fb3 | |||
2ac4840117 | |||
4e7a291bd9 | |||
8621bdaae1 | |||
f1531c7274 | |||
296a5b86cf | |||
cf2ac68b64 | |||
cc54b67635 | |||
c900d14516 | |||
55a70492a2 | |||
6aeff61f59 | |||
08929b8360 | |||
0806557d5d | |||
9a79a5453b | |||
6e31a94da3 | |||
24d34c0d11 | |||
0291bccf22 | |||
4049a59628 | |||
2bf70e652a | |||
200cffd629 | |||
4bef2362d4 | |||
91ae4cb3b7 | |||
b15574ce25 | |||
ee3dc5a256 | |||
0bcfd32b78 | |||
212fd0d82f | |||
90ede066a4 | |||
8b00572567 | |||
8d8b05d0f6 | |||
79fe6bf657 | |||
3b5ac91ae8 | |||
62912b75ba | |||
2da877dfba | |||
fc45c3eb7a | |||
c4053d8496 | |||
ccd5f28999 | |||
f0ce0a249d | |||
3cc7ee31a8 | |||
fdc5d6108f | |||
be2013e4d4 | |||
08973fb001 | |||
2391f389ca | |||
65f675cfdd | |||
722649b3a4 | |||
f29837c598 | |||
a56a2a4daa | |||
e2ae926dbc | |||
c247c0fbab | |||
6a803b051a | |||
6273223007 | |||
16546e3f34 | |||
ba4e46bdb3 | |||
35dcf5ffa0 | |||
6d327a133b | |||
fab6bdce66 | |||
32ed1b9a7d | |||
4c19890318 | |||
7801977c2e | |||
065c6cee0c | |||
4091125515 | |||
5bf0cd7267 | |||
9e242c5f47 | |||
5f3d1fde5d | |||
ac390b1d64 | |||
64ad18c6f6 | |||
60f8b7ec79 | |||
47429dddee | |||
b83e5b55a1 | |||
c615c1368b | |||
4488a65de5 | |||
22d15d2093 | |||
03b4e74694 | |||
6ec7231174 | |||
291ebd4f63 | |||
a48d3a5502 | |||
5f3e02b29c | |||
983d95c2a6 | |||
52aabcdfb6 | |||
f21ddf9f5a | |||
dbd7e017d3 | |||
9072761185 | |||
97fa55a935 | |||
0025d52ab9 | |||
47af19d900 | |||
946589562d | |||
b42498ea5d | |||
36553763a1 | |||
68b0d96841 | |||
427d15e717 | |||
15075f2009 | |||
590b681070 | |||
84afdb1bbf | |||
bbc2294602 | |||
64af08d11e | |||
01c03651ce | |||
e0e03aee0f | |||
84bfe7e967 | |||
945e7dcce6 | |||
ca1864eb56 | |||
59768f2935 | |||
61197fb18e | |||
36c91ef958 | |||
e848833628 | |||
eddcb6a825 | |||
0565a2e651 | |||
4aaa1e1e64 | |||
9921a7bdc4 | |||
74467ca4c4 | |||
1d97d2e918 | |||
ccb03eb330 | |||
fddd312ffb | |||
27056562d5 | |||
acc4abd023 | |||
4127f1a7d9 | |||
3f5fef59c9 | |||
eaf2c5cec0 | |||
3036faee22 | |||
8db46cd6bf | |||
61136611de | |||
e7f7ac8334 | |||
3cfb4df6af | |||
259d84b6cd | |||
312e27aa6b | |||
f0f6336b4e | |||
b430528874 | |||
eed7a6ad08 | |||
d2e41de5b5 | |||
76b961f4b3 | |||
d68ade6f62 | |||
5972b65e95 | |||
bc3a65ba93 | |||
02b99b30cb | |||
0e05953a38 | |||
f1dabb9f19 | |||
63f92dbba7 | |||
e6e497b779 | |||
e3dc08d787 | |||
0e148e6343 | |||
64beef9cb6 | |||
9766350e8d | |||
921590323f | |||
96d3eefb39 | |||
475d163269 | |||
bd5ef1bef4 | |||
112368f7d1 | |||
e7aa2bb510 | |||
88072cac31 | |||
947b3a84c0 | |||
12b77dfa2f | |||
de1fec1b7e | |||
2d8ba074f5 | |||
8a33d738af | |||
8dfb109e83 | |||
4c7e892acb | |||
7f2f567807 | |||
681427ad9a | |||
8767fdf367 | |||
c9d593ef4f | |||
7c735df204 | |||
6ce522f012 | |||
81224d24e7 | |||
449e912560 | |||
bf5734f571 | |||
3159fc4909 | |||
bec052f159 | |||
245b75837e | |||
e0a7754c2e | |||
2301eb550f | |||
bd0b7801a2 | |||
52d9765f68 | |||
390cecf165 | |||
15bc7ea4a6 | |||
7e6eeed575 | |||
0272a69330 | |||
2028a65409 | |||
0ce57ecb3a | |||
d4dad7beff | |||
f76f7c65da | |||
d8430aa089 | |||
d918406072 | |||
745e6838ec | |||
0734993789 | |||
d583587360 | |||
a5e1737cfa | |||
a1749885f3 | |||
aa6af14455 | |||
186d00cd66 | |||
adb438f050 | |||
2a4dbd98db | |||
cb0e365a8f | |||
5154b019cf | |||
67129762a5 | |||
254d56c874 | |||
2d9a741ae0 | |||
0be14cd96a | |||
a9c6b2439b | |||
0b7ba9c3cb | |||
3bd24d6d27 | |||
d7f171df59 | |||
0909c9f59b | |||
746e79aa30 | |||
948bb3be6b | |||
cf68e7a4e2 | |||
4d5c96a804 | |||
924ac09370 | |||
920216d3ea | |||
f8f96d4dd7 | |||
ed1487a251 | |||
9293df67bf | |||
29f82a4ac0 | |||
838d9b88ba | |||
b67f5a2c05 | |||
cb6f7e60c4 | |||
b17982a298 | |||
c3b4d535ce | |||
9e042a78a7 | |||
7ae0ced2c0 | |||
109d0d630b | |||
eda84b5ab8 | |||
e1de14e80b | |||
10f0e3eb91 | |||
56140d624f | |||
05dcf54c6a | |||
17af415787 | |||
2f68ed84aa | |||
14f652a409 | |||
edece87bbc | |||
e4b7eac1e3 | |||
c1c1d43f90 | |||
456833fbe3 | |||
17c29fcb48 | |||
e4dabd5a41 | |||
bf23640fe7 | |||
b99fe275bd | |||
a5432fa1ab | |||
6d8590b0dc | |||
7a81a38d10 | |||
16d845f25b | |||
43fc732460 | |||
3d1a47acc7 | |||
d5487addcb | |||
d015c59179 | |||
e1e149f288 | |||
8fa29912a9 | |||
b017d2b67e | |||
fc4b6f597e | |||
1f8bebd13b | |||
89a5b15bbd | |||
843904b67d | |||
c0e2c397c0 | |||
f18b01f9ad | |||
62c4bec0a7 | |||
9ce557ba05 | |||
24fe73a076 | |||
6749d1003f | |||
52213e5eed | |||
efe9388a41 | |||
216beedac2 | |||
c8fa3d646b | |||
3a46009989 | |||
6ae5ef0f66 | |||
0de04c9a62 | |||
7bf40cbf70 | |||
07479d0426 | |||
cbdab09b52 | |||
310567eee8 | |||
a498f4264a | |||
78c6f0d26c | |||
d329f9a4dc | |||
4fccf5d569 | |||
4dc598c07e | |||
c6ab0033b4 | |||
ca8c1ee6fb | |||
49afc714f6 | |||
f8d51d5f26 | |||
39f8fa2012 | |||
d7b486ab0a | |||
9ec3b2ec06 | |||
084460f7fa | |||
057a854cbd | |||
504462b592 | |||
a89c25abb2 | |||
10c8a93266 | |||
35e386abc6 | |||
c859bf2273 | |||
a49fd89a88 | |||
a708bf90d3 | |||
63c33c00c6 | |||
2bf1f949e4 | |||
50efe01b09 | |||
48ba2d1f76 | |||
98f8dc30fc | |||
cffb0c2690 | |||
8b8d24c4b1 | |||
1e534616c7 | |||
1f6ad7f0b6 | |||
6e25c58352 | |||
0adc8f38f5 | |||
50f1ff3a55 | |||
ede00ca602 | |||
d68bdb594b | |||
44b010a541 | |||
542ac098b4 | |||
ce7b6837f6 | |||
27b9e0ea42 | |||
5a086c6ec7 | |||
8bfcc5b9ea | |||
d4d5e24f40 | |||
01acb9087e | |||
3b655f6b6b | |||
46e30950b7 | |||
8536bfa688 | |||
a3e01caebf | |||
b912871070 | |||
eadb37961b |
386 changed files with 13008 additions and 10376 deletions
32
.gitignore
vendored
32
.gitignore
vendored
|
@ -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
30
.gitmodules
vendored
|
@ -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
157
README.md
|
@ -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: 
|
||||
- Command timing showcase: 
|
||||
- Neovim configuration written in lua: 
|
||||
- Automatic unknown command package handler: 
|
||||
- `lf` file manager previews with ueberzug: 
|
||||
**Prompt timing showcase**
|
||||

|
||||
|
||||
**Terminal color scheme showcase**
|
||||

|
||||
|
||||
**Unknown command package handler**
|
||||

|
||||
|
||||
## 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
|
||||
|
|
|
@ -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)
|
6
firefox/chrome/userChrome.css
Normal file
6
firefox/chrome/userChrome.css
Normal 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;
|
||||
}
|
10
firefox/ublock/custom_filter_lists.txt
Normal file
10
firefox/ublock/custom_filter_lists.txt
Normal 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
|
65
firefox/ublock/my_filters.txt
Normal file
65
firefox/ublock/my_filters.txt
Normal 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
168
firefox/ublock/my_rules.txt
Normal 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
76
firefox/user-overrides.js
Normal 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
367
guides/01_INSTALLATION.md
Normal 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)
|
138
guides/02_AUTOMOUNTING_ENCRYPTED_PARTITIONS.md
Normal file
138
guides/02_AUTOMOUNTING_ENCRYPTED_PARTITIONS.md
Normal 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 -->
|
205
guides/03_UNIFIED_KERNEL_IMAGES.md
Normal file
205
guides/03_UNIFIED_KERNEL_IMAGES.md
Normal 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
186
guides/04_SECURE_BOOT.md
Normal 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).
|
211
guides/05_SYSTEMD_INITRAMFS.md
Normal file
211
guides/05_SYSTEMD_INITRAMFS.md
Normal 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
227
guides/06_TPM_UNLOCKING.md
Normal 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>
|
280
guides/99_BATTERY_OPTIMIZATIONS.md
Normal file
280
guides/99_BATTERY_OPTIMIZATIONS.md
Normal 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
152
guides/99_GREETD.md
Normal 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
76
guides/99_PRINTING.md
Normal 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
668
guides/99_THEMING.md
Normal 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
37
guides/hibernation.md
Normal 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`)
|
|
@ -1 +0,0 @@
|
|||
|
3
home/.config/Kvantum/kvantum.kvconfig
Normal file
3
home/.config/Kvantum/kvantum.kvconfig
Normal file
|
@ -0,0 +1,3 @@
|
|||
[General]
|
||||
theme=catppuccin-mocha-blue
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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
2
home/.config/black
Normal file
|
@ -0,0 +1,2 @@
|
|||
[tool.black]
|
||||
line-length=119
|
|
@ -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
245
home/.config/btop/btop.conf
Normal 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 = ""
|
1
home/.config/chromium-flags.conf
Normal file
1
home/.config/chromium-flags.conf
Normal file
|
@ -0,0 +1 @@
|
|||
--ozone-platform-hint=auto
|
|
@ -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
|
||||
}
|
|
@ -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.
|
||||
|
|
43
home/.config/eww/css/_colors.scss
Normal file
43
home/.config/eww/css/_colors.scss
Normal 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;
|
55
home/.config/eww/css/modules/_battery.scss
Normal file
55
home/.config/eww/css/modules/_battery.scss
Normal 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; }
|
||||
}
|
3
home/.config/eww/css/modules/_bitcoin.scss
Normal file
3
home/.config/eww/css/modules/_bitcoin.scss
Normal file
|
@ -0,0 +1,3 @@
|
|||
.bitcoin {
|
||||
.icon { margin-right: 6px; color: $gold; }
|
||||
}
|
4
home/.config/eww/css/modules/_clock.scss
Normal file
4
home/.config/eww/css/modules/_clock.scss
Normal file
|
@ -0,0 +1,4 @@
|
|||
.clock {
|
||||
// color: $sapphire;
|
||||
.icon { margin-right: 6px; color: $sapphire; }
|
||||
}
|
3
home/.config/eww/css/modules/_cpu.scss
Normal file
3
home/.config/eww/css/modules/_cpu.scss
Normal file
|
@ -0,0 +1,3 @@
|
|||
.cpu {
|
||||
.icon { color: $lime; }
|
||||
}
|
7
home/.config/eww/css/modules/_gammarelay.scss
Normal file
7
home/.config/eww/css/modules/_gammarelay.scss
Normal file
|
@ -0,0 +1,7 @@
|
|||
.gammarelay {
|
||||
.icon {
|
||||
color: $peach;
|
||||
margin-left: 2px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
}
|
3
home/.config/eww/css/modules/_kernel.scss
Normal file
3
home/.config/eww/css/modules/_kernel.scss
Normal file
|
@ -0,0 +1,3 @@
|
|||
.kernel {
|
||||
.icon { color: $lavender; }
|
||||
}
|
3
home/.config/eww/css/modules/_memory.scss
Normal file
3
home/.config/eww/css/modules/_memory.scss
Normal file
|
@ -0,0 +1,3 @@
|
|||
.memory {
|
||||
.icon { color: $maroon; }
|
||||
}
|
3
home/.config/eww/css/modules/_uptime.scss
Normal file
3
home/.config/eww/css/modules/_uptime.scss
Normal file
|
@ -0,0 +1,3 @@
|
|||
.uptime {
|
||||
.icon { color: $green; }
|
||||
}
|
9
home/.config/eww/css/modules/_volume.scss
Normal file
9
home/.config/eww/css/modules/_volume.scss
Normal file
|
@ -0,0 +1,9 @@
|
|||
.volume {
|
||||
.icon { color: $peach; }
|
||||
.speaker {
|
||||
.icon {
|
||||
margin-left: 8px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
4
home/.config/eww/css/modules/_window_name.scss
Normal file
4
home/.config/eww/css/modules/_window_name.scss
Normal file
|
@ -0,0 +1,4 @@
|
|||
.window_name {
|
||||
font-family: "Monaspace Krypton";
|
||||
font-size: 1.4rem;
|
||||
}
|
29
home/.config/eww/css/modules/_workspaces.scss
Normal file
29
home/.config/eww/css/modules/_workspaces.scss
Normal 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;
|
||||
}
|
||||
}
|
32
home/.config/eww/css/windows/_calendar.scss
Normal file
32
home/.config/eww/css/windows/_calendar.scss
Normal 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;
|
||||
}
|
||||
}
|
46
home/.config/eww/css/windows/_radio_menu.scss
Normal file
46
home/.config/eww/css/windows/_radio_menu.scss
Normal 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
114
home/.config/eww/eww.scss
Normal 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
94
home/.config/eww/eww.yuck
Normal 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))
|
24
home/.config/eww/modules/battery.yuck
Normal file
24
home/.config/eww/modules/battery.yuck
Normal 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}%"
|
||||
)
|
||||
))))
|
14
home/.config/eww/modules/bitcoin.yuck
Normal file
14
home/.config/eww/modules/bitcoin.yuck
Normal 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}))
|
||||
)
|
||||
)
|
18
home/.config/eww/modules/clock.yuck
Normal file
18
home/.config/eww/modules/clock.yuck
Normal 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}")
|
||||
)))
|
||||
|
15
home/.config/eww/modules/cpu.yuck
Normal file
15
home/.config/eww/modules/cpu.yuck
Normal 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)}%"
|
||||
)
|
||||
)))
|
41
home/.config/eww/modules/gammarelay.yuck
Normal file
41
home/.config/eww/modules/gammarelay.yuck
Normal 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 "γ")
|
||||
; ))
|
||||
))
|
15
home/.config/eww/modules/kernel.yuck
Normal file
15
home/.config/eww/modules/kernel.yuck
Normal 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}
|
||||
)
|
||||
)))
|
15
home/.config/eww/modules/memory.yuck
Normal file
15
home/.config/eww/modules/memory.yuck
Normal 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)}%"
|
||||
)
|
||||
)))
|
3
home/.config/eww/modules/nightlight.yuck
Normal file
3
home/.config/eww/modules/nightlight.yuck
Normal file
|
@ -0,0 +1,3 @@
|
|||
(deflisten nightlight
|
||||
:initial `{"running": false,"temperature": 0}`
|
||||
`scripts/nightlight --state`)
|
15
home/.config/eww/modules/uptime.yuck
Normal file
15
home/.config/eww/modules/uptime.yuck
Normal 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}
|
||||
)
|
||||
)))
|
60
home/.config/eww/modules/variables.yuck
Normal file
60
home/.config/eww/modules/variables.yuck
Normal 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`)
|
40
home/.config/eww/modules/volume.yuck
Normal file
40
home/.config/eww/modules/volume.yuck
Normal 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}%")
|
||||
))
|
||||
|
||||
))
|
11
home/.config/eww/modules/window_name.yuck
Normal file
11
home/.config/eww/modules/window_name.yuck
Normal 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}")
|
||||
))
|
21
home/.config/eww/modules/workspaces.yuck
Normal file
21
home/.config/eww/modules/workspaces.yuck
Normal 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}))
|
||||
)
|
||||
))
|
11
home/.config/eww/scripts/.flake8
Normal file
11
home/.config/eww/scripts/.flake8
Normal 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
|
85
home/.config/eww/scripts/battery
Executable file
85
home/.config/eww/scripts/battery
Executable 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'
|
85
home/.config/eww/scripts/bluetooth
Executable file
85
home/.config/eww/scripts/bluetooth
Executable 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
|
82
home/.config/eww/scripts/gammarelay
Executable file
82
home/.config/eww/scripts/gammarelay
Executable 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
|
50
home/.config/eww/scripts/include
Executable file
50
home/.config/eww/scripts/include
Executable 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
52
home/.config/eww/scripts/net
Executable 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
|
12
home/.config/eww/scripts/nightlight
Normal file
12
home/.config/eww/scripts/nightlight
Normal 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
|
12
home/.config/eww/scripts/pyproject.toml
Normal file
12
home/.config/eww/scripts/pyproject.toml
Normal 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"]
|
35
home/.config/eww/scripts/storage
Executable file
35
home/.config/eww/scripts/storage
Executable 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
7
home/.config/eww/scripts/temp
Executable 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
112
home/.config/eww/scripts/volume
Executable 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
|
6
home/.config/eww/scripts/window_name
Executable file
6
home/.config/eww/scripts/window_name
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# shellcheck source=include
|
||||
source "./scripts/include"
|
||||
|
||||
hyprland_ipc "activewindow" | ./scripts/window_name.py
|
116
home/.config/eww/scripts/window_name.py
Executable file
116
home/.config/eww/scripts/window_name.py
Executable 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()
|
12
home/.config/eww/scripts/workspaces
Executable file
12
home/.config/eww/scripts/workspaces
Executable 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
|
188
home/.config/eww/scripts/workspaces.py
Executable file
188
home/.config/eww/scripts/workspaces.py
Executable 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()
|
14
home/.config/eww/windows/calendar.yuck
Normal file
14
home/.config/eww/windows/calendar.yuck
Normal 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))
|
78
home/.config/eww/windows/radio-menu.yuck
Normal file
78
home/.config/eww/windows/radio-menu.yuck
Normal 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))
|
|
@ -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
|
|
@ -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
|
||||
|
|
156
home/.config/git/templates/hooks/commit-msg
Executable file
156
home/.config/git/templates/hooks/commit-msg
Executable 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
|
|
@ -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
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
5
home/.config/gtk-4.0/gtk.css
Normal file
5
home/.config/gtk-4.0/gtk.css
Normal 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");
|
14
home/.config/gtk-4.0/settings.ini
Normal file
14
home/.config/gtk-4.0/settings.ini
Normal 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
19
home/.config/hyfetch.json
Normal 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
|
||||
}
|
54
home/.config/hypr/hypridle.conf
Normal file
54
home/.config/hypr/hypridle.conf
Normal 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
|
22
home/.config/hypr/hyprland.conf
Normal file
22
home/.config/hypr/hyprland.conf
Normal 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
|
4
home/.config/hypr/hyprland.d/exec.conf
Normal file
4
home/.config/hypr/hyprland.d/exec.conf
Normal file
|
@ -0,0 +1,4 @@
|
|||
exec-once = uwsm finalize
|
||||
exec-once = uwsm app vesktop
|
||||
|
||||
# vi: ft=hyprlang
|
11
home/.config/hypr/hyprland.d/gestures.conf
Normal file
11
home/.config/hypr/hyprland.d/gestures.conf
Normal 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
|
||||
|
34
home/.config/hypr/hyprland.d/input.conf
Normal file
34
home/.config/hypr/hyprland.d/input.conf
Normal 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
|
290
home/.config/hypr/hyprland.d/keybinds.conf
Normal file
290
home/.config/hypr/hyprland.d/keybinds.conf
Normal 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
|
23
home/.config/hypr/hyprland.d/layout.conf
Normal file
23
home/.config/hypr/hyprland.d/layout.conf
Normal 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
|
14
home/.config/hypr/hyprland.d/misc.conf
Normal file
14
home/.config/hypr/hyprland.d/misc.conf
Normal 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
|
28
home/.config/hypr/hyprland.d/plugins.conf
Normal file
28
home/.config/hypr/hyprland.d/plugins.conf
Normal 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
|
130
home/.config/hypr/hyprland.d/style.conf
Normal file
130
home/.config/hypr/hyprland.d/style.conf
Normal 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
|
109
home/.config/hypr/hyprland.d/window_rules.conf
Normal file
109
home/.config/hypr/hyprland.d/window_rules.conf
Normal 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
|
226
home/.config/hypr/hyprlock.conf
Normal file
226
home/.config/hypr/hyprlock.conf
Normal 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
|
5
home/.config/hypr/hyprpaper.conf
Normal file
5
home/.config/hypr/hyprpaper.conf
Normal 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
Loading…
Add table
Reference in a new issue