Compare commits

...

131 commits
v4 ... main

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

View file

@ -1,15 +1,16 @@
# Dotfiles
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).
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).
## Images
What everyone is here for!
**My WM and EWW bar**
https://user-images.githubusercontent.com/20902250/202879948-f5d79f70-72ff-4cae-97aa-da9a863ac688.mp4
<https://user-images.githubusercontent.com/20902250/202879948-f5d79f70-72ff-4cae-97aa-da9a863ac688.mp4>
**Prompt timing showcase**
![image](https://user-images.githubusercontent.com/20902250/202880140-78dc3f65-ea5d-4155-819b-39bd30d2b31e.png)
@ -22,55 +23,75 @@ https://user-images.githubusercontent.com/20902250/202879948-f5d79f70-72ff-4cae-
## Features
- Full fledged ZSH configuration without relying on oh-my-zs
- oh-my-zsh configuration is also supported, but it is off by default, adjust [`.zshrc`](./home/.config/zsh/.zshrc)
to enable it
- While you can enable the omz support, it's not at all necessary, as my configuration already handles most of the basic config, and also adds a ton of cool features
- Fully custom terminal prompt with a lot of neat features, such as CWD shortening, showing git status, seeing how long
a command ran for, and 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)
- 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`
- 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.
- [`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)
- [`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
```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`:
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 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.
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
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)
@ -78,3 +99,6 @@ be as amazing as it is now:
- [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

367
guides/01_INSTALLATION.md Normal file
View file

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

View file

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

View file

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

186
guides/04_SECURE_BOOT.md Normal file
View file

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

View file

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

227
guides/06_TPM_UNLOCKING.md Normal file
View file

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

View file

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

152
guides/99_GREETD.md Normal file
View file

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

76
guides/99_PRINTING.md Normal file
View file

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

668
guides/99_THEMING.md Normal file
View file

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

37
guides/hibernation.md Normal file
View file

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

View file

@ -1,385 +0,0 @@
# Installation
This is a full Arch Linux installation guide, from live cd to a working OS.
This installation includes steps for full disk encryption, and sets up the
system with some basic tools and my zsh configuration.
## Partition, format and mount the disks
This will depend on your setup, following are the commands I used for my
specific setup as a reference, however you'll very like want a different
disk structure, and you probably won't even have the drives in the same
configuration as I do.
Create partitions for the drives
```bash
fdisk /dev/nvme0n1
# Create new GPT table and make 5 partitions
# first for boot (1G), second for swap (16G),
# third for root 1 (100G), fourth for root 2 (100G), fifth for data (rest ~714G)
fdisk /dev/nvme1n1
# Create new GPT table with single partition
fdisk /dev/sda
# Create new GPT table with single partition
```
Format partitions that shouldn't be encrypted
```bash
mkfs.fat -F 32 /dev/nvme0n1p1
fatlabel /dev/nvme0n1p1 BOOT
mkswap -L SWAP /dev/nvme0n1p2
```
Format drives using LUKS for encryption and open them to mapper devices
```bash
cryptsetup luksFormat --label ARCH_ROOT1 /dev/nvme0n1p3
cryptsetup luksFormat --label ARCH_ROOT2 /dev/nvme0n1p4
cryptsetup luksFormat --label DATA /dev/nvme0n1p5
cryptsetup luksFormat --label DATA2 /dev/sda1
cryptsetup luksFormat --label BACKUPS /dev/nvme1n1p1
cryptsetup luksOpen /dev/disk/by-label/ARCH_ROOT1 cryptroot
cryptsetup luksOpen /dev/disk/by-label/ARCH_ROOT2 cryptroot2
cryptsetup luksOpen /dev/disk/by-label/DATA cryptdata
cryptsetup luksOpen /dev/disk/by-label/DATA2 cryptdata2
cryptsetup luksOpen /dev/disk/by-label/BACKUPS cryptbackups
```
Create EXT4 filesystem on the encrypted drives
```bash
mkfs.ext4 -L ARCH_HYPRLAND /dev/mapper/cryptroot
mkfs.ext4 -L ARCH_KDE /dev/mapper/cryptroot2
mkfs.ext4 -L CRYPTDATA /dev/mapper/cryptdata
mkfs.ext4 -L CRYPTDATA2 /dev/mapper/cryptdata2
mkfs.ext4 -L CRYPTBACKUPS /dev/mapper/cryptbackups
```
Mount the drives
```bash
mount /dev/mapper/cryptroot /mnt
mount /dev/disk/by-label/BOOT /mnt/efi --mkdir
mkdir /mnt/efi/arch-hyprland /mnt/efi/arch-kde
mount --bind /mnt/efi/arch-kde /mnt/boot --mkdir
mount /dev/mapper/cryptdata /mnt/mnt/data --mkdir
mount /dev/mapper/cryptdata2 /mnt/mnt/data2 --mkdir
mount /dev/mapper/cryptbackups /mnt/mnt/backups --mkdir
mount /dev/mapper/cryptroot2 /mnt/mnt/arch-kde --mkdir
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 networkmanager neovim sudo reflector pacman-contrib man-db man-pages \
rsync btop bind tldr git base-devel
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/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 astronvim
```bash
sudo pacman -S --needed luarocks rustup cargo cmake meson npm
rustup default stable
mkdir -p ~/.config/wakatime
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
git clone https://github.com/ItsDrike/AstroNvimUser ~/.config/nvim/lua/user
```
## Auto-mounting encrypted partitions
We've create a bunch of LUKS encrypted partitions to store our date into,
however it would be very inconvenient to have to mount them ourselves on each
boot. Instead, we'll probably want to set up a way to mount them automatically.
### Key files
LUKS encryption has support for multiple keys to the same parition. We'll
utilize this support and add 2nd key slot to all of the partitions that we wish
to auto-mount.
For this 2nd key slot, we will use a key file, as opposed to the regular
user-entered text, so that we can store this key in the file system directly. We
will later be using this stored key to auto-mount. The key file will contain
random data that will be used as the key.
Note that it is very important to have these key files themselves stored on an
encrypted partition, in this case, we're storing them in /etc/secrets, and our
root is encrypted. If you don't have encrypted root partition, it is unsafe to
keep those files in there!
Note that you don't actually need the key files, and if you wish, you can also
be prompted to enter a password on each boot instead (for every partition). You
should prefer this approach if your root partition isn't encrypted, although
know that this can get pretty annoying with more than one encrypted device. If
you wish to do this, you can skip this section.
In this example, we'll be creating a different key for every encrypted
partition, but you could also share the same key file for all of them if you
wish. This is however more secure.
```bash
mkdir -p /etc/secrets
dd if=/dev/random bs=4096 count=1 of=/etc/secrets/keyFile-data.bin
dd if=/dev/random bs=4096 count=1 of=/etc/secrets/keyFile-data2.bin
dd if=/dev/random bs=4096 count=1 of=/etc/secrets/keyFile-backups.bin
dd if=/dev/random bs=4096 count=1 of=/etc/secrets/keyFile-arch-hyprland.bin
dd if=/dev/random bs=4096 count=1 of=/etc/secrets/keyFile-arch-kde.bin
chmod -R 004 /etc/secrets
chmod 007 /etc/secrets
```
The bs argument signifies a block size (in bits), so this will create 4096-bit keys.
Now we can add these keys into our LUKS encrypted partitions:
```bash
cryptsetup luksAddKey /dev/disk/by-label/DATA --new-keyfile /etc/secrets/keyFile-data.bin
cryptsetup luksAddKey /dev/disk/by-label/DATA2 --new-keyfile /etc/secrets/keyFile-data2.bin
cryptsetup luksAddKey /dev/disk/by-label/BACKUPS --new-keyfile /etc/secrets/keyFile-backups.bin
cryptsetup luksAddKey /dev/disk/by-label/ARCH_ROOT1 --new-keyfile /etc/secrets/keyFile-arch-hyprland.bin
cryptsetup luksAddKey /dev/disk/by-label/ARCH_ROOT2 --new-keyfile /etc/secrets/keyFile-arch-kde.bin
```
### /etc/crypttab
Now that we have the key files ready, we can utilize /etc/crypttab, which
is a file that systemd reads during boot (similarly to /etc/fstab), and contains
instructions for auto-mounting devices.
This is the `/etc/crypttab` file that I use:
<!-- markdownlint-disable MD010 MD013 -->
```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
cryptdata2 LABEL=DATA2 /etc/secrets/keyFile-data2.bin discard
cryptbackups LABEL=BACKUPS /etc/secrets/keyFile-backups.bin discard
cryptarch2 LABEL=ARCH_ROOT2 /etc/secrets/keyFile-arch-kde.bin discard
```
<!-- markdownlint-enable MD010 MD013 -->
If you want to be prompted for the password during boot instead of it being read
from a file, you can use `none` instead of the file path.
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.
### /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 -->
```txt
# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# region: LUKS encrypted devices (opened from /etc/crypttab, or mounted from initramfs)
/dev/mapper/cryptroot / ext4 rw,relatime,nofail,discard 0 1
/dev/mapper/cryptdata /mnt/data ext4 rw,relatime,nofail,discard 0 2
/dev/mapper/cryptdata2 /mnt/data2 ext4 rw,relatime,nofail,discard 0 2
/dev/mapper/cryptarch2 /mnt/arch-kde ext4 rw,relatime,nofail,discard 0 2
# endregion
# region: Physical devices
LABEL=BOOT /efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2
LABEL=SWAP none swap defaults 0 0
# endregion
# region: Bind mounts
# Write kernel images to /efi/arch-hyprland, not directly to the efi system partition (esp), to avoid conflicts when dual booting
/efi/arch-hyprland /boot none rw,bind 0 0
# Bind mounts for arch-kde
/efi /mnt/arch-kde/efi none rw,bind 0 0
/efi/arch-kde /mnt/arch-kde/boot none rw,bind 0 0
/mnt/data /mnt/arch-kde/mnt/data none rw,bind 0 0
/mnt/data2 /mnt/arch-kde/mnt/data2 none rw,bind 0 0
/mnt/backups /mnt/arch-kde/mnt/backups none rw,bind 0 0
/ /mnt/arch-kde/mnt/arch-hyprland none rw,bind 0 0
```
<!-- markdownlint-enable MD010 MD013 -->
## Bootloader
This guide uses systemd-boot (if you want to use GRUB, just follow the arch wiki).
### 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`.
sudo nvim /etc/mkinitcpio.conf
```
This will configure `mkinitcpio` to build support for the keyboard input, and
support 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
yay -S mkinitcpio-numlock
# Go to HOOKS and add `numlock` after `keyboard` in:
sudo nvim /etc/mkinitcpio.conf
```
Now regenerate the initial ramdisk environment image:
```bash
sudo mkinitcpio -P
```
### Configure systemd-boot
Install systemd-boot to the EFI system partition (ESP)
```bash
sudo bootctl --esp-path=/efi install
```
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-hyprland.conf`, with:
```bash
title Arch Linux (Hyprland)
sort-key 0
linux /arch-hyprland/vmlinuz-linux
initrd /arch-hyprland/amd-ucode.img
initrd /arch-hyprland/initramfs-linux.img
options cryptdevice=LABEL=ARCH_ROOT1:cryptroot:allow-discards
options root=/dev/mapper/cryptroot
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
```
## Post-setup
Enable Network Time Protocol (time synchronization)
```bash
sudo timedatectl set-ntp true
timedatectl status
```
Connect to a wifi network
```bash
nmtui
```
## Footnotes
Note that this setup is based on my personal system, in which I dual boot
multiple (2) arch instances, one running hyprland, the other running KDE (I
mainly use the hyprland instance, the KDE one is purely there because it's X11
and supports my NVidia card, which Hyprland currenly doesn't).
The config here only really mentions how to get the first (hyprland)
installation ready, however if you wanted to set up both, it's essentially just
doing the same thing again, with some minor changes like in the systemd-boot
entry and some fstab/crypttab entries.
I do plan on writing a continuation guide for how to set up the system for GUI
(Hyprland) too eventually. Once it's done, I will mention it here.

View file

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

View file

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

View file

@ -1,4 +1,4 @@
#? Config file for btop v. 1.2.13
#? 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"
@ -37,6 +37,9 @@ 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"
@ -46,7 +49,7 @@ 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", separate values with whitespace.
#* 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.
@ -86,6 +89,9 @@ 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"
@ -94,6 +100,9 @@ cpu_graph_upper = "total"
#* 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
@ -209,4 +218,28 @@ 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"
log_level = "WARNING"
#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards.
nvml_measure_pcie_speeds = True
#* Horizontally mirror the GPU graph.
gpu_mirror_graph = True
#* Custom gpu0 model name, empty string to disable.
custom_gpu_name0 = ""
#* Custom gpu1 model name, empty string to disable.
custom_gpu_name1 = ""
#* Custom gpu2 model name, empty string to disable.
custom_gpu_name2 = ""
#* Custom gpu3 model name, empty string to disable.
custom_gpu_name3 = ""
#* Custom gpu4 model name, empty string to disable.
custom_gpu_name4 = ""
#* Custom gpu5 model name, empty string to disable.
custom_gpu_name5 = ""

View file

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

View file

@ -1,4 +1,4 @@
.window_name {
font-family: "JetBrains Mono", "Font Awesome 6 Free", sans-serif;
font-family: "Monaspace Krypton";
font-size: 1.4rem;
}

View file

@ -2,13 +2,14 @@
background-color: $bg1-a;
border-radius: 25px;
.icon, .icon label {
font-family: "Material Symbols Outlined";
font-size: 1.15rem;
.icon,
.icon label {
font-family: "JetBrainsMono Nerd Font", "Material Symbols Outlined";
font-size: 1.2rem;
}
.value {
margin: 0 9px;
margin: 0 10px;
}
.focused {

View file

@ -34,13 +34,13 @@
background-color: $bg-a;
color: $fg;
font-family: "JetBrains Mono", "Jost *", sans-serif;
font-family: "JetBrains Mono";
label {
font-size: 14px;
}
// TODO: Use ercentages (for some reason it fails now)
// TODO: Use percentages (for some reason it fails now)
min-width: 1900px;
}

View file

@ -1,4 +1,4 @@
(defvar terminal "alacritty -e")
(defvar terminal "kitty -e")
(include "./modules/variables.yuck")
@ -9,7 +9,7 @@
(include "./modules/memory.yuck")
(include "./modules/uptime.yuck")
; (include "./modules/kernel.yuck")
; (include "./modules/battery.yuck")
(include "./modules/battery.yuck")
(include "./modules/window_name.yuck")
(include "./modules/workspaces.yuck")
(include "./modules/gammarelay.yuck")
@ -37,8 +37,8 @@
; (sep)
(volume_module)
(sep)
; (battery_module)
; (sep)
(battery_module)
(sep)
(bitcoin_module)
(sep)
(cpu_module)

View file

@ -1,6 +1,6 @@
(defwidget bitcoin_module []
(eventbox
:onclick "~/.local/bin/scripts/cli/bitcoin | xargs -I_ ${EWW_CMD} update bitcoin=_"
:onclick "bitcoin | xargs -I{} ${EWW_CMD} update bitcoin={}"
:class "module bitcoin"
(box

View file

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

View file

@ -37,7 +37,7 @@
(defpoll bitcoin
:interval "5m"
:initial "$N/A"
`~/.local/bin/scripts/cli/bitcoin`)
`bitcoin`)
; TODO: Figure out how to store this one-time
(defpoll kernel

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# shellcheck source=include
source "./scripts/include"
@ -10,19 +10,18 @@ source "./scripts/include"
CAPACITY_ICONS=("󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹")
CHARGING_ICON=""
DISCHARGING_ICON=""
FULL_ICON="" # Plugged in, but no longer charging (fully charged)
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)"
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 "ADP" | head -n 1)"
ADAPTER="$(\ls -t /sys/class/power_supply | grep -E "ADP|AC" | head -n 1)"
fi
get_bat_info() {
@ -52,7 +51,6 @@ status="$(get_bat_info status)"
# status="Not charging"
# status="Discharging"
full="false"
capacity_icon="$(pick_icon "$capacity" 0 100 "${CAPACITY_ICONS[@]}")"
@ -69,7 +67,6 @@ fi
[ "$capacity" -le "$CRITICAL_PERCENTAGE" ] && critical="true" || critical="false"
jq -n -c --monochrome-output \
--arg percent "$capacity" \
--arg plugged "$adp_connected" \

View file

@ -1,83 +1,82 @@
#!/bin/bash
#!/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="<"
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="<"
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=">"
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
>&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"
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
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
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}
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
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
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
>&2 echo "Invalid operation, second argument must be one of: watch, scroll, set"
exit 1
fi

View file

@ -1,26 +1,26 @@
#!/bin/bash
#!/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=( "$@" )
cur="$1"
min="$2"
max="$3"
shift 3
icons=("$@")
index="$(echo "($cur-$min)/(($max-$min)/${#icons[@]})" | bc)"
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
# 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]}"
echo "${icons[index]}"
}
# Will block and listen to the hyprland socket messages and output them
@ -29,21 +29,22 @@ pick_icon() {
# 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
if [ -z "$HYPRLAND_INSTANCE_SIGNATURE" ]; then
>&2 echo "Hyprland is not running, IPC not available"
exit 1
fi
SOCKET_PATH="/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
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
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
}

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# shellcheck source=include
source "./scripts/include"
@ -7,7 +7,6 @@ source "./scripts/include"
# as we might be in transition state and just killing the program might
# not be enough.
if [ "$1" = "toggle" ]; then
gammastep -x
gammastep -x
fi

View file

@ -1,35 +1,35 @@
#!/bin/bash
#!/usr/bin/env bash
MOUNTPOINTS=("/" "/mnt/ext")
data="$(df -H)"
as_json() {
mountpoint="$1"
res="$2"
arr_res=($res)
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'
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")"
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
# echo "$output_json $out" | jq -c -s
jq --argjson arr1 "$output_json" --argjson arr2 "[$out]" -n \
'$arr1 + $arr2'
jq --argjson arr1 "$output_json" --argjson arr2 "[$out]" -n \
'$arr1 + $arr2'
# mount_data+=("$mountpoint" $res)
# echo "${mount_data[@]}"
# mount_data+=("$mountpoint" $res)
# echo "${mount_data[@]}"
done
# echo "${mount_data[@]}"

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# shellcheck source=include
source "./scripts/include"

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Define some icons
SPEAKER_ICONS=("" "" "")
@ -10,100 +10,103 @@ MIC_MUTED_ICON=""
# $1 can either be "SINK" (speaker) or "SOURCE" (microphone)
get_vol() {
wpctl get-volume "@DEFAULT_AUDIO_${1}@" | awk '{print int($2*100)}'
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"
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 $?
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
wpctl set-mute "@DEFAULT_AUDIO_${1}@" toggle
}
get_report() {
spkr_vol="$(get_vol "SINK")"
mic_vol="$(get_vol "SOURCE")"
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))}')"
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
# 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
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\" }"
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
get_report
pactl subscribe | grep --line-buffered "change" | while read -r _; do
get_report
done
}
case "$1" in
"loop") loop ;;
"loop") loop ;;
"once") get_report ;;
"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"
;;
"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
"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
;;
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 ;;
*)
>&2 echo "Invalid usage, argument '$1' not recognized."
exit 1
;;
esac

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# shellcheck source=include
source "./scripts/include"

View file

@ -7,8 +7,9 @@ the window names. Window name and class are obtained from piped stdin, to preven
needlessly keep restarting this program, which takes a while due to the interpreter starting
overhead.
"""
import re
import json
import re
import sys
from typing import Iterator, Optional
@ -16,7 +17,12 @@ 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):
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
@ -45,20 +51,26 @@ class RemapRule:
# 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"(.*) — 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", " Spotify", "Spotify"),
RemapRule(r"pulsemixer", " Pulsemixer"),
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
@ -70,7 +82,9 @@ def iter_window() -> Iterator[tuple[str, str]]:
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)}")
raise ValueError(
f"Expected 2 arguments from stdin line (name, class), but got {len(els)}"
)
yield els[1], els[0]
@ -78,12 +92,22 @@ def main() -> None:
for window_name, window_class in iter_window():
formatted_name = window_name
for remap_rule in REMAP_RULES:
formatted_name = remap_rule.apply(formatted_name, window_class)
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] + "..."
formatted_name = formatted_name[: MAX_LENGTH - 3] + "..."
ret = json.dumps({"name": window_name, "class": window_class, "formatted_name": formatted_name})
ret = json.dumps(
{
"name": window_name,
"class": window_class,
"formatted_name": formatted_name,
}
)
print(ret)
sys.stdout.flush()

View file

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

View file

@ -131,7 +131,10 @@ def get_workspaces() -> list[OutputWorkspaceInfo]:
continue
format_name = REMAPS.get(workspace["id"], workspace["name"])
active = workspace["id"] in active_workspaces
mon_id = [monitor["id"] for monitor in monitors if monitor["name"] == workspace["monitor"]][0]
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)

View file

@ -1,12 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<description>Disable Caskaydia Cove Nerd Font</description>
<selectfont>
<rejectfont>
<glob>/usr/share/fonts/nerd-fonts-git/TTF/Caskaydia*</glob>
</rejectfont>
</selectfont>
</fontconfig>

View file

@ -50,6 +50,7 @@
bD = "branch --delete --force"
bm = "branch --move"
bM = "branch --move --force"
bb = "!better-git-branch"
r = "rebase"
ri = "rebase -i"
@ -59,21 +60,28 @@
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'"
tracked-files = "ls-tree --full-tree --name-only -r HEAD"
total-lines = "!git tracked-files | xargs cat | wc -l"
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 }' #"
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]
@ -94,3 +102,4 @@
gpgsign = true
[init]
defaultBranch = main
templatedir = ~/.config/git/templates

View file

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

View file

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

View file

@ -1,19 +1,15 @@
# DO NOT EDIT! This file will be overwritten by LXAppearance.
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
include "/home/itsdrike/.gtkrc-2.0.mine"
gtk-theme-name="Adwaita-dark"
gtk-icon-theme-name="Papirus-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="hintfull"
gtk-modules="colorreload-gtk-module:window-decorations-gtk-module:appmenu-gtk-module"
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"

View file

@ -1,21 +1,19 @@
[Settings]
gtk-application-prefer-dark-theme=true
gtk-button-images=1
gtk-cursor-theme-name=BreezeX-Light
gtk-cursor-theme-size=24
gtk-decoration-layout=icon:minimize,maximize,close
gtk-enable-animations=true
gtk-font-name=Noto Sans, 10
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-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=hintfull
gtk-xft-hintstyle=hintslight

View file

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

View file

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

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

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

View file

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

View file

@ -1,158 +1,22 @@
################
### MONITORS ###
################
# Should be configured per-profile
# monitor = HDMI-A-2, 1920x1080@60, 0x0, 1
# monitor = eDP-1, 1920x1080@60, 1920x0, 1
monitor = , preferred, auto, 1
#################
### AUTOSTART ###
#################
exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE
exec-once = sleep 1 && systemctl --user start wayland-session.target # Hyprland socket sometimes isn't yet loaded, sleep for sec
# exec-once = aa-notify -p
# exec-once = udiskie -A -T
# exec-once = nm-applet --indicator
exec-once = discord
# exec-once = webcord --start-minimized
###############
### PLUGINS ###
###############
exec-once=hyprctl plugin load $HOME/.local/share/hyprload/plugins/bin/dwindle-autogroup.so
#########################
### CATEGORY SETTINGS ###
#########################
general {
border_size = 2
gaps_in = 5
gaps_out = 8
col.active_border = rgba(FFA500FF) # orange
col.inactive_border = rgba(666666AA) # transparent gray
col.nogroup_border_active = rgba(FF00FFFF) # purple
col.nogroup_border = rgba(FF00FFAA) # transparent purple
# cursor_inactive_timeout = 10
# no_cursor_warps = true
layout = dwindle
}
decoration {
rounding = 8
#inactive_opacity = 1.0
#dim_inactive = true
dim_strength = 0.05
dim_special = 0.2
drop_shadow = true
shadow_range = 20
shadow_render_power = 2
col.shadow = rgba(0F0F0FE6)
#col.shadow = rgba(FFA500FF)
col.shadow_inactive = rgba(0F0F0F99)
blur {
enabled = true
size = 8
passes = 1
}
}
animations {
enabled = true
animation = windows, 1, 3, default, popin 50%
animation = border, 1, 4, default
animation = fade, 1, 4, default
animation = workspaces, 1, 3, default
}
input {
kb_layout = us, sk
kb_variant = ,qwerty
kb_options = grp:alt_shift_toggle
numlock_by_default=true
follow_mouse = 1
}
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
}
group {
insert_after_current = true
focus_removed_window = true
col.border_active = rgba(00A500FF) # green
col.border_inactive = rgba(5AA500FF) # transparent green
col.border_locked_active = rgba(A0A500FF) # yellow
col.border_locked_inactive = rgba(A0A500AA) # transparent yellow
groupbar {
scrolling = false
render_titles = true
font_size = 8
text_color = rgba(FFFFFFFF) # white
gradients = true
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 yello
}
}
misc {
disable_hyprland_logo = true
disable_splash_rendering = false
animate_manual_resizes = true
# follow requests from windows to be focused
focus_on_activate = true
}
debug {
overlay = false
#disable_logs = false
enable_stdout_logs = true
}
dwindle {
pseudotile = false
preserve_split = true
no_gaps_when_only = false
#smart_split = 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
#######################
### EXTERNAL CONFIG ###
#######################
source = ~/.config/hypr/keybinds.conf
source = ~/.config/hypr/window_rules.conf
# vi: ft=hypr
# vi: ft=hyprlang

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,21 +1,36 @@
# Assigned workspaces
# ###########################
# ### 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 ###
# #######################
# Idle inhibit rules
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 ###
# ################################
# Give apps proper size
windowrulev2 = size 800 550, class:^(qalculate-gtk)$
windowrulev2 = tile, class:^(Spotify)$
# Auto-float mode
# ##################
# ### AUTO FLOAT ###
# ##################
windowrulev2 = float, class:^(Lxappearance)$
windowrulev2 = float, class:^(Rofi)$
windowrulev2 = float, class:^(feh)$
@ -25,13 +40,21 @@ 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)$
@ -40,6 +63,11 @@ 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)$
@ -55,5 +83,27 @@ windowrulev2 = float, class:^(notification)$
windowrulev2 = float, class:^(error)$
windowrulev2 = float, class:^(splash)$
windowrulev2 = float, class:^(confirmreset)$
windowrulev2 = float, class:^(floating)$
# vi: ft=hypr
## Float all windows that don't have a title nor a class
windowrulev2 = float, class:^$,title:^$
# #############
# ### FIXES ###
# #############
# jetbrains
windowrulev2 = center, class:^(jetbrains-.*)$,title:^(splash)$,floating:1
windowrulev2 = nofocus, class:^(jetbrains-.*)$,title:^(splash)$,floating:1
windowrulev2 = noborder, class:^(jetbrains-.*)$,title:^(splash)$,floating:1
windowrulev2 = center, class:^(jetbrains-.*)$,title:^( )$,floating:1
windowrulev2 = stayfocused, class:^(jetbrains-.*)$,title:^( )$,floating:1
windowrulev2 = noborder, class:^(jetbrains-.*)$,title:^( )$,floating:1
windowrulev2 = nofocus, class:^(jetbrains-.*)$,title:^(win.*)$,floating:1
windowrulev2 = noinitialfocus, class:^(jetbrains-.*)$,title:^(win.*)$
# Don't add borders to grim selections when taking screenshots
layerrule = noanim, ^(selection)$
# vi: ft=hyprlang

View file

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

View file

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

View file

@ -1,212 +0,0 @@
$MOUSE_LMB = mouse:272
$MOUSE_RMB = mouse:273
$MOUSE_MMB = mouse:274
$MOUSE_EX1 = mouse:275
$MOUSE_EX2 = mouse:276
# DE/WM control
bind = SUPER_SHIFT, Q, exec, menuquit
bind = SUPER_CTRL, L, exec, loginctl lock-session
bind = SUPER_SHIFT, L, exec, wlogout -p layer-shell
bind = SUPER_SHIFT, T, exec, toggle-idle
# Programs
bind = SUPER, R, exec, wofi --show drun
bind = SUPER_SHIFT, Return, exec, wofi --show run
bind = SUPER_SHIFT, C, exec, clipman pick -t wofi
bind = SUPER, Return, exec, kitty
bind = SUPER, X, exec, pcmanfm-qt
bind = SUPER, B, exec, firefox
bind = SUPER, S, exec, spotify
bind = SUPER, D, exec, discord
bind = SUPER, C, exec, qalculate-gtk
bind = , XF86Calculator, exec, qalculate-gtk
# Notifications
bind = CTRL, grave, exec, dunstctl close
bind = CTRL_SHIFT, grave, exec, dunstctl close-all
bind = CTRL, period, exec, dunstctl history-pop
bind = CTRL_SHIFT, period, exec, dunstctl context
bind = SUPER_SHIFT, D, exec, toggle-notifications
# Volume comtrol
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
# Screenshots (with custom screenshot script)
$SCREENSHOT_FORMAT = "${XDG_SCREENSHOTS_DIR:-$HOME/Pictures/Screenshots}/Screenshot_$(date +%Y-%m-%d_%H-%M-%S).png"
$SCREENSHOT_DELAY = 2000
bind = , 642, exec, quick-record --notify toggle
bind = SUPER, 642, exec, quick-record toggle
bind = ALT, Print, exec, wl-copy --type image/png "$(hyprpicker)" && notify-send 'Picked color' "$(wl-paste) (saved to clipboard)"
bind = , Print, exec, screenshot --notify --copy --target area
bind = SUPER, Print, exec, screenshot --notify --copy --target area --edit
bind = SHIFT, Print, exec, screenshot --notify --save $SCREENSHOT_FORMAT --target area
bind = CTRL, Print, exec, screenshot --notify --copy --target area --delay $SCREENSHOT_DELAY
bind = SUPER_SHIFT, Print, exec, screenshot --notify --save $SCREENSHOT_FORMAT --target area --edit
bind = SUPER_CTRL, Print, exec, screenshot --notify --copy --target area --delay $SCREENSHOT_DELAY --edit
bind = SUPER_SHIFT_CTRL, Print, exec, screenshot --notify --save $SCREENSHOT_FORMAT --target area --delay $SCREENSHOT_DELAY --edit
# bind = , Print, exec, screenshot --save $SCREENSHOT_FORMAT --target all
# Active window
bind = SUPER, W, killactive,
bind = SUPER, F, togglefloating,
bind = SUPER, Space, fullscreen, 0
bind = SUPER_SHIFT, Space, fullscreen, 1
bind = CTRL_SHIFT, Space, exec, toggle-fakefullscreen
bind = SUPER, P, exec, bash -c "if hyprctl activewindow | grep 'floating: 0'; then hyprctl dispatch togglefloating active; fi; hyprctl dispatch pin active"
bind = SUPER_SHIFT, P, pseudo,
bind = SUPER_SHIFT, S, layoutmsg, togglesplit
# Window groups
bind = SUPER, G, togglegroup,
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
# Override the split direction for next opened winodw
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
# Move between workspaces, swapping to current monitor (like xmonad)
bind = SUPER, 1, exec, swap-workspace 1
bind = SUPER, 2, exec, swap-workspace 2
bind = SUPER, 3, exec, swap-workspace 3
bind = SUPER, 4, exec, swap-workspace 4
bind = SUPER, 5, exec, swap-workspace 5
bind = SUPER, 6, exec, swap-workspace 6
bind = SUPER, 7, exec, swap-workspace 7
bind = SUPER, 8, exec, swap-workspace 8
bind = SUPER, 9, exec, swap-workspace 9
# Move windows to workspaces
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 windows to workspaces and focus it there
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
bind = SUPER_SHIFT, bracketleft, focusmonitor, -1
bind = SUPER_SHIFT, bracketright, focusmonitor, +1
# Mouse window resizing
bindm = SUPER, $MOUSE_LMB, movewindow
bindm = SUPER, $MOUSE_RMB, resizewindow
# Quick keyboard window 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 window resizing (group)
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)$
bind = CTRL, F10, pass, ^(com\.obsproject\.Studio)$
# Isolating group to prevent keybind capturing (for games etc)
# SUPER + Fn + semicol
bind = SUPER, code:94, exec, hyprctl dispatch submap isolate && notify-send "Keybind isolation" "Keybind isolation on"
submap = isolate
bind = SUPER, code:94, exec, hyprctl dispatch submap reset && notify-send "Keybind isolation" "Keybind isolation off"
submap = reset
# vi: ft=hypr

View file

@ -0,0 +1,9 @@
#!/bin/bash
set -euo pipefail
MONITOR_ID="$1"
MONITOR_NAME="$2"
MONITOR_DESCRIPTION="$3"
systemctl --user start eww-window@bar1.service
#eww open bar1

View file

@ -0,0 +1,26 @@
#!/bin/bash
set -euo pipefail
MONITORS_AMT="$(hyprctl monitors -j | jq length)"
if [ "$MONITORS_AMT" -lt 1 ]; then
>&2 echo "You seem to have 0 monitors..."
exit 1
fi
if [ "$MONITORS_AMT" -eq 2 ]; then
systemctl --user start eww-window@bar1.service
#eww open bar1
fi
if [ "$MONITORS_AMT" -eq 1 ]; then
if eww active-windows | grep "bar1"; then
systemctl --user stop eww-window@bar1.service
#eww close bar1
fi
fi
if [ "$MONITORS_AMT" -gt 2 ]; then
>&2 echo "Unexpected monitor configuration (more than 2 monitors)"
exit 1
fi

View file

@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
MONITOR_NAME="$1"
systemctl --user stop eww-window@bar1.service
# eww close bar1

View file

@ -1,28 +1,88 @@
# Fonts
font_family JetBrains Mono
# Fonts & Text style
font_family Monaspace Krypton
bold_font auto
italic_font auto
bold_italic_font auto
font_size 11
disable_ligatures never
#font_size 13
disable_ligatures always
# Colors / Style
# Dark Theme
foreground #d8dee9
background #191919
cursor #D0D0D0
# Light Theme (for screenshots in papers)
#foreground = "#191919";
#background = "#FFFFFF";
# URLs
url_color #0087bd
url_style curly
background_opacity 0.85
# Cursor
cursor #D0D0D0
cursor_shape underline
cursor_blink_interval 0.5
cursor_stop_blinking_after 15.0
# Background
background_opacity 0.9
dynamic_background_opacity yes
background_blur 2
# Misc
scrollback_lines 10000
# Window size
remember_window_size no
initial_window_width 640
initial_window_height 400
# Bell
## flash the screen for this duration when bell occurs
visual_bell_duration 0.0
## disable audio bells
enable_audio_bell no
# Misc
## don't check for updates, we have a package manager...
update_check_interval 0
## don't ask for confirmation if window gets closed
confirm_os_window_close 0
## Capture up to 10k lines for scrolling
scrollback_lines 10000
## chars considered part of word when double clicking
select_by_word_characters :@-./_~?&=%+#
# Keybindings
map ctrl+alt+c copy_to_clipboard
map ctrl+alt+v paste_from_clipboard
map ctrl+c copy_or_interrupt
map ctrl+shift+, move_tab_backward
map ctrl+shift+. move_tab_forward
map ctrl+shift+0 tenth_window
map ctrl+shift+1 first_window
map ctrl+shift+2 second_window
map ctrl+shift+3 third_window
map ctrl+shift+4 fourth_window
map ctrl+shift+5 fifth_window
map ctrl+shift+6 sixth_window
map ctrl+shift+7 seventh_window
map ctrl+shift+8 eighth_window
map ctrl+shift+9 ninth_window
map ctrl+shift+[ previous_window
map ctrl+shift+] next_window
map ctrl+shift+` move_window_to_top
map ctrl+shift+alt+t set_tab_title
map ctrl+shift+b move_window_backward
map ctrl+shift+backspace restore_font_size
map ctrl+shift+down decrease_font_size
map ctrl+shift+enter new_window
map ctrl+shift+f move_window_forward
map ctrl+shift+l next_layout
map ctrl+shift+left previous_tab
map ctrl+shift+n new_os_window
map ctrl+shift+q close_tab
map ctrl+shift+right next_tab
map ctrl+shift+t new_tab
map ctrl+shift+up increase_font_size
map ctrl+shift+v paste_from_clipboard
map ctrl+shift+w close_window
# vi: ft=conf

View file

@ -1,18 +1,185 @@
[Default Applications]
inode/directory=pcmanfm-qt.desktop
image/jpeg=org.nomacs.ImageLounge.desktop
image/png=org.nomacs.ImageLounge.desktop
image/gif=org.nomacs.ImageLounge.desktop
application/pdf=firefox.desktop
# Browser
text/html=firefox.desktop
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
x-scheme-handler/about=firefox.desktop
x-scheme-handler-unknown=firefox.desktop
application/json=nvim.desktop
application/x-extension-htm=firefox.desktop
application/x-extension-html=firefox.desktop
application/x-extension-shtml=firefox.desktop
application/x-extension-xhtml=firefox.desktop
application/x-extension-xht=firefox.desktop
application/xhtml+xml=firefox.desktop
application/xhtml_xml=firefox.desktop
# Image viewer
# (wildcard associations don't work everywhere)
# or org.nomacs.ImageLounge.desktop?
image/*=qimgv.desktop
image/bmp=qimgv.desktop
image/gif=qimgv.desktop
image/jpeg=qimgv.desktop
image/jpg=qimgv.desktop
image/png=qimgv.desktop
image/webp=qimgv.desktop
image/tiff=qimgv.desktop
image/x-bmp=qimgv.desktop
image/x-pcx=qimgv.desktop
image/x-tga=qimgv.desktop
image/x-portable-pixmap=qimgv.desktop
image/x-portable-bitmap=qimgv.desktop
image/x-portable-greymap=qimgv.desktop
image/x-targa=qimgv.desktop
image/svg+xml=qimgv.desktop
image/svg_xml=qimgv.desktop
# Media player
# Media Player (video + audio)
# (wildcard associations don't work everywhere)
video/*=mpv.desktop
video/mpeg=mpv.desktop
video/x-mpeg2=mpv.desktop
video/x-mpeg3=mpv.desktop
video/mp4v-es=mpv.desktop
video/x-m4v=mpv.desktop
video/mp4=mpv.desktop
video/divx=mpv.desktop
video/vnd.divx=mpv.desktop
video/msvideo=mpv.desktop
video/x-msvideo=mpv.desktop
video/ogg=mpv.desktop
video/quicktime=mpv.desktop
video/vnd.rn-realvideo=mpv.desktop
video/x-avi=mpv.desktop
video/avi=mpv.desktop
video/x-flic=mpv.desktop
video/fli=mpv.desktop
video/x-flc=mpv.desktop
video/flv=mpv.desktop
video/x-flv=mpv.desktop
video/x-theora=mpv.desktop
video/x-theora+ogg=mpv.desktop
video/x-matroska=mpv.desktop
video/mkv=mpv.desktop
video/webm=mpv.desktop
video/x-ogm=mpv.desktop
video/x-ogm+ogg=mpv.desktop
video/dv=mpv.desktop
video/mp2t=mpv.desktop
video/vnd.mpegurl=mpv.desktop
video/3gp=mpv.desktop
video/3gpp=mpv.desktop
video/3gpp2=mpv.desktop
audio/*=mpv.desktop
audio/x-matroska=mpv.desktop
audio/webm=mpv.desktop
audio/vorbis=mpv.desktop
audio/x-vorbis=mpv.desktop
audio/x-vorbis+ogg=mpv.desktop
audio/x-shorten=mpv.desktop
audio/x-ape=mpv.desktop
audio/x-wavpack=mpv.desktop
audio/x-tta=mpv.desktop
audio/AMR=mpv.desktop
audio/ac3=mpv.desktop
audio/eac3=mpv.desktop
audio/amr-wb=mpv.desktop
audio/flac=mpv.desktop
audio/mp4=mpv.desktop
audio/x-pn-au=mpv.desktop
audio/3gpp=mpv.desktop
audio/3gpp2=mpv.desktop
audio/dv=mpv.desktop
audio/opus=mpv.desktop
audio/x-ms-asf=mpv.desktop
audio/vnd.dts=mpv.desktop
audio/vnd.dts.hd=mpv.desktop
audio/x-adpcm=mpv.desktop
audio/m3u=mpv.desktop
audio/aac=mpv.desktop
audio/x-aac=mpv.desktop
audio/vnd.dolby.heaac.1=mpv.desktop
audio/vnd.dolby.heaac.2=mpv.desktop
audio/aiff=mpv.desktop
audio/x-aiff=mpv.desktop
audio/m4a=mpv.desktop
audio/x-m4a=mpv.desktop
audio/mp1=mpv.desktop
audio/x-mp1=mpv.desktop
audio/mp2=mpv.desktop
audio/x-mp2=mpv.desktop
audio/mp3=mpv.desktop
audio/x-mp3=mpv.desktop
audio/mpeg=mpv.desktop
audio/mpeg2=mpv.desktop
audio/mpeg3=mpv.desktop
audio/mpegurl=mpv.desktop
audio/x-mpegurl=mpv.desktop
audio/mpg=mpv.desktop
audio/x-mpg=mpv.desktop
audio/rn-mpeg=mpv.desktop
audio/musepack=mpv.desktop
audio/x-musepack=mpv.desktop
audio/ogg=mpv.desktop
audio/scpls=mpv.desktop
audio/x-scpls=mpv.desktop
audio/vnd.rn-realaudio=mpv.desktop
audio/wav=mpv.desktop
audio/x-pn-wav=mpv.desktop
audio/x-pn-windows-pcm=mpv.desktop
audio/x-realaudio=mpv.desktop
audio/x-pn-realaudio=mpv.desktop
audio/x-ms-wma=mpv.desktop
audio/x-pls=mpv.desktop
audio/x-wav=mpv.desktop
application/x-cue=mpv.desktop
application/vnd.ms-asf=mpv.desktop
application/x-matroska=mpv.desktop
application/x-ogm=mpv.desktop
application/x-ogm-audio=mpv.desktop
application/x-ogm-video=mpv.desktop
application/x-shorten=mpv.desktop
application/x-mpegurl=mpv.desktop
application/vnd.apple.mpegurl=mpv.desktop
application/ogg=mpv.desktop
application/x-ogg=mpv.desktop
application/mxf=mpv.desktop
application/sdp=mpv.desktop
application/smil=mpv.desktop
application/x-smil=mpv.desktop
application/streamingmedia=mpv.desktop
application/x-streamingmedia=mpv.desktop
application/vnd.rn-realmedia=mpv.desktop
application/vnd.rn-realmedia-vbr=mpv.desktop
application/x-extension-m4a=mpv.desktop
# Document Viewer
application/pdf=firefox.desktop
application/epub=firefox.desktop
application/djvu=firefox.desktop
application/mobi=firefox.desktop
# File & archive manager(s)
inode/directory=pcmanfm-qt.desktop
application/zip=org.gnome.FileRoller.desktop
application/x-xz-compressed-tar=org.gnome.FileRoller.desktop
# Plain-text
text/plain=nvim.desktop
application/json=nvim.desktop
application/x-desktop=nvim.desktop;
# Application specific schemes
x-scheme-handler/spotify=spotify.desktop
x-scheme-handler/tg=telegramdesktop.desktop
x-scheme-handler/discord=vesktop.desktop
x-scheme-handler/msteams=teams.desktop
# Misc
x-scheme-handler/mailto=firefox.desktop
[Added Associations]
application/x-desktop=nvim.desktop;
image/png=org.nomacs.ImageLounge.desktop;
text/plain=nvim.desktop;

View file

@ -16,7 +16,9 @@ DOWN add volume -2
# Zooming
- add video-zoom -.25
KP_SUBTRACT add video-zoom -.25
+ add video-zoom .25
KP_ADD add video-zoom .25
# Moving/panning video
kp8 add video-pan-y .05

View file

@ -1,10 +1,8 @@
[General]
DkEditDock=2
DkExplorer=1
DkMetaDataDock=2
firstTime=false
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\x3\xc7\0\0\x2\x38\0\0\au\0\0\x4\x32\0\0\x3\xc7\0\0\x2\x38\0\0\au\0\0\x4-\0\0\0\0\x2\0\0\0\a\x80\0\0\x3\xc7\0\0\x2\x38\0\0\au\0\0\x4\x32)
geometryNomacs=@Rect(967 568 943 507)
windowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x3\0\0\0\0\0\0\x1\0\0\0\x4\x4\xfc\x2\0\0\0\x1\xfb\0\0\0\x14\0\x44\0k\0\x45\0x\0p\0l\0o\0r\0\x65\0r\0\0\0\0\x34\0\0\x4\x4\0\0\0\0\0\0\0\0\0\0\0\x1\0\0\0\xdd\0\0\x3\xc4\xfc\x2\0\0\0\x1\xfb\0\0\0\x14\0\x44\0k\0\x45\0\x64\0i\0t\0\x44\0o\0\x63\0k\0\0\0\0\x1e\0\0\x3\xc4\0\0\0\0\0\0\0\0\0\0\0\x3\0\0\a\x80\0\0\0>\xfc\x1\0\0\0\x1\xfb\0\0\0\x10\0\x63\0r\0o\0p\0\x44\0o\0\x63\0k\0\0\0\0\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x3\xaf\0\0\x1\xe4\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x16\0\x45\0\x64\0i\0t\0T\0o\0o\0l\0\x42\0\x61\0r\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)
[AppSettings]
appMode=0
@ -12,29 +10,27 @@ currentAppMode=0
defaultJpgQuality=97
firstTime.nomacs.3=false
hideAllPanels=true
showPlayer=@Variant(\0\0\0\r\0\0\0\x6\0)
showMenuBar=false
showRecentFiles=false
useLogFile=true
[CustomPluginShortcuts]
Composite%20Image=Composite Image
Crop%20to%20Metadata=Crop to Metadata
Crop%20to%20Page=Crop to Page
Draw%20to%20Page=Draw to Page
Fake%20Miniatures=Fake Miniatures
Image%20Transform=Image Transform
Paint%20on%20Image=Paint on Image
[Crop]
AspectRatioHorizontal=0
AspectRatioVertical=0
cropToMetadata=false
guides=1
info=true
inverted=false
[DisplaySettings]
bgColorNoMacsRGBA=4281545523
bgColorWidgetRGBA=2852126720
fadeSec=@Variant(\0\0\0\x87\0\0\0\0)
fadeSec=0
fontColorRGBA=4292730333
highlightColorRGBA=4278233855
iconColorRGBA=4292730333
iconSize=18
showCrop=true
themeName312=Dark-Theme.css
transition=0
zoomToFit=true
[DkAppManager]
Apps\size=0
@ -51,14 +47,14 @@ overwriteDialog-answer=16384
saveEditDialog=false
saveEditDialog-answer=16384
saveTabsDialog=false
saveTabsDialog-answer=65536
saveTabsDialog-answer=16384
[DkExplorer]
Date%20ModifiedHidden=true
Date%20ModifiedSize=0
LoadSelected=false
NameHidden=false
NameSize=254
NameSize=243
ReadOnly=true
RootPath=/home/itsdrike
SizeHidden=true
@ -69,20 +65,23 @@ TypeSize=0
[DkFilePreview]
windowPosition=1
[DkMetaDataDock]
KeySize=100
ValueSize=113
expandedNames=@Invalid()
[DkMetaDataHUD]
keyValues=File.Filename, File.Path, File.Size, Exif.Image.Make, Exif.Image.Model, Exif.Image.DateTime, Exif.Image.ImageDescription, Exif.Photo.ISO, Exif.Photo.FocalLength, Exif.Photo.ExposureTime, Exif.Photo.Flash, Exif.Photo.FNumber
numColumns=-1
windowPosition=3
[GlobalSettings]
logRecentFiles=false
[MetaDataSettings]
ignoreExifOrientation=false
saveExifOrientation=false
[Page%20Extraction%20Plugin]
Method=0
[SlideShowSettings]
time=@Variant(\0\0\0\x87@\xa0\0\0)
[SynchronizeSettings]
checkForUpdates=true
disableUpdateInteraction=false

View file

@ -1,3 +1,4 @@
prefix=${XDG_DATA_HOME}/npm
cache=${XDG_CACHE_HOME}/npm
tmp=${XDG_RUNTIME_DIR}/npm
init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js

View file

@ -1,18 +1,30 @@
import atexit
import os
import readline
from pathlib import Path
def is_vanilla() -> bool:
import sys
cache_xdg_dir = Path(os.environ.get("XDG_CACHE_HOME", str(Path("~/.cache"))))
cache_xdg_dir.mkdir(exist_ok=True, parents=True)
history_file = cache_xdg_dir.joinpath("python_history")
readline.read_history_file(history_file)
return not hasattr(__builtins__, "__IPYTHON__") and "bpython" not in sys.argv[0]
def write_history() -> None:
readline.write_history_file(history_file)
def setup_history():
import os
import atexit
import readline
from pathlib import Path
if state_home := os.environ.get("XDG_STATE_HOME"):
state_home = Path(state_home)
else:
state_home = Path.home() / ".local" / "state"
history: Path = state_home / "python_history"
# https://github.com/python/cpython/issues/105694
if not history.is_file():
# breaks on macos + python3 without this.
readline.write_history_file(str(history))
readline.read_history_file(str(history))
atexit.register(readline.write_history_file, str(history))
atexit.register(write_history)
if is_vanilla():
setup_history()

View file

@ -0,0 +1,844 @@
[General]
version=5.0.1
allow_multiple_instances=-1
width=800
always_on_top=0
enable_tooltips=1
keep_function_dialog_open=0
error_info_shown=1
save_mode_on_exit=1
save_definitions_on_exit=1
clear_history_on_exit=0
save_history_separately=0
history_expression_type=2
ignore_locale=0
load_global_definitions=1
auto_update_exchange_rates=-1
local_currency_conversion=1
use_binary_prefixes=0
check_version=0
show_keypad=1
show_history=0
history_height=318
minimal_width=500
show_stack=1
show_convert=0
persistent_keypad=0
minimal_mode=0
show_bases_keypad=1
continuous_conversion=1
set_missing_prefixes=0
rpn_keys=1
display_expression_status=1
parsed_expression_in_resultview=0
enable_completion=1
enable_completion2=1
completion_min=1
completion_min2=1
completion_delay=0
calculate_as_you_type_history_delay=2000
use_unicode_signs=1
lower_case_numbers=0
duodecimal_symbols=0
exp_display=3
imaginary_j=0
base_display=1
twos_complement=1
hexadecimal_twos_complement=0
twos_complement_input=0
hexadecimal_twos_complement_input=0
programming_outbase=10
programming_inbase=10
spell_out_logical_operators=1
caret_as_xor=0
close_with_esc=-1
digit_grouping=1
copy_ascii=0
copy_ascii_without_units=0
decimal_comma=-1
dot_as_separator=-1
comma_as_separator=0
gtk_theme=1
vertical_button_padding=-1
horizontal_button_padding=-1
use_custom_result_font=0
use_custom_expression_font=0
use_custom_status_font=0
use_custom_keypad_font=0
use_custom_history_font=0
use_custom_application_font=0
multiplication_sign=2
division_sign=1
automatic_number_fraction_format=1
expression_history=95czk
expression_history=135czk
expression_history=127czk
expression_history=127
expression_history=comb(30,2)×comb(25,2)×comb(20,1)
expression_history=8!/(5!×3!)×8
expression_history=comb(8, 3)×8
expression_history=comb(8, 3)
expression_history=4!×2
expression_history=9×9×8×7×6×5
expression_history=6!
expression_history=2520/7!
expression_history=7!
expression_history=comb(45, 2)
expression_history=(comb(64, 3))comb(8,3)×8
expression_history=(comb(64, 3))comb(8,3)
expression_history=(comb(64, 3))
expression_history=(comb(56, 2)×comb(8, 1))×(comb(56, 1)×comb(8, 2))
expression_history=(comb(56, 2)×comb(8, 1))+(comb(56, 1)×comb(8, 2))
expression_history=comb(32, 2)×comb(32, 1)×2
expression_history=4!×3!×2!×3!
expression_history=8!
expression_history=5×4
expression_history=5×4×3
expression_history=3!×3×2×2
expression_history=5!×2
expression_history=4!
expression_history=4!×2×2
expression_history=(5!)×2
expression_history=5!
expression_history=6×5×4×3×2×1
expression_history=6×5×4×6×2×1
expression_history=10!/(8!)
expression_history=comb(8, 2)×comb(10, 4)+comb(8, 1)×comb(10, 5)+comb(10, 6)
expression_history=comb(10,2)×comb(8,4)
expression_history=comb(10,2)+comb(8,4)
expression_history=comb(10,2)+comb(16,4)
expression_history=10×9×16×15×14×13
expression_history=4×4×3×2
expression_history=3×4×3×2
expression_history=3×4×3
expression_history=2×4×3×2
expression_history=2×4×3×2×1
expression_history=comb(8, 2)
expression_history=8C2
expression_history=8×7
expression_history=10!/(5!×5!)
expression_history=10!/5!
expression_history=7!/((75)!×5!)
expression_history=8!/((85)!×5!)
expression_history=8!/((85)!)
expression_history=8!/(85)!
expression_history=8×7×6
expression_history=4!×3!
expression_history=172669722332860×15×1000
expression_history=172669722344860×2
expression_history=500/280
expression_history=498/280
expression_history=480×2
expression_history=1280480
expression_history=((86400000/1000)/60)/60
expression_history=(86400000/1000)/60
expression_history=86400000/1000
expression_history=34.8usd
expression_history=5015
expression_history=22usd
expression_history=180/20
expression_history=log2(652618)
expression_history=652618
expression_history=bin(652618)
expression_history=14500/4
expression_history=80/8
expression_history=324×25
expression_history=300×25
expression_history=638/7
expression_history=2××7
expression_history=(15000×300)/3.6
expression_history=15000×300
expression_history=250czk
expression_history=5000czk
expression_history=5czk
expression_history=5k
expression_history=1504.32/60
expression_history=1504.32czk/60eur
expression_history=30eur/1504.32czk
expression_history=183.75czk
expression_history=735/4
expression_history=(3688czk)3625czk
expression_history=(3688czk)3625
expression_history=3688czk
expression_history=14500czk/4
expression_history=14500czk
expression_history=184czk
expression_history=735czk/4
expression_history=735czk
expression_history=35000czk
expression_history=20000czk
expression_history=29×3
expression_history=(60×20)/60
expression_history=60×20
history_time=1727342283
history_expression=95czk
history_parse=95CZK to EUR
history_result_approximate=€3.781395534
history_time=1727342267
history_expression=135czk
history_parse=135CZK to EUR
history_result_approximate=€5.373562075
history_time=1727342265
history_expression=127czk
history_parse=127CZK to EUR
history_result_approximate=€5.055128766
history_time=1727342263
history_expression=127
history_parse=127
history_result=127
history_time=1727342256
history_expression=135czk
history_parse=135CZK
history_result_approximate=$6.015165386
history_time=1727342258
history_result_approximate=CVE 592.5426900
history_result_approximate=537.3562075eurocents
history_time=1727342259
history_result_approximate=€5.373562075
history_time=1727292570
history_expression=comb(30,2)×comb(25,2)×comb(20,1)
history_parse=comb(30, 2) × comb(25, 2) × comb(20, 1)
history_result=2610000
history_time=1727292525
history_expression=8!/(5!×3!)×8
history_parse=(factorial(8) (factorial(5) × factorial(3))) × 8
history_result=448
history_time=1727292493
history_expression=comb(8, 3)×8
history_parse=comb(8, 3) × 8
history_result=448
history_time=1727292489
history_expression=comb(8, 3)
history_parse=comb(8, 3)
history_result=56
history_time=1727292470
history_expression=4!×2
history_parse=factorial(4) × 2
history_result=48
history_time=1727292259
history_expression=9×9×8×7×6×5
history_parse=9 × 9 × 8 × 7 × 6 × 5
history_result=136080
history_time=1727292219
history_expression=6!
history_parse=factorial(6)
history_result=720
history_time=1727281361
history_expression=2520/7!
history_parse=2520 factorial(7)
history_result=0.5
history_time=1727281337
history_expression=7!
history_parse=factorial(7)
history_result=5040
history_time=1727280771
history_expression=comb(45, 2)
history_parse=comb(45, 2)
history_result=990
history_time=1727280717
history_expression=(comb(64, 3))comb(8,3)×8
history_parse=comb(64, 3) (comb(8, 3) × 8)
history_result=41216
history_time=1727280688
history_expression=(comb(64, 3))comb(8,3)
history_parse=comb(64, 3) comb(8, 3)
history_result=41608
history_time=1727280639
history_expression=(comb(64, 3))
history_parse=comb(64, 3)
history_result=41664
history_time=1727280572
history_expression=(comb(56, 2)×comb(8, 1))×(comb(56, 1)×comb(8, 2))
history_parse=(comb(56, 2) × comb(8, 1)) × (comb(56, 1) × comb(8, 2))
history_result=19317760
history_time=1727280500
history_expression=(comb(56, 2)×comb(8, 1))+(comb(56, 1)×comb(8, 2))
history_parse=(comb(56, 2) × comb(8, 1)) + (comb(56, 1) × comb(8, 2))
history_result=13888
history_time=1727280492
history_expression=(comb(56, 2)×comb(8, 1))×(comb(56, 1)×comb(8, 2))
history_parse=(comb(56, 2) × comb(8, 1)) × (comb(56, 1) × comb(8, 2))
history_result=19317760
history_time=1727280408
history_expression=comb(32, 2)×comb(32, 1)×2
history_parse=comb(32, 2) × comb(32, 1) × 2
history_result=31744
history_time=1727280364
history_expression=4!×3!×2!×3!
history_parse=factorial(4) × factorial(3) × factorial(2) × factorial(3)
history_result=1728
history_time=1727280317
history_expression=8!
history_parse=factorial(8)
history_result=40320
history_time=1727280292
history_expression=5×4
history_parse=5 × 4
history_result=20
history_time=1727280285
history_expression=5×4×3
history_parse=5 × 4 × 3
history_result=60
history_time=1727280190
history_expression=3!×3×2×2
history_parse=factorial(3) × 3 × 2 × 2
history_result=72
history_time=1727279907
history_expression=5!×2
history_parse=factorial(5) × 2
history_result=240
history_time=1727279831
history_expression=4!
history_parse=factorial(4)
history_result=24
history_time=1727279830
history_expression=4!×2
history_parse=factorial(4) × 2
history_result=48
history_time=1727279778
history_expression=4!×2×2
history_parse=factorial(4) × 2 × 2
history_result=96
history_time=1727279719
history_expression=(5!)×2
history_parse=factorial(5) × 2
history_result=240
history_time=1727279715
history_expression=5!
history_parse=factorial(5)
history_result=120
history_time=1727279713
history_expression=6!
history_parse=factorial(6)
history_result=720
history_time=1727279701
history_expression=5!
history_parse=factorial(5)
history_result=120
history_time=1727279632
history_expression=6×5×4×3×2×1
history_parse=6 × 5 × 4 × 3 × 2 × 1
history_result=720
history_time=1727279622
history_expression=6×5×4×6×2×1
history_parse=6 × 5 × 4 × 6 × 2 × 1
history_result=1440
history_time=1727279485
history_expression=6×5×4×6×2×1
history_parse=6 × 5 × 4 × 6 × 2 × 1
history_result=1440
history_time=1727279609
history_result=(8 × 10<sup>29</sup> 89009813) × √(α) × q<sub>P</sub>
history_time=1727279432
history_expression=10!/(8!)
history_parse=factorial(10) factorial(8)
history_result=90
history_time=1727279388
history_expression=comb(8, 2)×comb(10, 4)+comb(8, 1)×comb(10, 5)+comb(10, 6)
history_parse=(comb(8, 2) × comb(10, 4)) + (comb(8, 1) × comb(10, 5)) + comb(10, 6)
history_result=8106
history_time=1727279314
history_expression=comb(10,2)×comb(8,4)
history_parse=comb(10, 2) × comb(8, 4)
history_result=3150
history_time=1727279296
history_expression=comb(10,2)+comb(8,4)
history_parse=comb(10, 2) + comb(8, 4)
history_result=115
history_time=1727279276
history_expression=comb(10,2)+comb(16,4)
history_parse=comb(10, 2) + comb(16, 4)
history_result=1865
history_time=1727279232
history_expression=10×9×16×15×14×13
history_parse=10 × 9 × 16 × 15 × 14 × 13
history_result=3931200
history_time=1727279148
history_expression=4×4×3×2
history_parse=4 × 4 × 3 × 2
history_result=96
history_time=1727279136
history_expression=3×4×3×2
history_parse=3 × 4 × 3 × 2
history_result=72
history_time=1727279114
history_expression=3×4×3
history_parse=3 × 4 × 3
history_result=36
history_time=1727278893
history_expression=2×4×3×2
history_parse=2 × 4 × 3 × 2
history_result=48
history_time=1727278843
history_expression=2×4×3×2×1
history_parse=2 × 4 × 3 × 2 × 1
history_result=48
history_time=1727278684
history_expression=comb(8, 2)
history_parse=comb(8, 2)
history_result=28
history_time=1727278667
history_expression=8C2
history_parse=8coulomb<sup>2</sup>
history_result=8C<sup>2</sup>
history_time=1727278616
history_expression=8×7
history_parse=8 × 7
history_result=56
history_time=1727278554
history_expression=10!/(5!×5!)
history_parse=factorial(10) (factorial(5) × factorial(5))
history_result=252
history_time=1727278540
history_expression=10!/5!
history_parse=factorial(10) factorial(5)
history_result=30240
history_time=1727278512
history_expression=7!/((75)!×5!)
history_parse=factorial(7) (factorial(7 5) × factorial(5))
history_result=21
history_time=1727278486
history_expression=8!/((85)!×5!)
history_parse=factorial(8) (factorial(8 5) × factorial(5))
history_result=56
history_time=1727278425
history_expression=8!/(85)!
history_parse=factorial(8) factorial(8 5)
history_result=6720
history_time=1727278231
history_expression=8×7×6
history_parse=8 × 7 × 6
history_result=336
history_time=1727276103
history_expression=4!×3!
history_parse=factorial(4) × factorial(3)
history_result=144
history_time=1726696097
history_expression=172669722332860×15×1000
history_parse=1726697223328 (60 × 15 × 1000)
history_result=1726696323328
history_time=1726696068
history_expression=172669722344860×2
history_parse=1726697223448 (60 × 2)
history_result=1726697223328
history_time=1726619113
history_expression=500/280
history_parse=500 280
history_result=25 14
history_time=1726619106
history_expression=498/280
history_parse=498 280
history_result=249 140
history_time=1726593466
history_expression=480×2
history_parse=480 × 2
history_result=960
history_time=1726592811
history_expression=1280480
history_parse=1280 480
history_result=800
history_time=1726523587
history_expression=((86400000/1000)/60)/60
history_parse=((86400000 1000) 60) 60
history_result=24
history_time=1726523579
history_expression=(86400000/1000)/60
history_parse=(86400000 1000) 60
history_result=1440
history_time=1726523576
history_expression=86400000/1000
history_parse=86400000 1000
history_result=86400
history_time=1726496554
history_expression=34.8usd
history_parse=34.8USD
history_result=$34.8
history_time=1726496555
history_result_approximate=CVE 3449.034694
history_result_approximate=3127.808736eurocents
history_time=1726496556
history_result_approximate=€31.27808736
history_time=1726234180
history_expression=5015
history_parse=50 15
history_result=35
history_time=1726162266
history_expression=22usd
history_parse=22USD
history_result=$22
history_time=1726162273
history_result_approximate=CVE 2202.196805
history_result_approximate=1997.095134eurocents
history_time=1726162274
history_result_approximate=€19.97095134
history_time=1726060907
history_expression=180/20
history_parse=180 20
history_result=9
history_time=1726046557
history_expression=log2(652618)
history_parse=log<sub>2</sub>(652618)
history_result_approximate=19.31587925
history_time=1726046521
history_expression=652618
history_parse=652618
history_result=652618
history_time=1726046530
history_result=0000 0000 0000 1001 1111 0101 0100 1010<sub><small>2</small></sub>
history_time=1726046551
history_result=652618
history_time=1726046517
history_expression=bin(652618)
history_parse=bin(<i>"652618"</i>)
history_error=Character '6' was ignored in the number "652618" with base 2.
history_error=Character '5' was ignored in the number "652618" with base 2.
history_error=Character '2' was ignored in the number "652618" with base 2.
history_error=Character '8' was ignored in the number "652618" with base 2.
history_result=1
history_time=1726046512
history_expression=652618
history_parse=652618
history_result=652618
history_time=1725978858
history_expression=14500/4
history_parse=14500 4
history_result=3625
history_time=1725574098
history_expression=80/8
history_parse=80 8
history_result=10
history_time=1725463240
history_expression=324×25
history_parse=324 × 25
history_result=8100
history_time=1725463233
history_expression=300×25
history_parse=300 × 25
history_result=7500
history_time=1725105187
history_expression=638/7
history_parse=638 7
history_result_approximate=91.14285714
history_time=1725104792
history_expression=2××7
history_parse=2<sup>7</sup>
history_result=128
history_time=1724192718
history_expression=(15000×300)/3.6
history_parse=(15000 × 300) 3.6
history_result=1250000
history_time=1724192715
history_expression=15000×300
history_parse=15000 × 300
history_result=4500000
history_time=1724173179
history_expression=250czk
history_parse=250CZK
history_result_approximate=$11.01438906
history_time=1724173180
history_result_approximate=CVE 1095.774704
history_result_approximate=993.7196915eurocents
history_time=1724173181
history_result_approximate=€9.937196915
history_time=1724172274
history_expression=5000czk
history_parse=5000CZK
history_result_approximate=$220.2877812
history_time=1724172276
history_result_approximate=CDF 630288.4268
history_time=1724172277
history_result_approximate=CVE 21915.49408
history_result_approximate=19874.39383eurocents
history_time=1724172278
history_result_approximate=€198.7439383
history_time=1724172270
history_expression=5czk
history_parse=5CZK
history_result_approximate=$0.2202877812
history_time=1724172207
history_expression=5k
history_parse=5 × 1000
history_result=5000
history_time=1724171979
history_expression=1504.32/60
history_parse=1504.32 60
history_result=25.072
history_time=1724171974
history_expression=1504.32czk/60eur
history_parse=(1504.32CZK) (60EUR)
history_result_approximate=0.9965816043
history_time=1724171966
history_expression=30eur/1504.32czk
history_parse=(30EUR) (1504.32CZK)
history_result_approximate=0.5017150606
history_time=1724171791
history_expression=5000czk
history_parse=5000CZK
history_result_approximate=$220.2877812
history_time=1724167931
history_expression=183.75czk
history_parse=183.75CZK
history_result_approximate=$8.095575960
history_time=1724167933
history_result_approximate=CVE 805.3944073
history_result_approximate=730.3839733eurocents
history_time=1724167935
history_result_approximate=€7.303839733
history_time=1724167917
history_expression=735/4
history_parse=735 4
history_result=183.75
history_time=1724167611
history_expression=(3688czk)3625czk
history_parse=(3688CZK) (3625CZK) to EUR
history_result_approximate=€2.504173623
history_time=1724167609
history_expression=(3688czk)3625
history_parse=(3688CZK) 3625 to EUR
history_result_approximate=€146.5935289 3625.000000
history_time=1724167603
history_expression=3688czk
history_parse=3688CZK to EUR
history_result_approximate=€146.5935289
history_time=1724167540
history_expression=14500czk/4
history_parse=(14500CZK) 4 to EUR
history_result_approximate=€144.0893553
history_time=1724167532
history_expression=14500czk
history_parse=14500CZK
history_result_approximate=$638.8345655
history_time=1724167534
history_result_approximate=CVE 63554.93282
history_result_approximate=57635.74211eurocents
history_time=1724167535
history_result_approximate=€576.3574211
history_time=1724167230
history_expression=183.75czk
history_parse=183.75CZK
history_result_approximate=$8.095575960
history_time=1724167237
history_result_approximate=CVE 805.3944073
history_result_approximate=730.3839733eurocents
history_time=1724167238
history_result_approximate=€7.303839733
history_time=1724167225
history_expression=735/4
history_parse=735 4
history_result=183.75
history_time=1724167222
history_expression=184czk
history_parse=184CZK
history_result_approximate=$8.106590349
history_time=1724167207
history_expression=735/4
history_parse=735 4
history_result=183.75
history_time=1724167172
history_expression=735czk/4
history_parse=(735CZK) 4
history_result_approximate=$8.095575960
history_time=1724167168
history_expression=735czk
history_parse=735CZK
history_result_approximate=$32.38230384
history_time=1724166888
history_expression=14500/4
history_parse=14500 4
history_result=3625
history_time=1724080135
history_expression=35000czk
history_parse=35000CZK
history_result_approximate=$1534.629284
history_time=1724080106
history_expression=20000czk
history_parse=20000CZK
history_result_approximate=$876.9310194
history_time=1724013854
history_expression=29×3
history_parse=29 × 3
history_result=87
history_time=1724013476
history_expression=(60×20)/60
history_parse=(60 × 20) 60
history_result=20
history_time=1724013473
history_expression=60×20
history_parse=60 × 20
history_result=1200
history_time=1724013442
history_expression=24+24+12
history_parse=24 + 24 + 12
history_result=60
history_time=1723541887
history_expression=38+15
history_parse=38 + 15
history_result=53
history_time=1723541880
history_expression=(4333)+5
history_parse=(43 33) + 5
history_result=15
history_time=1723541879
history_expression=4333
history_parse=43 33
history_result=10
history_time=1723319641
history_expression=11mA×1kohm
history_parse=(11milliamperes) × (1kiloohm)
history_result=11V
history_time=1723319554
history_expression=220ohm×54mA
history_parse=(220ohms) × (54milliamperes)
history_result=11.88V
history_time=1723317250
history_expression=1.5k×7mA
history_parse=(1.5 × 1000) × (7milliamperes)
history_result=10.5A
history_time=1723317195
history_expression=12.5V/5mA
history_parse=(12.5volts) (5milliamperes)
history_result=2.5
history_time=1723317115
history_expression=11k×7×10^3
history_parse=(11 × 1000) × 7 × 10<sup>3</sup>
history_result=77
history_time=1723317084
history_expression=11k×7m
history_parse=(11 × 1000) × (7meters)
history_result=77km
history_time=1723317016
history_expression=12/(1×10^3)
history_parse=12 (1 × 10<sup>3</sup>)
history_result=12000
history_time=1723316369
history_expression=12V/200ohm
history_parse=(12volts) (200ohms)
history_result=60mA
history_time=1723316359
history_expression=12v/200ohm
history_parse=12 (200ohms)
history_error=Trailing characters "v" (not a valid variable/function/unit) in number "12v" were ignored.
history_result=60mS
history_time=1723232596
history_expression=190ml/8.3s
history_parse=(190milliliters) (8.3seconds)
history_result_approximate=22.89156627mL s
history_time=1723059809
history_expression=(10800/60)/60
history_parse=(10800 60) 60
history_result=3
history_time=1723059807
history_expression=10800/60
history_parse=10800 60
history_result=180
history_time=1722970501
history_expression=0.98××30
history_parse=0.98<sup>30</sup>
history_result_approximate=0.5454843194
history_time=1722855354
history_expression=10cad
history_parse=10CAD to EUR
history_result_approximate=€6.651147323
history_time=1722855343
history_expression=10×52
history_parse=10 × 52
history_result=520
history_time=1722855320
history_expression=43×52
history_parse=43 × 52
history_result=2236
history_time=1722855280
history_expression=65.7cad
history_parse=65.7CAD
history_result_approximate=$47.34682408
history_time=1722855292
history_result_approximate=CVE 4818.582640
history_time=1722855293
history_result_approximate=4369.803791eurocents
history_time=1722855294
history_result_approximate=€43.69803791
history_time=1722855269
history_expression=42.85+22.85
history_parse=42.85 + 22.85
history_result=65.7
recent_functions=
recent_variables=
recent_units=
latest_button_currency=USD
[Mode]
min_deci=0
use_min_deci=0
max_deci=2
use_max_deci=0
precision=10
interval_arithmetic=1
interval_display=0
min_exp=-1
negative_exponents=0
sort_minus_last=1
number_fraction_format=1
complex_number_form=0
use_prefixes=1
use_prefixes_for_all_units=0
use_prefixes_for_currencies=0
abbreviate_names=1
all_prefixes_enabled=0
denominator_prefix_enabled=1
place_units_separately=1
auto_post_conversion=3
mixed_units_conversion=3
number_base=10
number_base_expression=10
read_precision=0
assume_denominators_nonzero=1
warn_about_denominators_assumed_nonzero=1
structuring=1
angle_unit=1
functions_enabled=1
variables_enabled=1
calculate_functions=1
calculate_variables=1
variable_units_enabled=1
sync_units=1
unknownvariables_enabled=0
units_enabled=1
allow_complex=1
allow_infinite=1
indicate_infinite_series=0
show_ending_zeroes=1
rounding_mode=0
approximation=0
interval_calculation=1
concise_uncertainty_input=0
calculate_as_you_type=0
in_rpn_mode=0
chain_mode=0
limit_implicit_multiplication=0
parsing_mode=0
simplified_percentage=1
implicit_question_asked=1
spacious=1
excessive_parenthesis=0
visible_keypad=0
short_multiplication=1
default_assumption_type=4
default_assumption_sign=0
[Plotting]
plot_legend_placement=2
plot_style=0
plot_smoothing=0
plot_display_grid=1
plot_full_border=0
plot_min=0
plot_max=10
plot_step=1
plot_sampling_rate=1001
plot_use_sampling_rate=1
plot_variable=x
plot_rows=0
plot_type=0
plot_color=1
plot_linewidth=2

View file

@ -0,0 +1,62 @@
[General]
JPEGSaveQuality=95
absoluteZoomStep=false
autoResizeLimit=90
autoResizeWindow=false
backgroundOpacity=1
blurBackground=false
confirmDelete=true
confirmTrash=false
cursorAutohiding=true
defaultCropAction=0
defaultFitMode=0
defaultViewMode=0
drawTransparencyGrid=false
enableSmoothScroll=true
expandImage=false
expandLimit=2
firstRun=false
focusPointIn1to1Mode=1
folderEndAction=0
imageScrolling=1
infoBarFullscreen=true
infoBarWindowed=false
jxlAnimation=false
keepFitMode=false
lastVerMajor=1
lastVerMicro=2
lastVerMinor=0
loopSlideshow=false
mpvBinary=/nix/store/sz3h6s8p2r22v76m0yr6fn3m663sms7r-mpv-with-scripts-0.37.0/bin/mpv
openInFullscreen=false
panelEnabled=true
panelFullscreenOnly=true
panelPosition=top
panelPreviewsSize=140
playVideoSounds=false
scalingFilter=1
showSaveOverlay=true
slideshowInterval=3000
smoothAnimatedImages=true
smoothUpscaling=true
sortingMode=0
squareThumbnails=false
thumbPanelStyle=1
thumbnailCache=true
thumbnailerThreads=4
unloadThumbs=true
useOpenGL=false
usePreloader=true
useSystemColorScheme=false
videoPlayback=true
windowTitleExtendedInfo=true
zoomIndicatorMode=0
zoomStep=0.20000000298023224
[Controls]
shortcuts="zoomIn=+", "frameStepBack=,", "zoomOut=-", "frameStep=.", "fitWindow=1", "scrollDown=2", "fitNormal=3", "scrollLeft=4", "scrollRight=6", "scrollUp=8", "exit=Alt+X", "folderView=Backspace", "crop=C", "copyFileClipboard=Ctrl+C", "showInDirectory=Ctrl+D", "zoomOut=Ctrl+Down", "rotateLeft=Ctrl+L", "seekVideoBackward=Ctrl+Left", "open=Ctrl+O", "print=Ctrl+P", "exit=Ctrl+Q", "rotateRight=Ctrl+R", "seekVideoForward=Ctrl+Right", "save=Ctrl+S", "copyPathClipboard=Ctrl+Shift+C", "saveAs=Ctrl+Shift+S", "zoomIn=Ctrl+Up", "pasteFile=Ctrl+V", "zoomOutCursor=Ctrl+WheelDown", "zoomInCursor=Ctrl+WheelUp", "discardEdits=Ctrl+Z", "s:trash with trash-cli=Del", "scrollDown=Down", "jumpToLast=End", "folderView=Enter", "closeFullScreenOrExit=Esc", "toggleFullscreen=F", "toggleFullscreen=F11", "renameFile=F2", "reloadImage=F5", "flipH=H", "jumpToFirst=Home", "toggleImageInfo=I", "toggleFullscreen=LMB_DoubleClick", "prevImage=Left", "moveFile=M", "contextMenu=Menu", "openSettings=P", "resize=R", "contextMenu=RMB", "nextImage=Right", "removeFile=Shift+Del", "toggleFullscreenInfoBar=Shift+F", "prevDirectory=Shift+Left", "nextDirectory=Shift+Right", "toggleFitMode=Space", "scrollUp=Up", "flipV=V", "nextImage=WheelDown", "prevImage=WheelUp", "prevImage=XButton1", "nextImage=XButton2", "toggleSlideshow=`", "toggleShuffle=~"
[Scripts]
script\1\name=trash with trash-cli
script\1\value=@Variant(\0\0\0\x7f\0\0\0\aScript\0\0\0\0 \0t\0r\0\x61\0s\0h\0-\0p\0u\0t\0 \0%\0\x66\0i\0l\0\x65\0%\x1)
script\size=1

View file

@ -0,0 +1,13 @@
[Colors]
accent=#8c9b81
background=#1a1a1a
background_fullscreen=#1a1a1a
folderview=#242424
folderview_topbar=#383838
icons=#a4a4a4
overlay=#1a1a1a
overlay_text=#d2d2d2
scrollbar=#5a5a5a
text=#b6b6b6
widget=#252525
widget_border=#2c2c2c

View file

@ -1,32 +1,2 @@
[Appearance]
color_scheme_path=/usr/share/qt5ct/colors/simple.conf
custom_palette=false
icon_theme=Papirus-Dark
standard_dialogs=gtk3
style=Adwaita-Dark
[Fonts]
fixed=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
general=@Variant(\0\0\0@\0\0\0\x12\0N\0o\0t\0o\0 \0S\0\x61\0n\0s@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
[Interface]
activate_item_on_single_click=1
buttonbox_layout=0
cursor_flash_time=1000
dialog_buttons_have_icons=1
double_click_interval=400
gui_effects=@Invalid()
keyboard_scheme=2
menus_have_icons=true
show_shortcuts_in_context_menus=true
stylesheets=@Invalid()
toolbutton_style=4
underline_shortcut=1
wheel_scroll_lines=3
[SettingsWindow]
geometry="@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x5$\0\0\x3\x30\0\0\0\0\0\0\0\0\0\0\x5;\0\0\x4\x92\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x5$\0\0\x3\x30)"
[Troubleshooting]
force_raster_widgets=1
ignored_applications=@Invalid()

View file

@ -0,0 +1,2 @@
[Appearance]
icon_theme=Papirus-Dark

View file

@ -0,0 +1,2 @@
[default]
license = "GPL-3.0-or-later"

View file

@ -59,27 +59,21 @@ fi
# Config access shortcuts
alias cfzsh='vim ~/.config/zsh/.zshrc'
alias cfprofile='vim ~/.config/zsh/.zprofile'
alias cfprompt='vim ~/.config/zsh/rc/prompt.zsh'
alias cfalias='vim ~/.config/shell/aliases'
alias cffunctions='vim ~/.config/shell/functions'
alias cfprofile='vim ~/.config/shell/profile'
alias cfenvironment='vim ~/.config/shell/environment'
alias cfenv='cfenvironment'
alias cfhandlers='vim ~/.config/shell/handlers'
alias cfprompt='vim ~/.config/shell/prompt'
alias cfkeybinds='vim ~/.config/shell/keybinds'
alias cftodo='vim ~/Personal/vimwiki/todo.md'
alias cfnvim='vim ~/.config/nvim'
alias cfvim='cfnvim'
alias cfgit='vim ~/.config/git/config'
alias cfhypr='vim ~/.config/hypr'
alias cfsway='vim ~/.config/sway/config'
# z.lua shortcuts
alias j='z' # for the sake of autojump old habits
alias zz='z -c' # restrict matches to subdirs of $PWD
alias zb='z -b' # restrict matches to parent directories
alias zi='z -I' # cd with interactive fzf selection
alias zbi='z -b -I' # pick parent directory to cd into with fzf
# zoxide shortcuts
alias j='z' # for the sake of old habits from autojump
alias ji='zi' # interactive mode (fzf)
# Fallbacks
command -v hd > /dev/null || alias hd='hexdump -C' # Cannonical hex dump; some systems have this symlinked
@ -109,13 +103,6 @@ alias mergepdf='gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=_merged.p
alias encrypt='gpg -c --no-symkey-cache --cipher-algo AES256' # Encrypt file with AES256 symetric encryption
alias decrypt='gpg' # For the sake of completeness, include decrypt command to the above, though it's only just gpg alias
# Terminal window swallowing for blocking programs (devour)
alias xdg-open='devour xdg-open'
alias mpv='devour mpv'
alias nomacs='devour nomacs'
alias pcmanfm='devour pcmanfm'
alias spotify='devour spotify'
# Regular expressions
alias reg_email='echo "[a-Z0-9._%-]+@[a-Z0-9.-]+\.[a-Z]{2,10}"'
alias reg_mac='echo "([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}"'
@ -150,19 +137,17 @@ alias iptlistout='iptables -L OUTPUT -n -v --line-numbers' # OUT rules
alias iptlistfw='iptables -L FORWARD -n -v --line-numbers' # FORWARD rules
alias ufw-log='journalctl -f -n 100 -g ufw' # Show UFW log entries in system journal
# Kernel actions
alias kernel-recompile='cd /usr/src/linux && make -j7 && make -j7 modules_install && make install'
alias kernel-oldconfig='cd /usr/src/linux && make oldconfig'
alias kernel-configure='cd /usr/src/linux && make menuconfig'
# System actions
alias sv='systemctl'
alias pacnew="find / -name '*.pacnew' 2>/dev/null" # Search for all new configurations after pacman update
alias backup="rsync -avHAXS --delete --filter='dir-merge /.rsync-filter'" # Make full rsync backup, respecting .rsync-filter files for exclusions
alias upload='curl -F "f:1=<-" ix.io'
#alias upload='curl -F "f:1=<-" ix.io' # ix.io was offline for about 10 months now...
#alias upload='curl -F "sprunge=<-" http://sprunge.us' # sprunge.us was offline for a few weeks now, not sure why
alias upload='curl -F "file=@-" https://hardfiles.org' # hardfiles.org works, but has 24-hour expiry
alias upload-journal='sudo journalctl -b -1 | upload' # Upload journalctl from last boot to ix.io
alias auth-log='journalctl SYSLOG_FACILITY=10 -r'
alias cpu-stress='for i in $(seq $(getconf _NPROCESSORS_ONLN)); do yes > /dev/null & done' # Run `yes > /dev/null` on all cores as stress test
alias cpu-power='sudo turbostat --Summary --quiet --show PkgWatt --interval 1'
alias nvidia='__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia' # Run app with nvidia (on hybrid mode with optimus)
alias swapout='sudo swapoff -a; sudo swapon -a' # Reset swap (move everything to RAM)
alias mount-ram='mount -t tmpfs tmpfs' # Mount RAM disk for fast filesystem
@ -218,6 +203,7 @@ alias gd='git diff'
alias gdc='git diff --cached'
alias gundo='git reset --soft HEAD~'
alias gredo="git reset 'HEAD@{1}'"
alias gpr="gh pr checkout"
# Youtube-dl aliases
alias ytv-best='youtube-dl -f bestvideo+bestaudio'
@ -249,6 +235,7 @@ alias nf='neofetch'
alias hist='fc -lt "$HISTTIMEFORMAT" 1'
alias sudovim='sudoedit'
alias cls='clear'
alias wh='which'
# Kitty terminal kitten shorthands
if [ "$TERM" = "xterm=kitty" ]; then
@ -287,9 +274,11 @@ if [ -x /usr/bin/dircolors ]; then
alias egrep='egrep --color=auto'
alias diff='diff --color=auto'
# shellcheck disable=SC2032
alias ip='ip --color=auto'
# Take advantage of $LS_COLORS for completion as well
# shellcheck disable=SC2296
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
fi
@ -304,12 +293,6 @@ if [ ! "$(uname -s)" = 'Darwin' ]; then
fi
fi
# Autogenerate python aliases
if [ -f ~/.config/shell/py-alias ]; then
# shellcheck source=/home/itsdrike/.config/shell/py-alias
. "$HOME/.config/shell/py-alias"
fi
# Functions
if [ -f ~/.config/shell/functions ]; then
# shellcheck source=/home/itsdrike/.config/shell/functions

View file

@ -8,6 +8,22 @@
# which means the XDG definitions will be ignored anyway, and
# defining them may break programs when root is actually logged in.
# Add all folders in ~/.local/bin into PATH
# Some window managers require this line to be in profile not in .zshenv
if [ -d "$HOME/.local/bin" ]; then
PATH+=":$(find -L ~/.local/bin -type d | tr '\n' ':' | sed 's/:$//')"
fi
if [ -d "$HOME/.local/share/npm/bin" ]; then
PATH+=":$HOME/.local/share/npm/bin"
fi
# Prepend rye shims to PATH, to have rye python executables
# take priority over the system-wide python.
if [ -d "${RYE_HOME:-$HOME/.rye}/shims" ]; then
PATH="${RYE_HOME:-$HOME/.rye}/shims:$PATH"
fi
# Define some variables for POSIX compatibility
uid="$(id -u)"
@ -16,14 +32,26 @@ export EDITOR="nvim"
export BROWSER="firefox"
export TERMINAL="alacritty"
export DIFFPROG="nvim -d"
export FILEMANAGER="pcmanfm"
export FILEMANAGER="pcmanfm-qt"
# XDG Standard paths
# XDG Base Directory standard paths
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_RUNTIME_DIR="/run/user/$uid"
export XDG_STATE_HOME="$HOME/.local/state"
export XDG_BIN_HOME="$HOME/.local/bin"
# XDG User directories (should match ~/.config/user-dirs.dirs)
#export XDG_DESKTOP_DIR="$HOME/Desktop"
export XDG_DOWNLOAD_DIR="$HOME/Downloads"
export XDG_TEMPLATES_DIR="$XDG_DATA_HOME/templates"
export XDG_PUBLICSHARE_DIR="$XDG_DATA_HOME/public"
#export XDG_DOCUMENTS_DIR="$HOME/Documents"
export XDG_MUSIC_DIR="$HOME/Media/Music"
export XDG_PICTURES_DIR="$HOME/Media/Pictures"
export XDG_VIDEOS_DIR="$HOME/Media/Videos"
export XDG_SCREENSHOTS_DIR="$HOME/Media/Pictures/Screenshots"
# Per-Application XDG settings
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
@ -33,7 +61,7 @@ export ZSH_COMPDUMP="$ZSH_CACHE/zcompdump-$ZSH_VERSION"
export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc"
#export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" # This line will break some DMs.
export LESSHISTFILE="-"
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc"
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc":"$XDG_CONFIG_HOME/gtk-2.0/gtkrc.mine"
export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
export GOPATH="$XDG_DATA_HOME/go"
@ -44,22 +72,47 @@ export _JAVA_OPTIONS="-Djava.util.prefs.userRoot=$XDG_CONFIG_HOME/java"
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
export NPM_CONFIG_CACHE="$XDG_CACHE_HOME/npm"
export NPM_CONFIG_PREFIX="$XDG_DATA_HOME/npm"
export NPM_CONFIG_TMP="$XDG_RUNTIME_DIR/npm"
export NUGET_PACKAGES="$XDG_CACHE_HOME/NuGetPackages"
export PARALLEL_HOME="$XDG_CONFIG_HOME/parallel"
export RANDFILE="$XDG_CACHE_HOME/rnd"
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc.py"
export PYTHONPYCACHEPREFIX="$XDG_CACHE_HOME/python"
export PYTHONUSERBASE="$XDG_DATA_HOME/python"
# Less commonly used applications
export _ZL_DATA="$XDG_DATA_HOME/zlua"
export SQLITE_HISTORY="$XDG_DATA_HOME/sqlite_history"
export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime"
export IPYTHONDIR="$XDG_CONFIG_HOME/ipython"
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
export MYPY_CACHE_DIR="$XDG_CACHE_HOME/mypy"
#export PYLINTHOME="$XDG_CACHE_HOME/pylint"
#export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
#export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
export PYLINTHOME="$XDG_CACHE_HOME/pylint"
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"
export WINEPREFIX="$XDG_DATA_HOME/wine"
export MPLAYERHOME="$XDG_CONFIG_HOME/mplayer"
export ANDROID_HOME="$XDG_DATA_HOME/android"
export M2_HOME="$XDG_DATA_HOME/m2"
export NODE_REPL_HISTORY="$XDG_DATA_HOME/node_repl_history"
export DOTNET_CLI_HOME="$XDG_DATA_HOME/dotnet"
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME/jupyter"
export RYE_HOME="$XDG_CONFIG_HOME/rye"
export OMNISHARPHOME="$XDG_CONFIG_HOME"/omnisharp
# Theming
export GTK_THEME="Tokyonight-Dark"
export GTK_USE_PORTAL=1
export QT_STYLE_OVERRIDE=kvantum
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_AUTO_SCREEN_SCALE_FACTOR="1"
export QT_QPA_PLATFORM="wayland;xcb"
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export XCURSOR_THEME="BreezeX-RosePine-Linux"
export XCURSOR_SIZE="24"
export HYPRCURSOR_THEME="rose-pine-hyprcursor"
export HYPRCURSOR_SIZE="24"
# Colorful man pages!
# Use neovim to open man pages
@ -84,12 +137,9 @@ fi
# Other program settings
export HISTTIMEFORMAT="%Y-%m-%d %T "
export SUDO_ASKPASS="$HOME/.local/bin/scripts/gui/prompt/menupass"
export PIPENV_VENV_IN_PROJECT=1 # Force pipenv to create new environments within projects ./.venv
export XSECURELOCK_SHOW_HOSTNAME=0 # Don't show hostname in xsecurelock
export XSECURELOCK_SHOW_DATETIME=1 # Show current date and time in xsecurelock
export QT_QPA_PLATFORMTHEME="qt5ct" # Have QT use theme from qt5ct.
#export QT_STYLE_OVERRIDE="gtk2" # Have QT use the gtk2 theme (needs aur/qt5-styleplugins)
#export QSG_RENDER_LOOP=basic # Fix Stremio freezing
export PIPENV_VENV_IN_PROJECT=1 # Force pipenv to create new environments within projects ./.venv
export XSECURELOCK_SHOW_HOSTNAME=0 # Don't show hostname in xsecurelock
export XSECURELOCK_SHOW_DATETIME=1 # Show current date and time in xsecurelock
# Remove irrelevant variables added for posix compatibility
unset posix

View file

@ -202,8 +202,8 @@ anonymize() {
# Reset the prompt on initial run to allow this script
# to be ran multiple times without user having to reload
# PS1 manually
# shellcheck source=/home/itsdrike/.config/shell/prompt
. "${XDG_CONFIG_DIR:-$HOME/.config}/shell/prompt"
# shellcheck source=/home/itsdrike/.config/zsh/rc/prompt.zsh
. "${ZDOTDIR}/rc/prompt.zsh"
# Regular expression to match 0-255 numbers (color)
color_int_re='^(0+)?([0-9]{1,2}|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'

View file

@ -1,30 +0,0 @@
#!/bin/zsh
# User .profile definition.
# This file is only sourced once, after login, Unlike
# .zshrc/.bashrc, which will run whenever a new terminal
# is opened.
# Add all folders in ~/.local/bin into PATH
# Some window managers require this line to be in profile
# not in .zshenv
if [ -d "$HOME/.local/bin" ]; then
PATH+=":${$(find -L ~/.local/bin -type d | tr '\n' ':')%%:}"
fi
if [ -d "$HOME/.local/share/pyenv/shims" ]; then
PATH+=":$HOME/.local/share/pyenv/shims"
fi
if [ -d "$HOME/.local/share/npm/bin" ]; then
PATH+=":$HOME/.local/share/npm/bin"
fi
# Start graphical session automatically on tty1 if Hyprland or startx is available
if [ "$(tty)" = "/dev/tty1" ] && [ "$UID" != 0 ]; then
if command -v Hyprland >/dev/null; then
! pidof -s Hyprland >/dev/null 2>&1 && launch-hypr
elif command -v startx >/dev/null; then
! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
fi
fi

View file

@ -1,196 +0,0 @@
#!/usr/bin/env zsh
# Simple script which automatically defines certain aliases for python,
# which will automatically use certain python version
# Versions are automatically obtained from $PYENV_ROOT/versions directories
# NOTE: This assumes that all folders in this directory are valid python versions
#
# Assume we have these installed pyenv python versions 3.6.5, 3.6.12 and 3.10.1:
# - Set full-version aliases: py3.6.5, py3.6.12 and py3.10.1
# - Set py3 to 3.10.1 (latest with major version 3)
# - Set py3.6 to 3.6.12 (latest with major version 3 and minor version 6)
# - Set py3.10 to 3.10.1 (latest, and only python with major version 3 and minor version 10)
# Define all wanted aliases for a given python version
# $1 - full valid pyenv python version (for example '3.6.12', `3.11-dev`, or `pypy3.6-7.2.0-src`)
# $2 - version used in the alias (for example '3.6', '3', or even '', but also `pypy3.7`, ...)
define_aliases() {
version="$1"
alias_version="$2"
cmd_prefix="PYENV_VERSION=$version"
alias "py$alias_version=$cmd_prefix python"
alias "ipy$alias_version=$cmd_prefix ipython"
alias "bpy$alias_version=$cmd_prefix bpython"
alias "pydoc$alias_version=$cmd_prefix pydoc"
alias "pytest$alias_version=$cmd_prefix pytest"
alias -g "PY$alias_version=$cmd_prefix"
}
# Handle splitting full version into prefix, version number and suffix
# Because of the huge variaty of python implemenations and their different namings,
# this function will only be able to handle the default CPython version names,
# which follow the regex pattern of: '\d+\.\d+\.\d+', the rest will print 'full_version;;'
# In the future, this may also include support for some other naming schemes.
# $1 - full valid pyenv python version (for example '3.6.12', `3.11-dev`, or `pypy3.6-7.2.0-src`)
parse_python_version() {
full_version="$1"
if echo "$full_version" | grep -E "[0-9]+\.[0-9]+\.[0-9]+" >/dev/null; then
echo ";$full_version;"
else
echo ';;'
fi
}
# Prints version number extracted from alias for given version
# $1 - version used in the alias (for example '3.6', '3', or even '', but also 'pypy3.6', ...)
get_alias_version() {
alias_version="$1"
definition="$(alias "py$alias_version")"
full_version="$(echo "$definition" | cut -d= -f3 | cut -d' ' -f1)"
version_info="$(parse_python_version "$full_version")"
version="$(echo "$version_info" | cut -d';' -f2)"
echo "$version"
}
# Compares 2 python versions in major, minor and micro parts
# $1 - version #1
# $2 - version #2
# Returns:
# 0 - version #1 is newer
# 1 - version #2 is newer
# 2 - versions are equal
version_compare() {
version_1="$1"
version_2="$2"
# ZSH Only:
version_1=("${(@s:.:)version_1}")
version_2=("${(@s:.:)version_2}")
major_1=$version_1[1]
major_2=$version_2[1]
minor_1=$version_1[2]
minor_2=$version_2[2]
micro_1=$version_1[3]
micro_2=$version_2[3]
# POSIX, but slow:
# major_1="$(echo "$version_1" | cut -d. -f1)"
# major_2="$(echo "$version_2" | cut -d. -f1)"
# minor_1="$(echo "$version_1" | cut -d. -f2)"
# minor_2="$(echo "$version_2" | cut -d. -f2)"
# micro_1="$(echo "$version_1" | cut -d. -f3)"
# micro_2="$(echo "$version_2" | cut -d. -f3)"
# Compare majors
if [ $major_1 -gt $major_2 ]; then
# version 1's major is bigger, version 1 is newer
return 0
elif [ $major_1 -lt $major_2 ]; then
# version 1's major is smaller, version 2 is newer
return 1
fi
# Majors equal, compare minors
if [ $minor_1 -gt $minor_2 ]; then
# version 1's minor is bigger, version 1 is newer
return 0
elif [ $minor_1 -lt $minor_2 ]; then
# version 1's major is smaller, version 2 is newer
return 1
fi
# Minors equal, compare micros
if [ $micro_1 -gt $micro_2 ]; then
# version 1's micro is bigger, version 1 is newer
return 0
elif [ $micro_1 -lt $micro_2 ]; then
# version 1's micro is smaller, version 2 is newer
return 1
fi
# Micros equal, versions equal
return 2
}
# Define new aliases if they don't already exsist, in which case override
# if the current version is newer than the version in the alias
# $1 - full valid pyenv python version (for example '3.6.12', `3.11-dev`, or `pypy3.6-7.2.0-src`)
# $2 - version used in the alias (for example '3.6', '3', or even '', but also `pypy3.7`, ...)
try_define_aliases() {
version="$1"
alias_version="$2"
# Check if alias already exists
if alias "py$alias_version" >/dev/null; then
# Compare version from the existing alias with current version,
# if current is newer, override the existing alias(es)
defined_version="$(get_alias_version "$alias_version")"
if version_compare "$version" "$defined_version"; then
define_aliases "$version" "$alias_version"
# echo "Overwrote '$alias_version' aliases to point to '$version'"
return 0
else
return 1
fi
fi
# The aliases aren't already defined, it's safe to create them
define_aliases "$version" "$alias_version"
# echo "Made '$alias_version' aliases pointing to '$version'"
return 0
}
define_version_aliases() {
prefix="$1"
version="$2"
suffix="$3"
# ZSH only:
version_data=("${(@s:.:)version}")
major_version=$version_data[1]
minor_version=$version_data[2]
# POSIX, but slow:
# major_version="$(echo "$version" | cut -d. -f1)"
# minor_version="$(echo "$version" | cut -d. -f2)"
# Define the major.minor.micro (full) alias
try_define_aliases "$version" "$prefix$version$suffix"
# Define the major.minor alias
try_define_aliases "$version" "$prefix$major_version.$minor_version$suffix"
# Define the major alias
try_define_aliases "$version" "$prefix$major_version$suffix"
# Define top level alias
try_define_aliases "$version" "$prefix$suffix"
}
for python_dir in "$PYENV_ROOT"/versions/*/ ; do
full_version="$(basename $python_dir)"
version_info="$(parse_python_version "$full_version")"
if [ $version_info = ';;' ]; then
# Version info wasn't obtained successfully, skip this version
echo "Skipped $full_version"
continue
fi
# ZSH only:
version_data=("${(@s:;:)version_info}")
prefix=$version_data[1]
version=$version_data[2]
suffix=$version_data[3]
# POSIX, but slow:
# prefix="$(echo "$version_info" | cut -d';' -f1)"
# version="$(echo "$version_info" | cut -d';' -f2)"
# suffix="$(echo "$version_info" | cut -d';' -f3)"
# startTime=$(date +%N)
define_version_aliases "$prefix" "$version" "$suffix"
# endTime=$(date +%N)
# nanos="$(expr $endTime - $startTime)"
# echo "took $(expr $nanos / 1000000) miliseconds"
done
if command -v poetry >/dev/null 2>&1; then
alias poetry-pyenv='poetry env use "$(pyenv which python)" && poetry install'
fi

View file

@ -1,9 +1,9 @@
[Default]
save_dir=$HOME/Pictures/Screenshots
early_exit=true
line_size=5
paint_mode=rectangle
save_dir=/home/itsdrike/Media/Pictures/Screenshots
save_filename_format=Screenshot_%Y-%M-%d_%H-%M-%S.png
show_panel=false
line_size=5
text_size=20
text_font=JetBrains Mono
early_exit=true
paint_mode=rectangle
text_size=20

View file

@ -1,2 +0,0 @@
timeout 300 "hyprctl dispatch dpms off && dunstctl set-paused true" resume "hyprctl dispatch dpms on && dunstctl set-paused false"
timeout 310 "loginctl lock-session"

View file

@ -1,31 +0,0 @@
ignore-empty-password
clock
color=1d1f21
indicator-idle-visible
indicator-radius=150
indicator-thickness=30
inside-color=1d1f21
inside-clear-color=1d1f21
inside-ver-color=1d1f21
inside-wrong-color=1d1f21
key-hl-color=7aa6daaa
bs-hl-color=d54e53aa
separator-color=55555555
line-color=1d1f21
line-uses-ring
text-color=81a2be
text-clear-color=b5bd68
text-caps-lock-color=f0c674
text-ver-color=81a2be
text-wrong-color=cc6666
ring-color=81a2be55
ring-ver-color=81a2be
ring-clear-color=b5bd6811
ring-wrong-color=cc6666

View file

@ -0,0 +1,85 @@
{
"$schema": "/etc/xdg/swaync/configSchema.json",
"positionX": "right",
"positionY": "top",
"layer": "overlay",
"control-center-layer": "top",
"layer-shell": true,
"cssPriority": "application",
"control-center-margin-top": 0,
"control-center-margin-bottom": 0,
"control-center-margin-right": 0,
"control-center-margin-left": 0,
"notification-2fa-action": true,
"notification-inline-replies": false,
"notification-icon-size": 48,
"notification-body-image-height": 100,
"notification-body-image-width": 200,
"timeout": 8,
"timeout-low": 5,
"timeout-critical": 0,
"fit-to-screen": true,
"relative-timestamps": true,
"control-center-width": 300,
"control-center-height": 600,
"notification-window-width": 300,
"keyboard-shortcuts": true,
"image-visibility": "when-available",
"transition-time": 200,
"hide-on-clear": false,
"hide-on-action": true,
"script-fail-notify": true,
"scripts": {
"example-script": {
"exec": "echo 'Do something...'",
"urgency": "Normal"
},
"example-action-script": {
"exec": "echo 'Do something actionable!'",
"urgency": "Normal",
"run-on": "action"
}
},
"notification-visibility": {
"example-name": {
"state": "enabled",
"urgency": "Low",
"app-name": "Spotify"
}
},
"widgets": ["inhibitors", "title", "dnd", "notifications", "mpris"],
"widget-config": {
"inhibitors": {
"text": "Inhibitors",
"button-text": "Clear All",
"clear-all-button": true
},
"title": {
"text": "Notifications",
"clear-all-button": true,
"button-text": "Clear All"
},
"dnd": {
"text": "Do Not Disturb"
},
"label": {
"max-lines": 5,
"text": "Label Text"
},
"mpris": {
"image-size": 96,
"image-radius": 12
},
"buttons-grid": {
"actions": [
{
"label": "直",
"type": "toggle",
"active": true,
"command": "sh -c '[[ $SWAYNC_TOGGLE_STATE == true ]] && nmcli radio wifi on || nmcli radio wifi off'",
"update_command": "sh -c '[[ $(nmcli radio wifi) == \"enabled\" ]] && echo true || echo false'"
}
]
}
}
}

View file

@ -0,0 +1,611 @@
@define-color cc-bg rgba(46, 46, 46, 0.7);
@define-color noti-border-color rgba(255, 255, 255, 0.15);
@define-color noti-bg rgba(48, 48, 48, 0.8);
@define-color noti-bg-opaque rgb(48, 48, 48);
@define-color noti-bg-darker rgb(38, 38, 38);
@define-color noti-bg-hover rgb(56, 56, 56);
@define-color noti-bg-hover-opaque rgb(56, 56, 56);
@define-color noti-bg-focus rgba(68, 68, 68, 0.6);
@define-color noti-close-bg rgba(255, 255, 255, 0.1);
@define-color noti-close-bg-hover rgba(255, 255, 255, 0.15);
@define-color text-color rgb(255, 255, 255);
@define-color text-color-disabled rgb(150, 150, 150);
@define-color bg-selected rgb(0, 128, 255);
.notification-row {
outline: none;
}
.notification-row:focus,
.notification-row:hover {
background: @noti-bg-focus;
}
.notification-row .notification-background {
padding: 6px 12px;
}
.notification-row .notification-background .close-button {
/* The notification Close Button */
background: @noti-close-bg;
color: @text-color;
text-shadow: none;
padding: 0;
border-radius: 100%;
margin-top: 5px;
margin-right: 5px;
box-shadow: none;
border: none;
min-width: 24px;
min-height: 24px;
}
.notification-row .notification-background .close-button:hover {
box-shadow: none;
background: @noti-close-bg-hover;
transition: background 0.15s ease-in-out;
border: none;
}
.notification-row .notification-background .notification {
/* The actual notification */
border-radius: 12px;
border: 1px solid @noti-border-color;
padding: 0;
transition: background 0.15s ease-in-out;
background: @noti-bg;
}
.notification-row .notification-background .notification.low {
/* Low Priority Notification */
}
.notification-row .notification-background .notification.normal {
/* Normal Priority Notification */
}
.notification-row .notification-background .notification.critical {
/* Critical Priority Notification */
}
.notification-row .notification-background .notification .notification-action,
.notification-row
.notification-background
.notification
.notification-default-action {
padding: 4px;
margin: 0;
box-shadow: none;
background: transparent;
border: none;
color: @text-color;
transition: background 0.15s ease-in-out;
}
.notification-row
.notification-background
.notification
.notification-action:hover,
.notification-row
.notification-background
.notification
.notification-default-action:hover {
-gtk-icon-effect: none;
background: @noti-bg-hover;
}
.notification-row
.notification-background
.notification
.notification-default-action {
/* The large action that also displays the notification summary and body */
border-radius: 12px;
}
.notification-row
.notification-background
.notification
.notification-default-action:not(:only-child) {
/* When alternative actions are visible */
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content {
background: transparent;
border-radius: 12px;
padding: 4px;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.image {
/* Notification Primary Image */
-gtk-icon-effect: none;
border-radius: 100px;
/* Size in px */
margin: 4px;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.app-icon {
/* Notification app icon (only visible when the primary image is set) */
-gtk-icon-effect: none;
-gtk-icon-shadow: 0 1px 4px black;
margin: 6px;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.text-box
.summary {
/* Notification summary/title */
font-size: 16px;
font-weight: bold;
background: transparent;
color: @text-color;
text-shadow: none;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.text-box
.time {
/* Notification time-ago */
font-size: 16px;
font-weight: bold;
background: transparent;
color: @text-color;
text-shadow: none;
margin-right: 30px;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.text-box
.body {
/* Notification body */
font-size: 15px;
font-weight: normal;
background: transparent;
color: @text-color;
text-shadow: none;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
progressbar {
/* The optional notification progress bar */
margin-top: 4px;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.body-image {
/* The "extra" optional bottom notification image */
margin-top: 4px;
background-color: white;
border-radius: 12px;
-gtk-icon-effect: none;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.inline-reply {
/* The inline reply section */
margin-top: 4px;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.inline-reply
.inline-reply-entry {
background: @noti-bg-darker;
color: @text-color;
caret-color: @text-color;
border: 1px solid @noti-border-color;
border-radius: 12px;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.inline-reply
.inline-reply-button {
margin-left: 4px;
background: @noti-bg;
border: 1px solid @noti-border-color;
border-radius: 12px;
color: @text-color;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.inline-reply
.inline-reply-button:disabled {
background: initial;
color: @text-color-disabled;
border: 1px solid @noti-border-color;
border-color: transparent;
}
.notification-row
.notification-background
.notification
.notification-default-action
.notification-content
.inline-reply
.inline-reply-button:hover {
background: @noti-bg-hover;
}
.notification-row .notification-background .notification .notification-action {
/* The alternative actions below the default action */
border-top: 1px solid @noti-border-color;
border-radius: 0px;
border-right: 1px solid @noti-border-color;
}
.notification-row
.notification-background
.notification
.notification-action:first-child {
/* add bottom border radius to eliminate clipping */
border-bottom-left-radius: 12px;
}
.notification-row
.notification-background
.notification
.notification-action:last-child {
border-bottom-right-radius: 12px;
border-right: none;
}
.notification-group {
/* Styling only for Grouped Notifications */
}
.notification-group.low {
/* Low Priority Group */
}
.notification-group.normal {
/* Low Priority Group */
}
.notification-group.critical {
/* Low Priority Group */
}
.notification-group .notification-group-buttons,
.notification-group .notification-group-headers {
margin: 0 16px;
color: @text-color;
}
.notification-group .notification-group-headers {
/* Notification Group Headers */
}
.notification-group .notification-group-headers .notification-group-icon {
color: @text-color;
}
.notification-group .notification-group-headers .notification-group-header {
color: @text-color;
}
.notification-group .notification-group-buttons {
/* Notification Group Buttons */
}
.notification-group.collapsed .notification-row .notification {
background-color: @noti-bg-opaque;
}
.notification-group.collapsed .notification-row:not(:last-child) {
/* Top notification in stack */
/* Set lower stacked notifications opacity to 0 */
}
.notification-group.collapsed
.notification-row:not(:last-child)
.notification-action,
.notification-group.collapsed
.notification-row:not(:last-child)
.notification-default-action {
opacity: 0;
}
.notification-group.collapsed:hover
.notification-row:not(:only-child)
.notification {
background-color: @noti-bg-hover-opaque;
}
.control-center {
/* The Control Center which contains the old notifications + widgets */
background: @cc-bg;
color: @text-color;
border-radius: 12px;
}
.control-center .control-center-list-placeholder {
/* The placeholder when there are no notifications */
opacity: 0.5;
}
.control-center .control-center-list {
/* List of notifications */
background: transparent;
}
.control-center .control-center-list .notification {
box-shadow:
0 0 0 1px rgba(0, 0, 0, 0.3),
0 1px 3px 1px rgba(0, 0, 0, 0.7),
0 2px 6px 2px rgba(0, 0, 0, 0.3);
}
.control-center .control-center-list .notification .notification-default-action,
.control-center .control-center-list .notification .notification-action {
transition:
opacity 400ms ease-in-out,
background 0.15s ease-in-out;
}
.control-center
.control-center-list
.notification
.notification-default-action:hover,
.control-center .control-center-list .notification .notification-action:hover {
background-color: @noti-bg-hover;
}
.blank-window {
/* Window behind control center and on all other monitors */
background: transparent;
}
.floating-notifications {
background: transparent;
}
.floating-notifications .notification {
box-shadow: none;
}
/*** Widgets ***/
/* Title widget */
.widget-title {
color: @text-color;
margin: 8px;
font-size: 1.5rem;
}
.widget-title > button {
font-size: initial;
color: @text-color;
text-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
border-radius: 12px;
}
.widget-title > button:hover {
background: @noti-bg-hover;
}
/* DND widget */
.widget-dnd {
color: @text-color;
margin: 8px;
font-size: 1.1rem;
}
.widget-dnd > switch {
font-size: initial;
border-radius: 12px;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
}
.widget-dnd > switch:checked {
background: @bg-selected;
}
.widget-dnd > switch slider {
background: @noti-bg-hover;
border-radius: 12px;
}
/* Label widget */
.widget-label {
margin: 8px;
}
.widget-label > label {
font-size: 1.1rem;
}
/* Mpris widget */
@define-color mpris-album-art-overlay rgba(0, 0, 0, 0.55);
@define-color mpris-button-hover rgba(0, 0, 0, 0.50);
.widget-mpris {
/* The parent to all players */
}
.widget-mpris .widget-mpris-player {
padding: 8px;
padding: 16px;
margin: 16px 20px;
background-color: @mpris-album-art-overlay;
border-radius: 12px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.75);
}
.widget-mpris .widget-mpris-player button:hover {
/* The media player buttons (play, pause, next, etc...) */
background: @noti-bg-hover;
}
.widget-mpris .widget-mpris-player .widget-mpris-album-art {
border-radius: 12px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.75);
}
.widget-mpris .widget-mpris-player .widget-mpris-title {
font-weight: bold;
font-size: 1.25rem;
}
.widget-mpris .widget-mpris-player .widget-mpris-subtitle {
font-size: 1.1rem;
}
.widget-mpris .widget-mpris-player > box > button {
/* Change player control buttons */
}
.widget-mpris .widget-mpris-player > box > button:hover {
background-color: @mpris-button-hover;
}
.widget-mpris > box > button {
/* Change player side buttons */
}
.widget-mpris > box > button:disabled {
/* Change player side buttons insensitive */
}
/* Buttons widget */
.widget-buttons-grid {
padding: 8px;
margin: 8px;
border-radius: 12px;
background-color: @noti-bg;
}
.widget-buttons-grid > flowbox > flowboxchild > button {
background: @noti-bg;
border-radius: 12px;
}
.widget-buttons-grid > flowbox > flowboxchild > button.toggle:checked {
/* style given to the active toggle button */
}
/* Menubar widget */
.widget-menubar > box > .menu-button-bar > button {
border: none;
background: transparent;
}
/* .AnyName { Name defined in config after #
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
.AnyName>button {
background: transparent;
border: none;
}
.AnyName>button:hover {
background-color: @noti-bg-hover;
} */
.topbar-buttons > button {
/* Name defined in config after # */
border: none;
background: transparent;
}
/* Volume widget */
.widget-volume {
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
.widget-volume > box > button {
background: transparent;
border: none;
}
.per-app-volume {
background-color: @noti-bg-alt;
padding: 4px 8px 8px 8px;
margin: 0px 8px 8px 8px;
border-radius: 12px;
}
/* Backlight widget */
.widget-backlight {
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
/* Inhibitors widget */
.widget-inhibitors {
margin: 8px;
font-size: 1.5rem;
}
.widget-inhibitors > button {
font-size: initial;
color: @text-color;
text-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
border-radius: 12px;
}
.widget-inhibitors > button:hover {
background: @noti-bg-hover;
}

View file

@ -0,0 +1,14 @@
[Unit]
Description=Show a notification when the battery is low
Requires=graphical-session.target
[Service]
Type=oneshot
ExecStart=%h/.local/bin/scripts/gui/battery-notification
RemainAfterExit=false
Restart=on-failure
Slice=background-graphical.slice
[Install]
WantedBy=graphical-session.target

View file

@ -0,0 +1,12 @@
[Unit]
Description=Timer for low battery notification sendout
After=graphical-session.target
Requires=graphical-session.target
PartOf=graphical-session.target
[Timer]
OnUnitActiveSec=20s
[Install]
WantedBy=graphical-session.target

View file

@ -1,10 +1,13 @@
[Unit]
Description="Clipboard clipboard manager"
PartOf=graphical-session.target
Description=Clipman clipboard manager
After=graphical-session.target
Requires=graphical-session.target
[Service]
ExecStart=/usr/bin/wl-paste -t text --watch /usr/bin/clipman store --no-persist
Restart=on-failure
Slice=background-graphical.slice
[Install]
WantedBy=wm-ready.target
WantedBy=graphical-session.target

View file

@ -0,0 +1 @@
/usr/lib/systemd/user/systemd-lock-handler.service

View file

@ -1,10 +0,0 @@
[Unit]
Description="Dunst daemon"
PartOf=graphical-session.target
[Service]
ExecStart=/usr/bin/dunst
Restart=on-failure
[Install]
WantedBy=wm-ready.target

View file

@ -1,17 +1,18 @@
[Unit]
Description="Open %I eww window"
PartOf=graphical-session.target
Description=Open %I eww window
After=graphical-session.target
After=eww.service
PartOf=eww.service
[Service]
ExecStartPre=/usr/local/bin/eww ping
ExecStart=/usr/local/bin/eww open %i
ExecStop=/usr/local/bin/eww close %i
Type=oneshot
ExecStartPre=/usr/bin/eww ping
ExecStart=/usr/bin/eww open %i
ExecStop=/usr/bin/eww close %i
RemainAfterExit=true
Restart=on-failure
RestartSec=3s
Slice=background-graphical.slice
[Install]
WantedBy=wm-ready.target
WantedBy=graphical-session.target

View file

@ -1,11 +1,14 @@
[Unit]
Description="Eww daemon"
PartOf=graphical-session.target
Description=Eww daemon
After=graphical-session.target
After=pipewire.service
Requires=graphical-session.target
Requires=pipewire.service
[Service]
ExecStart=/usr/local/bin/eww daemon --no-daemonize
ExecStart=/usr/bin/eww daemon --no-daemonize
Restart=always
RestartSec=3s
Slice=background-graphical.slice
[Install]
WantedBy=wm-ready.target
WantedBy=graphical-session.target

View file

@ -1,14 +1,14 @@
[Unit]
Description="Show unread GitHub notifications"
PartOf=graphical-session.target
After=dunst.service
Description=Show unread GitHub notifications
Requires=graphical-session.target
[Service]
ExecStart=%h/.local/bin/scripts/gui/gh-notification -vv
Type=oneshot
ExecStart=%h/.local/bin/scripts/gui/gh-notification -vv
RemainAfterExit=false
Restart=on-failure
RestartSec=3s
Slice=background-graphical.slice
[Install]
WantedBy=wm-ready.target
WantedBy=graphical-session.target

View file

@ -1,9 +1,13 @@
[Unit]
Description="Timer for GitHub notification sendout"
Description=Timer for GitHub notification sendout
After=graphical-session.target
Requires=graphical-session.target
PartOf=graphical-session.target
[Timer]
OnUnitActiveSec=1m
Unit=gh-notification.service
[Install]
WantedBy=wm-ready.target
WantedBy=graphical-session.target

View file

@ -0,0 +1,2 @@
[Service]
Environment="GNUPGHOME=%h/.local/share/gnupg"

View file

@ -0,0 +1 @@
/home/itsdrike/.config/systemd/user/battery-notification.timer

View file

@ -0,0 +1 @@
/usr/lib/systemd/user/hypridle.service

View file

@ -0,0 +1 @@
/home/itsdrike/.config/systemd/user/hyprpaper.service

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