From 31db63c56557bf0655273422803fb0d8ff493257 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 12 Nov 2025 16:19:11 +0300 Subject: [PATCH 01/18] *: move to arch v1 --- .bashrc | 6 +- .config/metapac/config.toml | 11 + .config/metapac/groups/browsers.toml | 3 + .config/metapac/groups/console.toml | 34 +++ .config/metapac/groups/desktop-misc.toml | 26 ++ .config/metapac/groups/desktop-polybar.toml | 8 + .config/metapac/groups/desktop-rofi.toml | 5 + .config/metapac/groups/desktop.toml | 18 ++ .config/metapac/groups/dev.toml | 30 ++ .config/metapac/groups/emacs.toml | 19 ++ .config/metapac/groups/latex.toml | 22 ++ .config/metapac/groups/mail.toml | 7 + .config/metapac/groups/music.toml | 8 + .config/metapac/groups/office.toml | 13 + .config/metapac/groups/system.toml | 35 +++ .emacs.d/modules/sqrt-general-org.el | 36 ++- .emacs.d/modules/sqrt-telega.el | 2 - .profile | 81 +----- Arch.org | 184 ++++++++++++ Console.org | 272 ++++-------------- Desktop.org | 297 +++++++++----------- Emacs.org | 146 +++++----- Mail.org | 34 ++- bin/polybar/c-g.sh | 31 ++ 24 files changed, 774 insertions(+), 554 deletions(-) create mode 100644 .config/metapac/config.toml create mode 100644 .config/metapac/groups/browsers.toml create mode 100644 .config/metapac/groups/console.toml create mode 100644 .config/metapac/groups/desktop-misc.toml create mode 100644 .config/metapac/groups/desktop-polybar.toml create mode 100644 .config/metapac/groups/desktop-rofi.toml create mode 100644 .config/metapac/groups/desktop.toml create mode 100644 .config/metapac/groups/dev.toml create mode 100644 .config/metapac/groups/emacs.toml create mode 100644 .config/metapac/groups/latex.toml create mode 100644 .config/metapac/groups/mail.toml create mode 100644 .config/metapac/groups/music.toml create mode 100644 .config/metapac/groups/office.toml create mode 100644 .config/metapac/groups/system.toml create mode 100644 Arch.org create mode 100755 bin/polybar/c-g.sh diff --git a/.bashrc b/.bashrc index 155cfb9..38cd094 100644 --- a/.bashrc +++ b/.bashrc @@ -29,12 +29,8 @@ xhost +local:root > /dev/null 2>&1 # Startup & environment:5 ends here # [[file:Console.org::*Startup & environment][Startup & environment:6]] -# export MANPAGER="sh -c 'sed -e s/.\\\\x08//g | bat -l man -p'" -# Startup & environment:6 ends here - -# [[file:Console.org::*Startup & environment][Startup & environment:7]] [ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/bash" -# Startup & environment:7 ends here +# Startup & environment:6 ends here # [[file:Console.org::*Launch fish][Launch fish:1]] use_fish=true diff --git a/.config/metapac/config.toml b/.config/metapac/config.toml new file mode 100644 index 0000000..cc583e0 --- /dev/null +++ b/.config/metapac/config.toml @@ -0,0 +1,11 @@ +hostname_enabled_backends_enabled = false +enabled_backends = ["arch"] +hostname_groups_enabled = true + +[hostname_groups] +kek = ["browsers"] +archlinux = ["system","office","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"] + + +[arch] +package_manager = "paru" diff --git a/.config/metapac/groups/browsers.toml b/.config/metapac/groups/browsers.toml new file mode 100644 index 0000000..5ecd895 --- /dev/null +++ b/.config/metapac/groups/browsers.toml @@ -0,0 +1,3 @@ +arch = [ +"firefox", +"ungoogled-chromium-bin",] diff --git a/.config/metapac/groups/console.toml b/.config/metapac/groups/console.toml new file mode 100644 index 0000000..07aabbf --- /dev/null +++ b/.config/metapac/groups/console.toml @@ -0,0 +1,34 @@ +arch = [ +"pv", +"man-db", +"aria2", +"openssl", +"ncdu", +"megacmd", +"jless", +"direnv", +"git-lfs", +"sshfs", +"tokei", +"unrar", +"unzip", +"zip", +"pass", +"7zip", +"fzf", +"neofetch", +"nethogs", +"htop", +"eza", +"ncurses", +"bottom", +"alacritty", +"xclip", +"tmuxp", +"tmux", +"starship", +"nushell", +"shell-color-scripts-git", +"fish", +"xorg-xhost", +"xorg-xrdb",] diff --git a/.config/metapac/groups/desktop-misc.toml b/.config/metapac/groups/desktop-misc.toml new file mode 100644 index 0000000..e1215a3 --- /dev/null +++ b/.config/metapac/groups/desktop-misc.toml @@ -0,0 +1,26 @@ +arch = [ +"android-file-transfer", +"remmina", +"noto-fonts-emoji", +"telegram-desktop", +"bluez", +"xorg-xev", +"gparted", +"gnome-disk-utility", +"anydesk-bin", +"qbittorrent", +"gnome-font-viewer", +"xdg-utils", +"thunar", +"copyq", +"feh", +"polkit-gnome", +"fontconfig", +"xorg-xmodmap", +"network-manager-applet", +"pavucontrol", +"light", +"arandr", +"xorg-xprop", +"xss-lock", +"xorg-xinit",] diff --git a/.config/metapac/groups/desktop-polybar.toml b/.config/metapac/groups/desktop-polybar.toml new file mode 100644 index 0000000..47ce05b --- /dev/null +++ b/.config/metapac/groups/desktop-polybar.toml @@ -0,0 +1,8 @@ +arch = [ +"dateutils", +"sunwait", +"jq", +"curl", +"bind", +"noto-fonts-emoji", +"polybar",] diff --git a/.config/metapac/groups/desktop-rofi.toml b/.config/metapac/groups/desktop-rofi.toml new file mode 100644 index 0000000..ec92a68 --- /dev/null +++ b/.config/metapac/groups/desktop-rofi.toml @@ -0,0 +1,5 @@ +arch = [ +"xorg-xset", +"rofi-pass", +"rofimoji", +"rofi",] diff --git a/.config/metapac/groups/desktop.toml b/.config/metapac/groups/desktop.toml new file mode 100644 index 0000000..1376be0 --- /dev/null +++ b/.config/metapac/groups/desktop.toml @@ -0,0 +1,18 @@ +arch = [ +"activitywatch-bin", +"xdg-desktop-portal", +"flatpak", +"picom", +"libnotify", +"dunst", +"flameshot", +"i3lock", +"i3-wm", +"xorg-xinput", +"xorg-xgamma", +"xorg-xrandr", +"gnome-themes-extra", +"xsettingsd", +"papirus-icon-theme", +"gtk-engines", +"gtk-engine-murrine",] diff --git a/.config/metapac/groups/dev.toml b/.config/metapac/groups/dev.toml new file mode 100644 index 0000000..f2e2449 --- /dev/null +++ b/.config/metapac/groups/dev.toml @@ -0,0 +1,30 @@ +arch = [ +"rust", +"git", +"wireshark-qt", +"socat", +"python-build", +"python-virtualenv", +"python-pip", +"python", +"php", +"gource", +"git-lfs", +"make", +"hugo", +"libfaketime", +"lua", +"cmake", +"gcc", +"pkgconf", +"gopls", +"go", +"jdk21-openjdk", +"nodejs", +"git-filter-repo", +"libvirt", +"virt-manager", +"postgresql", +"docker", +"pandoc-cli", +"micromamba-bin",] diff --git a/.config/metapac/groups/emacs.toml b/.config/metapac/groups/emacs.toml new file mode 100644 index 0000000..965dd58 --- /dev/null +++ b/.config/metapac/groups/emacs.toml @@ -0,0 +1,19 @@ +arch = [ +"texinfo", +"the_silver_searcher", +"ripgrep", +"hledger", +"gnu-free-fonts", +"ttf-unifont", +"yt-dlp", +"mpv", +"python-youtube-transcript-api", +"rdrview", +"graphviz", +"python-isort", +"python-black", +"yapf", +"plantuml", +"difftastic", +"xkb-switch", +"emacs",] diff --git a/.config/metapac/groups/latex.toml b/.config/metapac/groups/latex.toml new file mode 100644 index 0000000..57f35e3 --- /dev/null +++ b/.config/metapac/groups/latex.toml @@ -0,0 +1,22 @@ +arch = [ +"ttf-ms-fonts", +"python-pygments", +"biber", +"texlab", +"texlive-xetex", +"texlive-publishers", +"texlive-pstricks", +"texlive-plaingeneric", +"texlive-pictures", +"texlive-metapost", +"texlive-mathscience", +"texlive-latexrecommended", +"texlive-latexextra", +"texlive-latex", +"texlive-humanities", +"texlive-games", +"texlive-formatsextra", +"texlive-fontutils", +"texlive-binextra", +"texlive-bibtexextra", +"texlive-basic",] diff --git a/.config/metapac/groups/mail.toml b/.config/metapac/groups/mail.toml new file mode 100644 index 0000000..98e7e33 --- /dev/null +++ b/.config/metapac/groups/mail.toml @@ -0,0 +1,7 @@ +arch = [ +"notmuch", +"msmtp", +"parallel", +"notmuch", +"offlineimap", +"lieer-git",] diff --git a/.config/metapac/groups/music.toml b/.config/metapac/groups/music.toml new file mode 100644 index 0000000..112e6d2 --- /dev/null +++ b/.config/metapac/groups/music.toml @@ -0,0 +1,8 @@ +arch = [ +"flac", +"cuetools", +"shntool", +"mpc", +"picard", +"ncmpcpp", +"mpd",] diff --git a/.config/metapac/groups/office.toml b/.config/metapac/groups/office.toml new file mode 100644 index 0000000..77525dc --- /dev/null +++ b/.config/metapac/groups/office.toml @@ -0,0 +1,13 @@ +arch = [ +"obs-studio", +"okular", +"inkscape", +"kdenlive", +"ffmpeg", +"krita", +"gimp", +"libreoffice-fresh", +"zathura-djvu", +"zathura-pdf-mupdf", +"zathura-ps", +"zathura",] diff --git a/.config/metapac/groups/system.toml b/.config/metapac/groups/system.toml new file mode 100644 index 0000000..ba053a0 --- /dev/null +++ b/.config/metapac/groups/system.toml @@ -0,0 +1,35 @@ +arch = [ +"xf86-video-ati", +"xf86-video-amdgpu", +"vulkan-radeon", +"nvidia-utils", +"vulkan-intel", +"intel-media-driver", +"libva-intel-driver", +"zram-generator", +"yadm", +"wpa_supplicant", +"wireless_tools", +"wget", +"xterm", +"vim", +"smartmontools", +"pipewire-jack", +"pipewire-pulse", +"pipewire-alsa", +"pipewire-audio", +"pipewire", +"paru", +"pacman-contrib", +"openssh", +"metapac", +"nano", +"linux-firmware", +"linux", +"lightdm-gtk-greeter", +"lightdm", +"iwd", +"grub", +"decman", +"base-devel", +"base",] diff --git a/.emacs.d/modules/sqrt-general-org.el b/.emacs.d/modules/sqrt-general-org.el index 747b667..07953cb 100644 --- a/.emacs.d/modules/sqrt-general-org.el +++ b/.emacs.d/modules/sqrt-general-org.el @@ -355,7 +355,7 @@ With ARG, repeats or can move backward if negative." name ".csv") "orgtbl-to-csv"))))) -(defun my/extract-guix-dependencies (&optional category) +(defun my/extract-arch-dependencies (&optional category) (let ((dependencies '())) (org-table-map-tables (lambda () @@ -368,7 +368,7 @@ With ARG, repeats or can move backward if negative." nil (mapcar #'substring-no-properties (nth 0 table)) :test (lambda (_ elem) - (string-match-p "[G|g]uix.*dep" elem)))) + (string-match-p "[A|a]rch.*dep" elem)))) (category-name-index (cl-position nil @@ -380,7 +380,13 @@ With ARG, repeats or can move backward if negative." nil (mapcar #'substring-no-properties (nth 0 table)) :test (lambda (_ elem) - (string-match-p ".*[D|d]isabled.*" elem))))) + (string-match-p ".*[D|d]isabled.*" elem)))) + (source-index + (cl-position + nil + (mapcar #'substring-no-properties (nth 0 table)) + :test (lambda (_ elem) + (string-match-p ".*[S|s]ource.*" elem))))) (when dep-name-index (dolist (elem (cdr table)) (when @@ -402,14 +408,26 @@ With ARG, repeats or can move backward if negative." (string-empty-p (nth disabled-name-index elem)))) (add-to-list 'dependencies - (substring-no-properties (nth dep-name-index elem))))))))) + (cons + (substring-no-properties (nth dep-name-index elem)) + (when source-index + (let ((source (nth source-index elem))) + (unless (string-empty-p source) + source))))))))))) dependencies)) -(defun my/format-guix-dependencies (&optional category) - (mapconcat - (lambda (e) (concat "\"" e "\"")) - (my/extract-guix-dependencies category) - "\n")) +(defun my/format-arch-dependencies (&optional category) + (let ((data (my/extract-arch-dependencies category))) + (with-temp-buffer + (insert + (json-encode + (mapcar + (lambda (group) + (cons (car group) + (mapcar #'car (cdr group)))) + (seq-group-by #'cdr data)))) + (json-pretty-print-buffer) + (buffer-string)))) (setq my/org-config-files (mapcar diff --git a/.emacs.d/modules/sqrt-telega.el b/.emacs.d/modules/sqrt-telega.el index c3a7ef8..4710ffc 100644 --- a/.emacs.d/modules/sqrt-telega.el +++ b/.emacs.d/modules/sqrt-telega.el @@ -1,7 +1,5 @@ ;;; -*- lexical-binding: t -*- (use-package telega - ;; :straight (:type built-in) - ;; For now emacs-telega-server is compatible with the latest telega.el :straight t :commands (telega) :init diff --git a/.profile b/.profile index 1376457..8b486f3 100755 --- a/.profile +++ b/.profile @@ -22,14 +22,6 @@ fi # TZ='Asia/Karachi'; export TZ # Environment:5 ends here -#!/usr/bin/env bash -# [[file:Console.org::*Environment][Environment:6]] -if [ -f "/home/pavel/.no-guix" ]; then - export NO_GUIX=true - export PATH=$(echo $PATH | tr ":" "\n" | grep -vE "guix|nix|gnu" | tr "\n" ":") -fi -# Environment:6 ends here - # [[file:Console.org::*My paths][My paths:1]] if [ -d "$HOME/bin" ] ; then export PATH="$HOME/bin:$PATH" @@ -41,15 +33,7 @@ if [ -d "$HOME/.local/bin" ] ; then fi # My paths:1 ends here -# [[file:Console.org::*SSL Certs][SSL Certs:1]] -if [ -d "$HOME/.guix-extra-profiles" ] ; then - export SSL_CERT_DIR="$HOME/.guix-extra-profiles/system/system/etc/ssl/certs/" - export SSL_CERT_FILE="$HOME/.guix-extra-profiles/system/system/etc/ssl/certs/ca-certificates.crt" - export GIT_SSL_CAINFO="$SSL_CERT_FILE" - export CURL_CA_BUNDLE="$SSL_CERT_FILE" -fi -# SSL Certs:1 ends here - +#!/usr/bin/env bash # [[file:Console.org::*ssh-agent][ssh-agent:1]] SSH_AGENT_DIR="/tmp" @@ -66,43 +50,13 @@ if [[ ! -f "$SSH_AUTH_SOCK" ]]; then fi # ssh-agent:1 ends here -# [[file:Console.org::*Guix settings][Guix settings:1]] -if [ -z "$IS_ANDROID" ] && [ -z "$NO_GUIX" ] ; then - GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles - for i in $GUIX_EXTRA_PROFILES/*; do - profile=$i/$(basename "$i") - if [ -f "$profile"/etc/profile ]; then - GUIX_PROFILE="$profile" - . "$GUIX_PROFILE"/etc/profile - fi - if [ -d "$profile"/share/man ]; then - if command -v manpath >/dev/null 2>/dev/null; then - export MANPATH="${MANPATH:-$(manpath)}:$profile/share/man" - else - export MANPATH="${MANPATH}:$profile/share/man" - fi - fi - export XDG_DATA_DIRS="$XDG_DATA_DIRS:$profile/share" - unset profile - done -fi -# Guix settings:1 ends here - -# [[file:Console.org::*Guix settings][Guix settings:2]] +# [[file:Console.org::*Misc settings][Misc settings:1]] export JUPYTER_CONFIG_DIR=$HOME/.config/jupyter -# Guix settings:2 ends here +# Misc settings:1 ends here -# [[file:Console.org::*Guix settings][Guix settings:3]] -export GUIX_PACKAGE_PATH=~/guix-packages -# Guix settings:3 ends here - -# [[file:Console.org::*Guix settings][Guix settings:4]] -export GUIX_LOCPATH=$HOME/.guix-extra-profiles/console/console/lib/locale -# Guix settings:4 ends here - -# [[file:Console.org::*Guix settings][Guix settings:5]] +# [[file:Console.org::*Misc settings][Misc settings:2]] export GIO_EXTRA_MODULES="" -# Guix settings:5 ends here +# Misc settings:2 ends here # [[file:Console.org::*Other package managers][Other package managers:1]] if [ -d "$HOME/.cask" ]; then @@ -125,33 +79,10 @@ if [ -e /home/pavel/.nix-profile/etc/profile.d/nix.sh ] && [ -z "$NO_GUIX" ] ; t # Other package managers:3 ends here # [[file:Console.org::*Other package managers][Other package managers:4]] -if [ -d "$HOME/.guix-extra-profiles/desktop-misc" ] && [ -z "$NO_GUIX" ] ; then - export FONTCONFIG_PATH="$HOME/.guix-extra-profiles/desktop-misc/desktop-misc/etc/fonts" -fi -# Other package managers:4 ends here - -# [[file:Console.org::*Other package managers][Other package managers:5]] -if [ -d "$HOME/.nix-profile" ] && [ -z "$NO_GUIX" ]; then - export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.nix-profile/share/applications" -fi -# Other package managers:5 ends here - -# [[file:Console.org::*Other package managers][Other package managers:6]] if [ -d "$HOME/bin/gradle/gradle-9.0.0" ]; then export PATH="$HOME/bin/gradle/gradle-9.0.0/bin:$PATH" fi -# Other package managers:6 ends here - -# [[file:Console.org::*npm][npm:2]] -export NPM_CONFIG_USERCONFIG=$HOME/._npmrc -# npm:2 ends here - -# [[file:Console.org::*npm][npm:3]] -NPM_PACKAGES="${HOME}/.npm-packages" - -export PATH="$PATH:$NPM_PACKAGES/bin" -export MANPATH="${MANPATH:-$(manpath)}:$NPM_PACKAGES/share/man" -# npm:3 ends here +# Other package managers:4 ends here # [[file:Console.org::*XResources][XResources:1]] if [ -z "$IS_ANDROID" ]; then diff --git a/Arch.org b/Arch.org new file mode 100644 index 0000000..d557114 --- /dev/null +++ b/Arch.org @@ -0,0 +1,184 @@ +#+PROPERTY: header-args :mkdirp yes +#+TITLE: Arch Linux + +I've decided to switch to [[https://archlinux.org/][Arch Linux]] and configure it declaratively with [[https://github.com/ripytide/metapac][metapac]]. + +* System installation +** Installation +On installation, see https://wiki.archlinux.org/title/Installation_guide and/or use =archinstall=. + +** After installation +Update everything: +#+begin_src bash +sudo pacman -Syyu +#+end_src + +Install git, python and yadm: +#+begin_src bash +sudo pacman -Syu python git pacman-contrib yadm +#+end_src + +Select top-6 fastest mirrors to work with. Generate a mirrorlist file using this service: https://archlinux.org/mirrorlist/, then use =rankmirrors= from =pacman-contrib= (see [[https://wiki.archlinux.org/title/Mirrors][Mirrors]] on Arch Wiki). +#+begin_src bash +sudo -i +cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup +rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist +#+end_src + +If there isn't enough RAM (e.g. running in a VM), turn off mounting =/tmp= as [[https://wiki.archlinux.org/title/Tmpfs#Disable_automatic_mount][tmpfs]]: +#+begin_src basd +sudo systemctl mask tmp.mount +#+end_src + +Install [[https://github.com/Morganamilo/paru][paru]]: +#+begin_src bash +sudo pacman -S --needed base-devel +git clone https://aur.archlinux.org/paru.git +cd paru +makepkg -si +#+end_src + +Install [[https://github.com/ripytide/metapac][metapac]]: +#+begin_src bash +paru -Syyu metapac +#+end_src + +Then install Arch packages with =metapac=: +#+begin_src bash +mkdir ~/00-Scratch/ +git clone https://github.com/SqrtMinusOne/dotfiles.git ~/00-Scratch/dotfiles/ +cp -r ~/00-Scratch/dotfiles/.config/metapac ~/.config/ +metapac s +#+end_src + +Then, install the ssh and gpg keys (put them into the =~/.ssh= folder). To export gpg keys: +#+begin_src bash +gpg --output private.pgp --armor --export-secret-keys +#+end_src + +And to import: +#+begin_src bash +gpg --import private.pgp +gpg --edit-key +trust +#+end_src + +Then, clone the dotfiles repo with =yadm=: +#+begin_src bash +yadm clone git@github.com:SqrtMinusOne/dotfiles.git +#+end_src +Checkout the changed files. + +Clone the org-mode repo: +#+begin_src bash +git clone git@github.com:SqrtMinusOne/dotfiles.git "/home/pavel/30-39 Life/32 org-mode" +#+end_src + +Then run =emacs= and make sure it starts. + +* Metapac configuration +[[https://github.com/ripytide/metapac][metapac]] is a declarative wrapper around different package managers, including [[https://wiki.archlinux.org/title/Pacman][pacman]] and [[https://github.com/Morganamilo/paru][paru]]. This means the required packages can be listed in configuration files and checked into version control. + +I've also tried [[https://github.com/kiviktnm/decman][decman]], but it turned out to be too unstable because it ships its own logic for building AUR packages, which doesn't always work. So wrapping =paru= seems like a saner approach. Also, sometimes AUR drops packets, and =decman= can't handle it gracefully. + +In =metapac=, packages are listed in "groups", each group being a TOML file stating which package has to be installed by which package manager. I declare groups as Org tables, see the "System configuration" section in Emacs.org. + +Below is the table enabling different groups on different hostnames: +#+NAME: metapac-groups +| Profile | archlinux | kek | +| browsers | + | + | +| console | + | | +| desktop | + | | +| desktop-misc | + | | +| desktop-polybar | + | | +| desktop-rofi | + | | +| dev | + | | +| emacs | + | | +| latex | + | | +| mail | + | | +| music | + | | +| office | + | | +| system | + | | + +And the code to format it as TOML: +#+NAME: metapac-groups-format +#+begin_src emacs-lisp :var groups=metapac-groups +(let* ((hostnames (cdr (nth 0 groups))) + groups-by-hostname) + (cl-loop for row in (cdr groups) + for group = (nth 0 row) + do (cl-loop for i from 0 + for sign in (cdr row) + for hostname = (nth i hostnames) + if (not (string-empty-p sign)) + do (push group (alist-get hostname groups-by-hostname + nil nil #'equal)))) + (cl-loop for (hostname . groups) in groups-by-hostname + concat (format "%s = [%s]\n" hostname + (mapconcat (lambda (g) (format "\"%s\"" g)) groups ",")))) +#+end_src + +Which is used in the config: +#+begin_src toml :tangle .config/metapac/config.toml :noweb yes +hostname_enabled_backends_enabled = false +enabled_backends = ["arch"] +hostname_groups_enabled = true + +[hostname_groups] +<> + +[arch] +package_manager = "paru" +#+end_src + +* System packages +Some necessary Arch packages: +| Arch dependency | +|---------------------| +| base | +| base-devel | +| decman | +| grub | +| iwd | +| lightdm | +| lightdm-gtk-greeter | +| linux | +| linux-firmware | +| nano | +| metapac | +| openssh | +| pacman-contrib | +| paru | +| pipewire | +| pipewire-audio | +| pipewire-alsa | +| pipewire-pulse | +| pipewire-jack | +| smartmontools | +| vim | +| xterm | +| wget | +| wireless_tools | +| wpa_supplicant | +| yadm | +| zram-generator | + +Various drivers, I'm not sure which I actually need, so... +| Arch dependency | +|--------------------| +| libva-intel-driver | +| intel-media-driver | +| vulkan-intel | +| nvidia-utils | +| vulkan-radeon | +| xf86-video-amdgpu | +| xf86-video-ati | + +#+NAME: packages +#+begin_src emacs-lisp :tangle no :var category="" +(my/format-arch-dependencies category) +#+end_src + +#+begin_src scheme :tangle .config/metapac/groups/system.toml :noweb yes +<> +#+end_src diff --git a/Console.org b/Console.org index fc6f53a..affced5 100644 --- a/Console.org +++ b/Console.org @@ -72,14 +72,6 @@ Timezone # TZ='Asia/Karachi'; export TZ #+end_src -Turn off Guix -#+begin_src bash -if [ -f "/home/pavel/.no-guix" ]; then - export NO_GUIX=true - export PATH=$(echo $PATH | tr ":" "\n" | grep -vE "guix|nix|gnu" | tr "\n" ":") -fi -#+end_src - ** My paths My script folders #+begin_src sh @@ -92,17 +84,6 @@ if [ -d "$HOME/.local/bin" ] ; then export PATH="$HOME/.local/bin:$PATH" fi #+end_src -** SSL Certs -This seems necessary when running Guix on a foreign distro. - -#+begin_src bash -if [ -d "$HOME/.guix-extra-profiles" ] ; then - export SSL_CERT_DIR="$HOME/.guix-extra-profiles/system/system/etc/ssl/certs/" - export SSL_CERT_FILE="$HOME/.guix-extra-profiles/system/system/etc/ssl/certs/ca-certificates.crt" - export GIT_SSL_CAINFO="$SSL_CERT_FILE" - export CURL_CA_BUNDLE="$SSL_CERT_FILE" -fi -#+end_src ** ssh-agent I'm paranoid so I encrypt my SSH keys. @@ -123,52 +104,18 @@ if [[ ! -f "$SSH_AUTH_SOCK" ]]; then source "$SSH_AGENT_DIR/ssh-agent.env" >/dev/null fi #+end_src -** Guix settings -Enable extra profiles - -#+begin_src sh -if [ -z "$IS_ANDROID" ] && [ -z "$NO_GUIX" ] ; then - GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles - for i in $GUIX_EXTRA_PROFILES/*; do - profile=$i/$(basename "$i") - if [ -f "$profile"/etc/profile ]; then - GUIX_PROFILE="$profile" - . "$GUIX_PROFILE"/etc/profile - fi - if [ -d "$profile"/share/man ]; then - if command -v manpath >/dev/null 2>/dev/null; then - export MANPATH="${MANPATH:-$(manpath)}:$profile/share/man" - else - export MANPATH="${MANPATH}:$profile/share/man" - fi - fi - export XDG_DATA_DIRS="$XDG_DATA_DIRS:$profile/share" - unset profile - done -fi -#+end_src - -Set Jupyter config PATH. It defaults to readonly directory somewhere in Guix profile. +** Misc settings +Set Jupyter config PATH. I keep it from my Guix config where it defaulted to some readonly folder. #+begin_src sh export JUPYTER_CONFIG_DIR=$HOME/.config/jupyter #+end_src -Set a folder for my packages. -#+begin_src sh -export GUIX_PACKAGE_PATH=~/guix-packages -#+end_src - -Locale settings -#+begin_src sh -export GUIX_LOCPATH=$HOME/.guix-extra-profiles/console/console/lib/locale -#+end_src - Somehow LibreOffice doesn't work without the following: #+begin_src sh export GIO_EXTRA_MODULES="" #+end_src ** Other package managers -Using other package managers with Guix requires some extra work. +Using other package managers requires some extra work. Cask #+begin_src sh @@ -195,20 +142,6 @@ if [ -e /home/pavel/.nix-profile/etc/profile.d/nix.sh ] && [ -z "$NO_GUIX" ] ; t #+RESULTS: -Use Guix fontconfig. Necessary for nix apps -#+begin_src sh -if [ -d "$HOME/.guix-extra-profiles/desktop-misc" ] && [ -z "$NO_GUIX" ] ; then - export FONTCONFIG_PATH="$HOME/.guix-extra-profiles/desktop-misc/desktop-misc/etc/fonts" -fi -#+end_src - -Make nix apps visible to launchers: -#+begin_src sh -if [ -d "$HOME/.nix-profile" ] && [ -z "$NO_GUIX" ]; then - export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.nix-profile/share/applications" -fi -#+end_src - Gradle: #+begin_src sh if [ -d "$HOME/bin/gradle/gradle-9.0.0" ]; then @@ -216,90 +149,16 @@ if [ -d "$HOME/bin/gradle/gradle-9.0.0" ]; then fi #+end_src -*** npm -npm is especially cumbersome, for instance because by default it tries to install packages to =/gnu/store/=. - -In principle, one can set a prefix like this: -#+begin_src conf :tangle ~/._npmrc -prefix=/home/pavel/.npm-packages -#+end_src - -But I also want to use node from conda occasionally, where prefix is already set correctly. So instead of tangling the above to the =~/.npmrc= directly, I set an environment variable in the profile: - -#+begin_src sh -export NPM_CONFIG_USERCONFIG=$HOME/._npmrc -#+end_src - -The variable is unset in a script in [[file:Guix.org::*micromamba][Guix.org]]. - -Set PATH & MANPATH -#+begin_src sh -NPM_PACKAGES="${HOME}/.npm-packages" - -export PATH="$PATH:$NPM_PACKAGES/bin" -export MANPATH="${MANPATH:-$(manpath)}:$NPM_PACKAGES/share/man" -#+end_src ** XResources -| Guix dependency | +| Arch dependency | |-----------------| -| xrdb | +| xorg-xrdb | #+begin_src sh if [ -z "$IS_ANDROID" ]; then xrdb ~/.Xresources fi #+end_src -** OFF (OFF) Package manager paths -Turned off for now, because probably it won't be necessary in Guix. - -LaTeX -#+begin_src sh :tangle no -if [ -d "/usr/local/texlive/2020" ]; then - export MANPATH="/usr/local/texlive/2020/texmf-dist/doc/man:$MANPATH" - export INFOPATH="/usr/local/texlive/2020/texmf-dist/doc/info:$INFOPATH" - export PATH="/usr/local/texlive/2020/bin/x86_64-linux:$PATH" -fi -#+end_src - -Cargo (Rust) -#+begin_src sh :tangle no -if [ -d "$HOME/.cargo" ] ; then - export PATH="$HOME/.cargo/bin:$PATH" -fi -#+end_src - -RVM (Ruby) -#+begin_src sh :tangle no -if [ -d "$HOME/.rvm" ] ; then - export PATH="$PATH:$HOME/.rvm/bin" -fi -# if [ -d "$HOME/.gem" ]; then -# export PATH="$HOME/.gem/ruby/2.7.0/bin:$PATH" -# fi -#+end_src - -Go -#+begin_src sh :tangle no -if [ -d "$HOME/go" ] ; then - export PATH="$HOME/go/bin:$PATH" -fi -#+end_src - -ghcup (Haskell) -#+begin_src sh :tangle no -[ -f "/home/pavel/.ghcup/env" ] && source "/home/pavel/.ghcup/env" # ghcup-env -#+end_src - -Perl -#+begin_src sh :tangle no -if [ -d "$HOME/perl5" ] ; then - PATH="/home/pavel/perl5/bin${PATH:+:${PATH}}" - PERL5LIB="/home/pavel/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB; - PERL_LOCAL_LIB_ROOT="/home/pavel/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT; - PERL_MB_OPT="--install_base \"/home/pavel/perl5\""; export PERL_MB_OPT; - PERL_MM_OPT="INSTALL_BASE=/home/pavel/perl5"; export PERL_MM_OPT; -fi -#+end_src * Bash :PROPERTIES: :header-args:bash: :shebang "" :comments link @@ -315,7 +174,7 @@ fi :header-args+: :tangle ./.bashrc :END: -My =.bashrc=, which has pieces from the default one in Guix & Manjaro, as well some mine settings. +My =.bashrc=, which has pieces from the default one in Guix & Manjaro. *** Startup & environment Export 'SHELL' to child processes. Programs such as 'screen' honor it and otherwise use /bin/sh. @@ -348,20 +207,15 @@ if [[ -f "/etc/bashrc" ]]; then fi #+end_src -| Guix dependency | +| Arch dependency | |-----------------| -| xhost | +| xorg-xhost | Allow other users to access X server. Necessary for stuff like aw-watcher-window. #+begin_src bash xhost +local:root > /dev/null 2>&1 #+end_src -Set manpager to bat -#+begin_src bash -# export MANPAGER="sh -c 'sed -e s/.\\\\x08//g | bat -l man -p'" -#+end_src - [[https://codeberg.org/akib/emacs-eat][eat]] integration #+begin_src bash [ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/bash" @@ -529,7 +383,7 @@ init_yc () { :header-args+: :tangle ./.config/fish/config.fish :comments link :END: -| Guix dependency | Description | +| Arch dependency | Description | |-----------------+------------------------------------------| | fish | An alternative non POSIX-compliant shell | @@ -566,9 +420,9 @@ end #+end_src -| Guix dependency | -|-----------------| -| dt-colorscripts | +| Arch dependency | +|-------------------------| +| shell-color-scripts-git | Launch a random [[https://gitlab.com/dwt1/shell-color-scripts][DT's colorscript]] unless ran inside tmux or Emacs. #+begin_src fish @@ -653,16 +507,16 @@ end :PROPERTIES: :header-args+: :tangle ./.config/nu/config.toml :comments link :END: - | Guix dependency | + | Arch dependency | |-----------------| - | nushell-bin | + | nushell | A structured shell. I don't use it as of now, but perhaps one day. * Starship prompt -| Guix dependency | Description | +| Arch dependency | Description | |-----------------+---------------------| -| starship-bin | my prompt of choice | +| starship | my prompt of choice | [[https://starship.rs/][Starship]] is a nice cross-shell prompt, written in Rust. @@ -750,10 +604,10 @@ symbol = " " :PROPERTIES: :header-args+: :tangle ./.tmux.conf :END: -| Guix dependency | +| Arch dependency | |-----------------| | tmux | -| python-tmuxp | +| tmuxp | [[https://github.com/tmux/tmux][tmux]] is my terminal multiplexer of choice. @@ -805,7 +659,7 @@ Reload the config. bind r source-file ~/.tmux.conf #+end_src ** Copy to clipboard -| Guix dependency | +| Arch dependency | |-----------------| | xclip | @@ -849,7 +703,7 @@ source ~/.tmux.line.conf :header-args+: :tangle ./.config/alacritty/alacritty.yml :comments link :END: -| Guix dependency | +| Arch dependency | |-----------------| | alacritty | @@ -928,9 +782,9 @@ key_bindings: - { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } #+end_src * Bottom -| Guix dependency | Description | -|-----------------------+---------------------------------------------| -| bottom-bin | resource monitor | +| Arch dependency | Description | +|-----------------+------------------| +| bottom | resource monitor | [[https://github.com/ClementTsang/bottom][bottom]] is a TUI system monitor. @@ -941,7 +795,7 @@ See the [[https://github.com/ClementTsang/bottom/blob/master/sample_configs/defa (if (my/light-p) "default-light" "default") #+end_src -#+begin_src toml :tangle ~/.config/bottom/bottom.toml :noweb yes +#+begin_src toml :tangle .config/bottom/bottom.toml :noweb yes [flags] hide_table_gap = true # Remove space in tables color = "<>" @@ -955,50 +809,47 @@ columns = ["PID", "State", "Name", "CPU%", "Mem%", "R/s", "W/s", "User"] See [[https://docs.atuin.sh/configuration/config/][config reference]]. -#+begin_src toml :tangle ~/.config/atuin/config.toml +#+begin_src toml :tangle .config/atuin/config.toml update_check = false enter_accept = true keymap_mode = "vim-insert" #+end_src * Various console applications -| Guix dependency | Description | -|-----------------+---------------------------------------------| -| ncurses | Provides stuff like ~clear~ | -| exa | ~ls~ replacement, written in Rust | -| bat | ~cat~ clone with syntax highlighting | -| htop | Interactive process viewer | -| nethogs | A tool to group processed by used bandwidth | -| osync | rsync wrapper | -| neofetch | Fetch system info | -| fzf | fuzzy finder | -| p7zip | archiver | -| password-store | CLI password manager | -| zip | | -| unzip | | -| jmtpfs | A tool to mount MTP devices (e.g. Android) | -| tokei | Count lines of code | -| sshfs | Mount stuff over SSH | -| lftp | File transfer | -| git-lfs | | -| glibc-locales | | -| direnv | | -| jless-bin | JSON viewer | -| megacmd | mega.nz client | -| ncdu | disk usage analyzer | -| openssl | | -| aria2 | Download tool | -| man-db | | -| pv | | +| Arch dependency | Description | Disabled | +|-----------------+---------------------------------------------+----------| +| ncurses | Provides stuff like ~clear~ | | +| eza | ~ls~ replacement, written in Rust | | +| htop | Interactive process viewer | | +| nethogs | A tool to group processed by used bandwidth | | +| neofetch | Fetch system info | | +| fzf | fuzzy finder | | +| 7zip | archiver | | +| pass | CLI password manager | | +| zip | | | +| unzip | | | +| unrar | | | +| jmtpfs | A tool to mount MTP devices (e.g. Android) | t | +| tokei | Count lines of code | | +| sshfs | Mount stuff over SSH | | +| git-lfs | | | +| direnv | | | +| jless | JSON viewer | | +| megacmd | mega.nz client | | +| ncdu | disk usage analyzer | | +| openssl | | | +| aria2 | Download tool | | +| man-db | | | +| pv | | | ** ripgrep config Occasionally I can't exclude certain files from ripgrep via the VCS settings, so here is a simple config to ignore certain files globally. -#+begin_src text :tangle ~/.config/ripgrep/ripgreprc +#+begin_src text :tangle .config/ripgrep/ripgreprc --ignore-file=/home/pavel/.config/ripgrep/ripgrepignore #+end_src The ignore file: -#+begin_src text :tangle ~/.config/ripgrep/ripgrepignore +#+begin_src text :tangle .config/ripgrep/ripgrepignore *.ts.snap #+end_src @@ -1011,7 +862,7 @@ Usage: nt #+end_example -#+begin_src sh :tangle ~/bin/scripts/nt +#+begin_src sh :tangle bin/scripts/nt command="$@" if [ ! -z "$command" ]; then start_time="$(date -u +%s)" @@ -1045,7 +896,7 @@ Here's roughly what the script is doing: - Send a notification about the events above - Send a separate notification if there is a merge conflict -#+begin_src bash :tangle ~/bin/scripts/autocommit +#+begin_src bash :tangle bin/scripts/autocommit TIMEOUT_MIN=${TIMEOUT_MIN:-60} export DISPLAY=:0 @@ -1114,20 +965,19 @@ fi #+end_src =mcron= job: -#+begin_src scheme :tangle ~/.config/cron/autocommit.guile +#+begin_src scheme :tangle .config/cron/autocommit.guile (job "0 * * * *" "autocommit /home/pavel/30-39\\ Life/32\\ org-mode/") (job "0,15,30,45 * * * *" "autocommit ~/.password-store") #+end_src -* Guix settings +* Arch settings #+NAME: packages -#+begin_src emacs-lisp :tangle no :eval never-export -(my/format-guix-dependencies) +#+begin_src emacs-lisp :tangle no +(when (fboundp #'my/format-arch-dependencies) + (my/format-arch-dependencies)) #+end_src -#+begin_src scheme :tangle .config/guix/manifests/console.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/console.toml :noweb yes +<> #+end_src * Android notes SSH instructions: https://wiki.termux.com/wiki/Remote_Access diff --git a/Desktop.org b/Desktop.org index c7f1a57..faacadf 100644 --- a/Desktop.org +++ b/Desktop.org @@ -129,13 +129,13 @@ Xft.dpi: <> ** Themes A few programs I use to customize the apperance are listed below. -| Guix dependency | Description | -|-----------------------+-------------------------| -| matcha-theme | My preferred GTK theme | -| papirus-icon-theme | My preferred Icon theme | -| gnome-themes-standard | | -| xsettingsd | X11 settings daemon | -| gnome-themes-extra | | +| Arch dependency | Description | +|--------------------+-------------------------| +| gtk-engine-murrine | My preferred GTK theme | +| gtk-engines | | +| papirus-icon-theme | My preferred Icon theme | +| xsettingsd | X11 settings daemon | +| gnome-themes-extra | | [[https://github.com/derat/xsettingsd][xsettingsd]] is a lightweight daemon which configures X11 applications. It is launched with shepherd in the [[*Services][Services]] section. @@ -182,11 +182,11 @@ x-scheme-handler/tg=userapp-Telegram Desktop-7PVWF1.desktop; application/pdf=org.pwmt.zathura.desktop #+end_src ** Device-specific settings -| Guix dependency | Description | +| Arch dependency | Description | |-----------------+--------------------------------------------| -| xrandr | X11 CLI to RandR | -| xgamma | A tool to alter monitor's gamma correction | -| xinput | Configure input devices | +| xorg-xrandr | X11 CLI to RandR | +| xorg-xgamma | A tool to alter monitor's gamma correction | +| xorg-xinput | Configure input devices | Set screen layout & other params depending on hostname #+begin_src sh :tangle ~/bin/scripts/screen-layout @@ -214,9 +214,9 @@ References: *** Xsession First things first, Emacs has to be launched as a window manager. On a more conventional system I'd create a .desktop file in some system folder that can be seen by a login manager, but in the case of Guix it's a bit more complicated, because all such folders are not meant to be changed manually. -| Category | Guix dependency | +| Category | Arch dependency | |--------------+-----------------| -| desktop-misc | xinit | +| desktop-misc | xorg-xinit | | desktop-misc | xss-lock | However, GDM, the login manager that seems to be the default on Guix, launches =~/.xsession= on the startup if it's present, which is just fine for my purposes. @@ -778,9 +778,9 @@ By default, it also shows paths from =/gnu/store=, so there is a custom formatte Also, by default it tries to launch stuff with =gtk-launch=, which is in the =gtk+= package. -| Category | Guix dependency | -|--------------+-----------------| -| desktop-misc | gtk+:bin | +| Category | Arch dependency | Disabled | +|--------------+-----------------+----------| +| desktop-misc | gtk+:bin | t | *** password-store-completion [[https://github.com/SqrtMinusOne/password-store-completion][password-store-completion]] is another package of mine, inspired by [[https://github.com/carnager/rofi-pass][rofi-pass]]. @@ -1262,12 +1262,10 @@ And the EXWM config itself. :header-args+: :tangle ./.config/i3/config :END: -| Guix dependency | Disabled | +| Arch dependency | Disabled | |-----------------+----------| -| i3-gaps | | -| i3lock | true | - -=i3lock= is disabled because the global one has to be used. +| i3-wm | | +| i3lock | | [[https://i3wm.org/][i3wm]] is a manual tiling window manager, which is currently my window manager of choice. I've tried several alternatives, including [[https://xmonad.org/][xmonad]] & [[https://github.com/ch11ng/exwm][EXWM]], +but i3 seems to fit my workflow best+ and decided to switch to EXWM. This section is kept for a few cases when I need to be extra sure that my WM doesn't fail. @@ -1306,9 +1304,9 @@ bindsym $mod+Shift+r restart bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" #+end_src ** Managing windows -| Guix dependency | -|---------------------| -| rust-i3-switch-tabs | +| Guix dependency | Disabled | +|-----------------+----------| +| i3-switch-tabs | t | Some keybindings for managing windows. @@ -1552,9 +1550,9 @@ bindsym $mod+g mode "inner gaps" bindsym $mod+Shift+g mode "outer gaps" #+end_src ** Move & resize windows -| Guix dependency | -|-----------------------------| -| python-i3-balance-workspace | +| Arch dependency | Disabled | +|----------------------+----------| +| i3-balance-workspace | t | A more or less standard set of keybindings to move & resize floating windows. Just be careful to always make a way to return from these new modes, otherwise you'd end up in a rather precarious situation. @@ -1825,9 +1823,10 @@ exec "xmodmap ~/.Xmodmap" :header-args:conf-windows: :tangle ./.config/polybar/config :comments link :END: -| Category | Guix dependency | Description | -|-----------------+-----------------+-------------| -| desktop-polybar | polybar | statusbar | +| Category | Arch dependency | Description | +|-----------------+------------------+-------------| +| desktop-polybar | polybar | statusbar | +| desktop-polybar | noto-fonts-emoji | | [[https://github.com/polybar/polybar][Polybar]] is a nice-looking, WM-agnostic statusbar program. @@ -2608,11 +2607,11 @@ BEGIN{old_received='"$init_received"';old_sent='"$init_sent"'} #+end_src *** ipstack-vpn -| Category | Guix dependency | Description | -|-----------------+-----------------+-------------------------| -| desktop-polybar | bind:utils | Provides dig | -| desktop-polybar | curl | | -| desktop-polybar | jq | util to work with JSONs | +| Category | Arch dependency | Description | +|-----------------+-----------------+----------------------------| +| desktop-polybar | bind | Provides dig | +| desktop-polybar | curl | | +| desktop-polybar | jq | An util to work with JSONs | A module to get a country of the current IP and openvpn status. Uses [[https://ipstack.com/][ipstack]] API. @@ -2748,7 +2747,7 @@ format-foreground = ${colors.foreground} interval = 1200 #+end_src *** sun -| Category | Guix dependency | +| Category | Arch dependency | |-----------------+-----------------| | desktop-polybar | sunwait | @@ -2794,7 +2793,7 @@ interval = 60 *** aw-afk Prints out a current uptime and non-AFK time from [[https://github.com/ActivityWatch][ActivityWatch]] server -| Category | Guix dependency | +| Category | Arch dependency | |-----------------+-----------------| | desktop-polybar | dateutils | @@ -2976,7 +2975,7 @@ label-urgent-padding = 1 #+end_src * Rofi -| Category | Guix dependency | +| Category | Arch dependency | |--------------+-----------------| | desktop-rofi | rofi | @@ -3147,14 +3146,14 @@ if [[ ! -z $SELECTED ]]; then fi #+end_src *** Emojis -| Category | Guix dependency | +| Category | Arch dependency | |--------------+-----------------| -| desktop-rofi | python-rofimoji | +| desktop-rofi | rofimoji | *** pass -| Category | Guix dependency | +| Category | Arch dependency | |--------------+-----------------| | desktop-rofi | rofi-pass | -| desktop-rofi | xset | +| desktop-rofi | xorg-xset | A nice [[https://github.com/carnager/rofi-pass][pass frontend for Rofi]], which is even packaged for Guix. @@ -3165,7 +3164,7 @@ default_autotype='username :tab pass' clip=both #+end_src * Flameshot -| Guix dependency | +| Arch dependency | |-----------------| | flameshot | @@ -3217,7 +3216,7 @@ TYPE_TOGGLE_PANEL=Space TYPE_UNDO=Ctrl+Z #+end_src * dunst -| Guix dependency | +| Arch dependency | |-----------------| | dunst | | libnotify | @@ -3618,9 +3617,9 @@ Which I then can use to create the URL. : https://color.firefox.com/?theme=XQAAAAJFAQAAAAAAAABAqYhm849SCia3ftKEGccwS-xMDPsqcRvjh8JMhYPDf9_kNjVRdqrKsHr5AamG1FlOJ8DH_BqRXLhVF02YoR2FXVUIEYoXiV-3q19EVo-NqESyeWWEIwj-0QxR3X-JxWYJLJYc6tAeNGGDXNNrM0pNWpwesvR43yXL_fJfr9Q919y2QwP0cK7ZXO1lRou4HkpwWW4LWdO3V6ox_BN9yA * keynav -| Guix dependency | -|-----------------| -| keynav | +| Arch dependency | Disabled | +|-----------------+----------| +| keynav | t | | Type | Note | |---------+--------------------------------| @@ -3697,7 +3696,7 @@ fade-exclude = [ :header-args+: :tangle ./.config/picom.conf :END: -| Guix dependency | +| Arch dependency | |-----------------| | picom | @@ -3792,7 +3791,7 @@ wintypes: }; #+end_src * Zathura -| Category | Guix dependency | +| Category | Arch dependency | |----------+-------------------| | office | zathura | | office | zathura-ps | @@ -4208,126 +4207,127 @@ c.tabs.favicons.scale = 1 This section generates manifests for various desktop software that I'm using. ** Browsers -| Category | Guix dependency | -|----------+--------------------| -| browsers | ungoogled-chromium | -| browsers | firefox | +| Category | Arch dependency | +|----------+------------------------| +| browsers | ungoogled-chromium-bin | +| browsers | firefox | ** Office & Multimedia -| Category | Guix dependency | +| Category | Arch dependency | |----------+-----------------| -| office | libreoffice | +| office | libreoffice-fresh | | office | gimp | | office | krita | | office | ffmpeg | | office | kdenlive | | office | inkscape | | office | okular | -| office | obs | +| office | obs-studio | ** LaTeX -| Category | Guix dependency | -|----------+-------------------------------| -| latex | texlive | -| latex | texlab-bin | -| latex | biber | -| latex | python-pygments | -| latex | font-microsoft-web-core-fonts | +| Category | Arch dependency | Disabled | +|----------+--------------------------+----------| +| latex | texlive-basic | | +| latex | texlive-bibtexextra | | +| latex | texlive-binextra | | +| latex | texlive-fontsextra | t | +| latex | texlive-fontutils | | +| latex | texlive-formatsextra | | +| latex | texlive-games | | +| latex | texlive-humanities | | +| latex | texlive-latex | | +| latex | texlive-latexextra | | +| latex | texlive-latexrecommended | | +| latex | texlive-mathscience | | +| latex | texlive-metapost | | +| latex | texlive-pictures | | +| latex | texlive-plaingeneric | | +| latex | texlive-pstricks | | +| latex | texlive-publishers | | +| latex | texlive-xetex | | +| latex | texlab | | +| latex | biber | | +| latex | python-pygments | | +| latex | ttf-ms-fonts | | ** Dev -| Category | Guix dependency | Disabled | +| Category | Arch dependency | Disabled | |----------+-------------------+----------| | dev | micromamba-bin | | -| dev | pandoc | | -| dev | docker-compose | | +| dev | pandoc-cli | | +| dev | docker | | | dev | postgresql | | | dev | virt-manager | | -| dev | dnsmasq | | +| dev | libvirt | | | dev | git-filter-repo | | -| dev | node | | -| dev | openjdk:jdk | | +| dev | nodejs | | +| dev | jdk21-openjdk | | | dev | go | | | dev | gopls | | -| dev | pkg-config | | -| dev | gcc-toolchain | | +| dev | pkgconf | | +| dev | gcc | | +| dev | cmake | | | dev | lua | | | dev | libfaketime | | -| dev | hugo-extended | | +| dev | hugo | | | dev | make | | -| dev | sbcl | t | | dev | git-lfs | | -| dev | mysql | t | | dev | gource | | | dev | php | | | dev | python | | +| dev | python-pip | | | dev | python-virtualenv | | -| dev | leiningen | | +| dev | python-build | | | dev | socat | | -| dev | wireshark | | -| dev | python-chess | | -| dev | python-cairosvg | | +| dev | wireshark-qt | | +| dev | git | | +| dev | rust | | ** Manifests #+NAME: packages #+begin_src emacs-lisp :tangle no :var category="" -(my/format-guix-dependencies category) +(my/format-arch-dependencies category) #+end_src Dev -#+begin_src scheme :tangle .config/guix/manifests/dev.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/dev.toml :noweb yes +<> #+end_src Browsers -#+begin_src scheme :tangle .config/guix/manifests/browsers.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/browsers.toml :noweb yes +<> #+end_src Music -#+begin_src scheme :tangle .config/guix/manifests/music.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/music.toml :noweb yes +<> #+end_src Office -#+begin_src scheme :tangle .config/guix/manifests/office.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/office.toml :noweb yes +<> #+end_src LaTeX -#+begin_src scheme :tangle .config/guix/manifests/latex.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/latex.toml :noweb yes +<> #+end_src Desktop Misc -#+begin_src scheme :tangle .config/guix/manifests/desktop-misc.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/desktop-misc.toml :noweb yes +<> #+end_src Desktop polybar -#+begin_src scheme :tangle .config/guix/manifests/desktop-polybar.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/desktop-polybar.toml :noweb yes +<> #+end_src Desktop rofi -#+begin_src scheme :tangle .config/guix/manifests/desktop-rofi.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/desktop-rofi.toml :noweb yes +<> #+end_src ** Flatpak A lot of proprietary desktop applications can be installed most easily with flatpak & flathub. -| Guix dependency | +| Arch dependency | |--------------------| | flatpak | | xdg-desktop-portal | @@ -4348,8 +4348,6 @@ Packages to install: | Flatpak dependency | Channel | |------------------------------+---------| | com.github.wwmm.pulseeffects | flathub | -| com.discordapp.Discord | flathub | -| com.jetbrains.DataGrip | flathub | | chat.rocket.RocketChat | flathub | #+begin_src emacs-lisp :var table=flatpak-deps :wrap example @@ -4362,50 +4360,21 @@ Packages to install: #+RESULTS: #+begin_example flatpak install -y --user flathub com.github.wwmm.pulseeffects -flatpak install -y --user flathub com.discordapp.Discord -flatpak install -y --user flathub us.zoom.Zoom -flatpak install -y --user flathub com.slack.Slack +flatpak install -y --user flathub chat.rocket.RocketChat #+end_example -** Nix -| Type | Description | -|------+--------------------| -| TODO | Make nix manifest? | - -I probably should've used nix, as almost every program I packaged so far exists in the Nix repo. - -But it's easy enough to use Nix on Guix. -#+begin_src conf :tangle ~/.nix-channels -https://nixos.org/channels/nixpkgs-unstable nixpkgs -#+end_src - -Don't forget to run the following after the first installation: -#+begin_src sh -nix-channel --update -#+end_src - -Installing packages: -#+begin_src -nix-env -i slack -#+end_src * Services :PROPERTIES: :header-args+: :tangle ~/.config/shepherd/init.scm :END: -[[https://www.gnu.org/software/shepherd/manual/html_node/index.html][GNU Shepherd]] is a service management system for GNU Guix. - -I previously used supervisor, but shepherd also seems pretty capable. - -| Guix dependency | -|-----------------| -| shepherd | +[[https://www.gnu.org/software/shepherd/manual/html_node/index.html][GNU Shepherd]] is a service management system for GNU Guix. I'll probably migrate to systemd since I'm not on Guix anymore. ** Music -| Category | Guix dependency | +| Category | Arch dependency | |----------+-----------------| | music | mpd | | music | ncmpcpp | | music | picard | -| music | mpd-mpc | +| music | mpc | | music | shntool | | music | cuetools | | music | flac | @@ -4454,7 +4423,7 @@ MPD watcher ** ActivityWatch [[https://activitywatch.net/][ActivityWatch]] is a FOSS time tracker. It tracks screen and application usage and has integrations with browsers, Emacs, etc. -| Guix dependency | +| Arch dependency | |-------------------| | activitywatch-bin | @@ -4543,7 +4512,7 @@ Launch an authentication agent. Necessary for stuff like =pkexec=. I suspect I'm (make #:provides '(polkit-gnome) #:respawn? #t - #:start (make-forkexec-constructor '("/home/pavel/.guix-extra-profiles/desktop-misc/desktop-misc/libexec/polkit-gnome-authentication-agent-1")) + #:start (make-forkexec-constructor '("/lib/polkit-gnome/polkit-gnome-authentication-agent-1")) #:stop (make-kill-destructor))) #+end_src ** Xmodmap @@ -4586,11 +4555,6 @@ Run my [[file:Guix.org::*OpenVPN][OpenVPN setup]]. Not lauching this automatiall ** opensnitch [[https://github.com/evilsocket/opensnitch][opensnitch]] is a linux firewall. -Install it via nix: -#+begin_src bash :tangle no -nix-env -I opensnitchd opensnitch-ui -#+end_src - =sudoers= has to be modified this to work. #+begin_src scheme (define opensnitchd @@ -4670,45 +4634,40 @@ Run services ;; opensnitch-ui )) #+end_src -* Guix settings +* Acch settings Other desktop programs I use are listed below. -| Category | Guix dependency | Description | +| Category | Arch dependency | Description | |--------------+------------------------+-------------------------------------------| -| desktop-misc | xprop | Tool to display properties of X windows | +| desktop-misc | xorg-xprop | Tool to display properties of X windows | | desktop-misc | arandr | GUI to xrandr | | desktop-misc | light | Control screen brightness | -| desktop-misc | ponymix | Control PulseAudio CLI | | desktop-misc | pavucontrol | Control PulseAudio GUI | | desktop-misc | network-manager-applet | Applet to manage network connections | -| desktop-misc | xmodmap | Program to modify keybindings on X server | +| desktop-misc | xorg-xmodmap | Program to modify keybindings on X server | | desktop-misc | fontconfig | | | desktop-misc | polkit-gnome | Polkit authentication agent | | desktop-misc | feh | Image viewer. Used to set background | -| desktop-misc | geeqie | Image viewer | | desktop-misc | copyq | Clipboard manager | | desktop-misc | thunar | My preferred GUI file manager | | desktop-misc | xdg-utils | gives xdg-open and stuff | | desktop-misc | gnome-font-viewer | view fonts | | desktop-misc | qbittorrent | torrent client | -| desktop-misc | anydesk | Remote desktop software | +| desktop-misc | anydesk-bin | Remote desktop software | | desktop-misc | gnome-disk-utility | Manage disks | | desktop-misc | gparted | Manage partitions | -| desktop-misc | xev | Test input | +| desktop-misc | xorg-xev | Test input | | desktop-misc | bluez | Provides bluetoothctl | | desktop-misc | telegram-desktop | | -| desktop-misc | font-google-noto-emoji | | +| desktop-misc | noto-fonts-emoji | | | desktop-misc | remmina | | | desktop-misc | android-file-transfer | | -| desktop-misc | mcron | | #+NAME: packages #+begin_src emacs-lisp :tangle no -(my/format-guix-dependencies) +(my/format-arch-dependencies) #+end_src -#+begin_src scheme :tangle .config/guix/manifests/desktop.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/desktop.toml :noweb yes +<> #+end_src diff --git a/Emacs.org b/Emacs.org index 79a74b1..759716b 100644 --- a/Emacs.org +++ b/Emacs.org @@ -85,6 +85,11 @@ First things first, lexical binding. ;;; -*- lexical-binding: t -*- #+end_src +Adding =emacs= to the package list. +| Arch dependency | +|-----------------| +| emacs | + ** straight.el Straight.el is my Emacs package manager of choice. The following is its bootstrap script. @@ -1363,7 +1368,7 @@ References: I also want to call =xkb-switch= in EXWM buffers with the same keybindig. -| Guix dependency | +| Arch dependency | |-----------------| | xkb-switch | @@ -1562,9 +1567,9 @@ A few CLI alternatives: :commands (git-timemachine)) #+end_src -| Guix dependency | +| Arch dependency | |-----------------| -| difftastic-bin | +| difftastic | [[https://github.com/pkryger/difftastic.el][difftastic.el]] is a wrapper package for [[https://difftastic.wilfred.me.uk/][difftastic]]. #+begin_src emacs-lisp @@ -2081,7 +2086,7 @@ References: :MODULE_NAME: wakatime :header-args:emacs-lisp: :tangle /home/pavel/.emacs.d/modules/sqrt-wakatime.el :comments links :END: -Before I figure out how to package this for Guix: +Before I figure out how to package this for +Guix+ Arch: - Clone [[https://github.com/wakatime/wakatime-cli][the repo]] - Run ~go build~ - Copy the binary to the =~/bin= folder @@ -4152,7 +4157,7 @@ Section snippets. The code turned out to be more complicated than just writing t :straight t) #+end_src *** PlantUML -| Guix dependency | +| Arch dependency | |-----------------| | plantuml | @@ -4462,9 +4467,9 @@ Automatically creates & manages virtualenvs and stores data in =Pipfile= and =Pi *** OFF (OFF) yapf [[https://github.com/google/yapf][yapf]] is a formatter for Python files. -| Guix dependency | +| Arch dependency | |-----------------| -| python-yapf | +| yapf | References: - [[https://github.com/google/yapf][yapf repo]] @@ -4488,7 +4493,7 @@ column_limit = 80 *** black [[https://github.com/psf/black][black]] is a formatter for Python files. -| Guix dependency | +| Arch dependency | |-----------------| | python-black | @@ -4503,7 +4508,7 @@ column_limit = 80 *** isort [[https://github.com/PyCQA/isort][isort]] is a Python package to sort Python imports. -| Guix dependency | +| Arch dependency | |-----------------| | python-isort | @@ -4626,7 +4631,7 @@ To fix that, I've modified the following function in the =python-pytest= package *** code-cells Support for text with magic comments. -| Guix dependency | Disabled | +| Arch dependency | Disabled | |-----------------+----------| | python-jupytext | t | @@ -4899,7 +4904,7 @@ Emacs integration for [[http://gnuplot.info/][gnuplot]]. :header-args:emacs-lisp: :tangle /home/pavel/.emacs.d/modules/sqrt-misc-programming.el :comments links :END: *** C# -| Guix dependencies | Disabled | +| Arch dependencies | Disabled | |-------------------+----------| | omnisharp | t | | dotnet | t | @@ -7143,9 +7148,8 @@ Some resources that helped me along the way (and still help): - [[https://www.youtube.com/watch?v=-TpWahIzueg][System Crafters Live! - Can You Apply Zettelkasten in Emacs?]] **** Basic package configuration -| Guix dependency | Disabled | +| Arch dependency | Disabled | |-----------------------+----------| -| emacs-emacsql-sqlite3 | t | | graphviz | | About installing the package on Guix (*CREDIT*: thanks @Ashraz on the SystemCrafters discord) @@ -8053,10 +8057,10 @@ No idea why, but somehow the exported file uses english words if there isn't =:d ** System configuration Functions related to literate configuration. -*** Tables for Guix Dependencies -This section deals with using [[https://guix.gnu.org/en/cookbook/en/html_node/Advanced-package-management.html#Advanced-package-management][using profiles in GNU Guix]]. +*** Tables for Arch Dependencies +I used to use [[https://guix.gnu.org/en/cookbook/en/html_node/Advanced-package-management.html#Advanced-package-management][profiles in GNU Guix]]. Now that I've switched to [[https://github.com/ripytide/metapac][metapac]], I want to keep the same approach. -A "profile" in Guix is a way to group package installations. For instance, I have a "music" profile that has software like [[https://www.musicpd.org/][MPD]], [[https://github.com/ncmpcpp/ncmpcpp][ncmpcpp]] that I'm still occasionally using because of its tag editor, etc. Corresponding to that profile, there's a manifest named =music.scm= that looks like this: +A "profile" (metapac calls them "groups") is a way to group package installations. For instance, I have a "music" profile that has software like [[https://www.musicpd.org/][MPD]], [[https://github.com/ncmpcpp/ncmpcpp][ncmpcpp]] that I'm still occasionally using because of its tag editor, etc. In Guix, corresponding to that profile, there's a manifest named =music.scm= that looks like this: #+begin_src scheme (specifications->manifest '( @@ -8070,12 +8074,12 @@ A "profile" in Guix is a way to group package installations. For instance, I hav "mpd")) #+end_src -I could generate this file with =org-babel= as any other, but that is often not so convenient. For example, I have a [[https://github.com/polybar/polybar][polybar]] module that uses [[https://github.com/risacher/sunwait][sunwait]] to show sunset and sunrise times, and ideally, I want to declare =sunwait= to be in the "desktop-polybar" profile in the same section that has the polybar module definition and the bash script. +Metapac stores the same info in TOML. I could generate this file with =org-babel= as any other, but that is often not so convenient. For example, I have a [[https://github.com/polybar/polybar][polybar]] module that uses [[https://github.com/risacher/sunwait][sunwait]] to show sunset and sunrise times, and ideally, I want to declare =sunwait= to be in the "desktop-polybar" profile in the same section that has the polybar module definition and the bash script. So here's an approach I came up with. The relevant section of the config looks like this: #+begin_example ,*** sun -| Category | Guix dependency | +| Category | Arch dependency | |-----------------+-----------------| | desktop-polybar | sunwait | @@ -8090,17 +8094,18 @@ Prints out the time of sunrise/sunset. Uses [[https://github.com/risacher/sunwai ,#+end_src #+end_example -So =sunwait= is declared in an Org table with =Guix dependency= in the header. Such tables are spread through my configuration files. +So =sunwait= is declared in an Org table with =Arch dependency= in the header. Such tables are spread through my configuration files. Thus I made a function that extracts packages from all such tables from the current Org buffer. The rules are as follows: -- If a column name matches =[G|g]uix.*dep=, its contents are added to the result. +- If a column name matches =[A|a]rch.*dep=, its contents are added to the result. - If =CATEGORY= is passed, a column with name =[C|c]ategory= is used to filter results. That way, one Org file can be used to produce multiple manifests. - If =CATEGORY= is not passed, entries with the non-empty category are filtered out - If there is a =[D|d]isabled= column, entries that have a non-empty value in this column are filtered out. +- If there is a =[S|s]ource= column, it selects the backend for metapac, which is =arch= by default. And here is the implementation: #+begin_src emacs-lisp :noweb-ref guix-tables -(defun my/extract-guix-dependencies (&optional category) +(defun my/extract-arch-dependencies (&optional category) (let ((dependencies '())) (org-table-map-tables (lambda () @@ -8113,7 +8118,7 @@ And here is the implementation: nil (mapcar #'substring-no-properties (nth 0 table)) :test (lambda (_ elem) - (string-match-p "[G|g]uix.*dep" elem)))) + (string-match-p "[A|a]rch.*dep" elem)))) (category-name-index (cl-position nil @@ -8125,7 +8130,13 @@ And here is the implementation: nil (mapcar #'substring-no-properties (nth 0 table)) :test (lambda (_ elem) - (string-match-p ".*[D|d]isabled.*" elem))))) + (string-match-p ".*[D|d]isabled.*" elem)))) + (source-index + (cl-position + nil + (mapcar #'substring-no-properties (nth 0 table)) + :test (lambda (_ elem) + (string-match-p ".*[S|s]ource.*" elem))))) (when dep-name-index (dolist (elem (cdr table)) (when @@ -8145,47 +8156,48 @@ And here is the implementation: (or (not disabled-name-index) (string-empty-p (nth disabled-name-index elem)))) - (add-to-list - 'dependencies - (substring-no-properties (nth dep-name-index elem))))))))) + (let ((source + (or + (when (and source-index + (not (string-empty-p (nth source-index elem)))) + (substring-no-properties + (nth source-index elem))) + "arch"))) + (push + (substring-no-properties (nth dep-name-index elem)) + (alist-get source dependencies nil nil #'equal))))))))) dependencies)) #+end_src -To make it work in the configuration, it is necessary to format the list so that Scheme could read it: +To make it work in the configuration, it is necessary to format the list in the TOML format. Unfortunately, there doesn't seems to be a TOML generator for Elisp. #+begin_src emacs-lisp :noweb-ref guix-tables -(defun my/format-guix-dependencies (&optional category) - (mapconcat - (lambda (e) (concat "\"" e "\"")) - (my/extract-guix-dependencies category) - "\n")) +(defun my/format-arch-dependencies (&optional category) + (let ((data (my/extract-arch-dependencies category))) + (with-temp-buffer + (cl-loop for (backend . packages) in data + do (insert (format "%s = [\n" backend) + (mapconcat (lambda (package) + (format "\"%s\"," package)) + packages + "\n") + "]")) + (buffer-string)))) #+end_src And we need an Org snippet such as this: #+begin_example #+NAME: packages #+begin_src emacs-lisp :tangle no :var category="" -(my/format-guix-dependencies category) +(my/format-arch-dependencies category) #+end_src #+end_example Now, creating a manifest, for example, for the =desktop-polybar= profile is as simple as: #+begin_example -#+begin_src scheme :tangle ~/.config/guix/manifests/desktop-polybar.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle ~/.config/metapac/groups/desktop-polybar.toml :noweb yes +<> #+end_src #+end_example - -There's a newline symbol between "(" and =<>= because whenever a noweb expression expands into multiple lines, for each new line noweb duplicates contents between the start of the line and the start of the expression. - -One reason this is so is to support languages where indentation is a part of the syntax, for instance, Python: -#+begin_src python -class TestClass: - <> -#+end_src - -So every line of =<>= will be indented appropriately. In our case though, it is a minor inconvenience to be aware of. *** Noweb evaluations One note is that by default running these commands will require the user to confirm evaluation of each code block. To avoid that, I set =org-confirm-babel-evaluate= to =nil=: @@ -8196,6 +8208,7 @@ One note is that by default running these commands will require the user to conf '("~/Emacs.org" "~/Desktop.org" "~/Console.org" + "~/Arch.org" "~/Guix.org" "~/Mail.org"))) @@ -9739,7 +9752,7 @@ Now, a function to add a YouTube link with metadata from elfeed to EMMS. *** rdrview [[https://github.com/eafer/rdrview][rdrview]] is a command-line tool to strip webpages from clutter, extracting only parts related to the actual content. It's a standalone port of the corresponding feature of Firefox, called [[https://support.mozilla.org/en-US/kb/firefox-reader-view-clutter-free-web-pages][Reader View]]. -| Guix dependency | +| Arch dependency | |-----------------| | rdrview | @@ -10086,7 +10099,7 @@ However, sans the pictures issue, for certain sites like Wikipedia this is usabl **** Getting subtitles Finally, let's get to transcripts. -| Guix dependency | +| Arch dependency | |-------------------------------| | python-youtube-transcript-api | @@ -10394,7 +10407,7 @@ After all this is done, run =M-x emms-cache-set-from-mpd-all= to set cache from :PROPERTIES: :header-args:emacs-lisp: :tangle no :noweb-ref emms-mpv-setup :END: -| Guix dependency | +| Arch dependency | |-----------------| | mpv | | yt-dlp | @@ -11339,16 +11352,14 @@ Or you can load up Element for a moment to see what the mention was, if that's e :END: [[https://github.com/zevlg/telega.el/][telega.el]] is a Telegam client for Emacs. -| Guix dependency | -|--------------------| -| emacs-telega-sever | -| font-gnu-unifont | -| font-gnu-freefont | +| Arch dependency | Disabled | +|--------------------+----------| +| emacs-telega-sever | t | +| ttf-unifont | | +| gnu-free-fonts | | #+begin_src emacs-lisp (use-package telega - ;; :straight (:type built-in) - ;; For now emacs-telega-server is compatible with the latest telega.el :straight t :commands (telega) :init @@ -11888,7 +11899,7 @@ I previously used [[https://github.com/ggerganov/whisper.cpp][whisper.cpp]] by G One disadvantage is that it doesn't produce human-readable output by default, so I make my own. -| Guix dependency | Disabled | +| Arch dependency | Disabled | |-----------------+----------| | whisper-cpp | t | @@ -13279,7 +13290,7 @@ My package for doing Pomodoro timer. *** hledger [[hledger.org/][hledger]] is a plain-text double-entry accounting software. I use it for managing my personal finances, and thus far it's great. -| Guix dependency | +| Arch dependency | |-----------------| | hledger | @@ -13818,22 +13829,19 @@ My text editor isn't old enough. :straight (:host github :repo "ryanprior/ed-mode") :commands (ed)) #+end_src -* Guix settings -| Guix dependency | Description | +* Arch settings +| Arch dependency | Description | |---------------------+-------------------------------| -| emacs-vterm | The vterm package | | ripgrep | A recursive search tool | -| the-silver-searcher | Another recursive search tool | +| the_silver_searcher | Another recursive search tool | | texinfo | | #+NAME: packages #+begin_src emacs-lisp :tangle no -(when (fboundp #'my/format-guix-dependencies) - (my/format-guix-dependencies)) +(when (fboundp #'my/format-arch-dependencies) + (my/format-arch-dependencies)) #+end_src -#+begin_src scheme :tangle .config/guix/manifests/emacs.scm :noweb yes -(specifications->manifest - '("emacs" - <>)) +#+begin_src scheme :tangle .config/metapac/groups/emacs.toml :noweb yes +<> #+end_src diff --git a/Mail.org b/Mail.org index d91adad..39ed38b 100644 --- a/Mail.org +++ b/Mail.org @@ -19,9 +19,9 @@ References: - [[https://sqrtminusone.xyz/posts/2021-02-27-gmail/][My post]] about email configuration. I wrote it some time ago, but the general idea remains. * Lieer -| Guix dependency | +| Arch dependency | |-----------------| -| python-lieer | +| lieer-git | Lieer is a program to link up Gmail and notmuch. Basically, it downloads mail from Gmail via API, stores them in Maildir, and synchronizes labels with notmuch. @@ -40,7 +40,13 @@ gmi set --ignore-tags-local new Running =gmi sync= in the required directory performs the synchronization. The first sync takes a while, the subsequent syncs are pretty fast. * DavMail -[[davmail.sourceforge.net][DavMail]] is a gateway between MS Exchange and the rest of the world, which uses IMAP/SMTP/LDAP/etc. As I have one corporate MS Exchange address, this is just the program I need. As of yet, it isn't packaged for Guix, but it's easy enough to download. +[[davmail.sourceforge.net][DavMail]] is a gateway between MS Exchange and the rest of the world, which uses IMAP/SMTP/LDAP/etc. As I have one corporate MS Exchange address, this is just the program I need. + +Edit [2025-11-11 Tue]: We've moved from MS Exhange, disabling this. + +| Arch dependency | Disabled | +|-----------------+----------| +| davmail | t | It has a GUI mode, but I prefer headless config. #+begin_src conf-unix :tangle ~/bin/davmail-6.0.0-3375/davmail.properties @@ -68,7 +74,7 @@ cd $HOME/bin/davmail-6.0.0-3375 Shepherd service is defined in [[file:Desktop.org::*Davmail][Desktop.org]]. * OfflineIMAP -| Guix dependency | +| Arch dependency | |-----------------| | offlineimap | @@ -129,7 +135,7 @@ remoteport = 993 cert_fingerprint = 416b1f7f18d68a65f5e75bb1af5d65ea5e20739e #+end_src * Notmuch -| Guix dependency | +| Arch dependency | |-----------------| | notmuch | | parallel | @@ -357,7 +363,7 @@ The script is ran via GNU Mcron every 5 minutes. (job "*/5 * * * * " "~/bin/scripts/check-email") #+end_src * MSMTP -| Guix dependency | +| Arch dependency | |-----------------| | msmtp | @@ -405,9 +411,9 @@ msmtp --serverinfo --tls --tls-certcheck=off -a pvkorytov :header-args+: :tangle ~/.emacs.d/mail.el :END: -| Guix dependency | +| Arch dependency | |-----------------| -| emacs-notmuch | +| notmuch | Finally, Emacs configuration. Let's start with some variables: #+begin_src emacs-lisp @@ -415,6 +421,8 @@ Finally, Emacs configuration. Let's start with some variables: (setq user-full-name "Pavel Korytov") #+end_src +TODO fix for Arch + Then, the problem with my Guix setup is that Emacs by default doesn't see the elisp files of notmuch, so here is a small workaround: #+begin_src emacs-lisp (let ((dir "/home/pavel/.guix-extra-profiles/mail/mail/share/emacs/site-lisp")) @@ -693,14 +701,12 @@ application/postscript ; zathura %s text/html; firefox %s #+end_src -* Guix settings +* Arch settings #+NAME: packages #+begin_src emacs-lisp :tangle no -(my/format-guix-dependencies) +(my/format-arch-dependencies) #+end_src -#+begin_src scheme :tangle .config/guix/manifests/mail.scm :noweb yes -(specifications->manifest - '( - <>)) +#+begin_src scheme :tangle .config/metapac/groups/mail.toml :noweb yes +<> #+end_src diff --git a/bin/polybar/c-g.sh b/bin/polybar/c-g.sh new file mode 100755 index 0000000..34bd8f8 --- /dev/null +++ b/bin/polybar/c-g.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# [[file:../../Desktop.org::*C-g][C-g:1]] +EMACS_FLAG="-l /home/pavel/.emacs.d/desktop.el" +EXCLUDE_PATTERN="dbus-launch --exit-with-session emacs" +EMACS_PIDS=$(pgrep -f "emacs.*${EMACS_FLAG}") +SIGNAL_SENT=false + +for PID in $EMACS_PIDS; d o + CMDLINE=$(ps -p "$PID" -o args=) + + if [[ "$CMDLINE" == *"$EXCLUDE_PATTERN"* ]]; then + continue + fi + + kill -SIGUSR2 "$PID" 2>/dev/null + + if [ $? -eq 0 ]; then + echo "Sent SIGUSR2 to Emacs (PID: $PID)" + SIGNAL_SENT=true + else + echo "Failed to send SIGUSR2 to Emacs (PID: $PID)" + fi +done + +if [ "$SIGNAL_SENT" = false ]; then + echo "Emacs process not found or already handled." + exit 1 +fi + +exit 0 +# C-g:1 ends here From 9de821952043c90c6618c422bb7e48dfa91f1fd4 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 12 Nov 2025 17:33:00 +0300 Subject: [PATCH 02/18] emacs: update packages --- .config/yadm/hooks/run-tangle.el | 41 ++++++++++++++++++------- .emacs.d/modules/sqrt-general-config.el | 2 +- .emacs.d/modules/sqrt-general-org.el | 34 ++++++++++---------- .emacs.d/modules/sqrt-general-ui.el | 20 +++++++----- .emacs.d/modules/sqrt-tree-sitter.el | 1 + Arch.org | 18 +++++++++++ Emacs.org | 30 ++++++++++++------ 7 files changed, 100 insertions(+), 46 deletions(-) diff --git a/.config/yadm/hooks/run-tangle.el b/.config/yadm/hooks/run-tangle.el index a19b62d..3519ace 100644 --- a/.config/yadm/hooks/run-tangle.el +++ b/.config/yadm/hooks/run-tangle.el @@ -8,7 +8,7 @@ ;; Do not ask to confirm evaluations (setq org-confirm-babel-evaluate nil) -(defun my/extract-guix-dependencies (&optional category) +(defun my/extract-arch-dependencies (&optional category) (let ((dependencies '())) (org-table-map-tables (lambda () @@ -21,7 +21,7 @@ nil (mapcar #'substring-no-properties (nth 0 table)) :test (lambda (_ elem) - (string-match-p "[G|g]uix.*dep" elem)))) + (string-match-p "[A|a]rch.*dep" elem)))) (category-name-index (cl-position nil @@ -33,7 +33,13 @@ nil (mapcar #'substring-no-properties (nth 0 table)) :test (lambda (_ elem) - (string-match-p ".*[D|d]isabled.*" elem))))) + (string-match-p ".*[D|d]isabled.*" elem)))) + (source-index + (cl-position + nil + (mapcar #'substring-no-properties (nth 0 table)) + :test (lambda (_ elem) + (string-match-p ".*[S|s]ource.*" elem))))) (when dep-name-index (dolist (elem (cdr table)) (when @@ -53,15 +59,28 @@ (or (not disabled-name-index) (string-empty-p (nth disabled-name-index elem)))) - (add-to-list - 'dependencies - (substring-no-properties (nth dep-name-index elem))))))))) + (let ((source + (or + (when (and source-index + (not (string-empty-p (nth source-index elem)))) + (substring-no-properties + (nth source-index elem))) + "arch"))) + (push + (substring-no-properties (nth dep-name-index elem)) + (alist-get source dependencies nil nil #'equal))))))))) dependencies)) -(defun my/format-guix-dependencies (&optional category) - (mapconcat - (lambda (e) (concat "\"" e "\"")) - (my/extract-guix-dependencies category) - "\n")) +(defun my/format-arch-dependencies (&optional category) + (let ((data (my/extract-arch-dependencies category))) + (with-temp-buffer + (cl-loop for (backend . packages) in data + do (insert (format "%s = [\n" backend) + (mapconcat (lambda (package) + (format "\"%s\"," package)) + packages + "\n") + "]")) + (buffer-string)))) ;; A few dummy modes to avoid being prompted for comment systax (define-derived-mode fish-mode prog-mode "Fish" diff --git a/.emacs.d/modules/sqrt-general-config.el b/.emacs.d/modules/sqrt-general-config.el index 430d063..f0727f5 100644 --- a/.emacs.d/modules/sqrt-general-config.el +++ b/.emacs.d/modules/sqrt-general-config.el @@ -190,7 +190,7 @@ "m" 'magit "M" 'magit-file-dispatch) :config - (require 'forge) + ;; (require 'forge) (setq magit-blame-styles '((headings (heading-format . "%-20a %C %s\n")) diff --git a/.emacs.d/modules/sqrt-general-org.el b/.emacs.d/modules/sqrt-general-org.el index 07953cb..24edfd0 100644 --- a/.emacs.d/modules/sqrt-general-org.el +++ b/.emacs.d/modules/sqrt-general-org.el @@ -406,27 +406,28 @@ With ARG, repeats or can move backward if negative." (or (not disabled-name-index) (string-empty-p (nth disabled-name-index elem)))) - (add-to-list - 'dependencies - (cons - (substring-no-properties (nth dep-name-index elem)) - (when source-index - (let ((source (nth source-index elem))) - (unless (string-empty-p source) - source))))))))))) + (let ((source + (or + (when (and source-index + (not (string-empty-p (nth source-index elem)))) + (substring-no-properties + (nth source-index elem))) + "arch"))) + (push + (substring-no-properties (nth dep-name-index elem)) + (alist-get source dependencies nil nil #'equal))))))))) dependencies)) (defun my/format-arch-dependencies (&optional category) (let ((data (my/extract-arch-dependencies category))) (with-temp-buffer - (insert - (json-encode - (mapcar - (lambda (group) - (cons (car group) - (mapcar #'car (cdr group)))) - (seq-group-by #'cdr data)))) - (json-pretty-print-buffer) + (cl-loop for (backend . packages) in data + do (insert (format "%s = [\n" backend) + (mapconcat (lambda (package) + (format "\"%s\"," package)) + packages + "\n") + "]")) (buffer-string)))) (setq my/org-config-files @@ -435,6 +436,7 @@ With ARG, repeats or can move backward if negative." '("~/Emacs.org" "~/Desktop.org" "~/Console.org" + "~/Arch.org" "~/Guix.org" "~/Mail.org"))) diff --git a/.emacs.d/modules/sqrt-general-ui.el b/.emacs.d/modules/sqrt-general-ui.el index 18a0f55..42b94b6 100644 --- a/.emacs.d/modules/sqrt-general-ui.el +++ b/.emacs.d/modules/sqrt-general-ui.el @@ -77,8 +77,8 @@ (setq doom-themes-treemacs-theme "doom-colors") (doom-themes-treemacs-config)) -(use-package modus-themes - :straight t) +;; (use-package modus-themes +;; :straight (:build (:not native-compile))) (use-package ef-themes :straight t @@ -138,8 +138,8 @@ (defun my/modus-get-base (color) (let ((base-value (string-to-number (substring (symbol-name color) 4 5))) - (base-start (cadr (assoc 'bg-main (modus-themes--current-theme-palette)))) - (base-end (cadr (assoc 'fg-dim (modus-themes--current-theme-palette))))) + (base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette)))) + (base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette))))) (nth base-value (ct-gradient 9 base-start base-end t)))) (defun my/prot-color (color palette) @@ -179,10 +179,10 @@ (t (cadr (assoc color palette)))))) (defun my/modus-color (color) - (my/prot-color color (modus-themes--current-theme-palette))) + (my/prot-color color (modus-themes-get-theme-palette))) (defun my/ef-color (color) - (my/prot-color color (ef-themes--current-theme-palette))) + (my/prot-color color (modus-themes-get-theme-palette))) (defconst my/test-colors-list '(black red green yellow blue magenta cyan white light-black @@ -250,9 +250,13 @@ collect (eval value))))))) (enable-theme 'my-theme-1)) +(defun my/advice-my-theme () + (advice-add 'load-theme :after #'my/update-my-theme)) + (unless my/is-termux - (advice-add 'load-theme :after #'my/update-my-theme) - (add-hook 'emacs-startup-hook #'my/update-my-theme)) + (add-hook 'emacs-startup-hook #'my/update-my-theme) + ;; (add-hook 'emacs-startup-hook #'my/advice-my-theme) +) (my/use-colors (tab-bar-tab :background (my/color-value 'bg) diff --git a/.emacs.d/modules/sqrt-tree-sitter.el b/.emacs.d/modules/sqrt-tree-sitter.el index f0946ed..0a4f301 100644 --- a/.emacs.d/modules/sqrt-tree-sitter.el +++ b/.emacs.d/modules/sqrt-tree-sitter.el @@ -92,6 +92,7 @@ (use-package combobulate :straight (:host github :repo "mickeynp/combobulate") + :disabled :commands (combobulate)) (provide 'sqrt-tree-sitter) diff --git a/Arch.org b/Arch.org index d557114..7a831f0 100644 --- a/Arch.org +++ b/Arch.org @@ -39,6 +39,7 @@ makepkg -si #+end_src Install [[https://github.com/ripytide/metapac][metapac]]: + #+begin_src bash paru -Syyu metapac #+end_src @@ -70,10 +71,27 @@ yadm clone git@github.com:SqrtMinusOne/dotfiles.git Checkout the changed files. Clone the org-mode repo: + #+begin_src bash git clone git@github.com:SqrtMinusOne/dotfiles.git "/home/pavel/30-39 Life/32 org-mode" #+end_src +Install wakatime: + +#+begin_src bash +cd ~/00-Scratch/ +git clone https://github.com/wakatime/wakatime-cli.git +cd ./wakatime-cli +go build +mv wakatime-cli ~/bin +#+end_src + +And create the =~/.wakatime.cfg= file with the following contents: +#+begin_src +[settings] +api_key = +#+end_src + Then run =emacs= and make sure it starts. * Metapac configuration diff --git a/Emacs.org b/Emacs.org index 759716b..e5a5087 100644 --- a/Emacs.org +++ b/Emacs.org @@ -242,6 +242,7 @@ So, first, specify how the modules are stored: #+end_src Then, scan =Emacs.org= for headings with the =MODULE_NAME= property and set the tangle property: + #+begin_src emacs-lisp (defun my/modules--refresh-and-list () (let (modules-list @@ -1541,7 +1542,7 @@ A few CLI alternatives: "m" 'magit "M" 'magit-file-dispatch) :config - (require 'forge) + ;; (require 'forge) (setq magit-blame-styles '((headings (heading-format . "%-20a %C %s\n")) @@ -2099,6 +2100,7 @@ Before I figure out how to package this for +Guix+ Arch: (advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path (or + (executable-find "wakatime") (executable-find "wakatime-cli") (expand-file-name "~/bin/wakatime-cli"))))) (when (file-exists-p "~/.wakatime.cfg") @@ -2276,8 +2278,8 @@ My colorschemes of choice. #+end_src #+begin_src emacs-lisp -(use-package modus-themes - :straight t) +;; (use-package modus-themes +;; :straight (:build (:not native-compile))) #+end_src Let's see... @@ -2364,8 +2366,8 @@ And the same for =modus-themes=. =my/modus-color= has to accept the same argumen #+begin_src emacs-lisp (defun my/modus-get-base (color) (let ((base-value (string-to-number (substring (symbol-name color) 4 5))) - (base-start (cadr (assoc 'bg-main (modus-themes--current-theme-palette)))) - (base-end (cadr (assoc 'fg-dim (modus-themes--current-theme-palette))))) + (base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette)))) + (base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette))))) (nth base-value (ct-gradient 9 base-start base-end t)))) (defun my/prot-color (color palette) @@ -2405,10 +2407,10 @@ And the same for =modus-themes=. =my/modus-color= has to accept the same argumen (t (cadr (assoc color palette)))))) (defun my/modus-color (color) - (my/prot-color color (modus-themes--current-theme-palette))) + (my/prot-color color (modus-themes-get-theme-palette))) (defun my/ef-color (color) - (my/prot-color color (ef-themes--current-theme-palette))) + (my/prot-color color (modus-themes-get-theme-palette))) #+end_src Test the three functions. @@ -2493,9 +2495,13 @@ This macro puts lambdas to =my/my-theme-update-colors-hook= that updates faces i collect (eval value))))))) (enable-theme 'my-theme-1)) +(defun my/advice-my-theme () + (advice-add 'load-theme :after #'my/update-my-theme)) + (unless my/is-termux - (advice-add 'load-theme :after #'my/update-my-theme) - (add-hook 'emacs-startup-hook #'my/update-my-theme)) + (add-hook 'emacs-startup-hook #'my/update-my-theme) + ;; (add-hook 'emacs-startup-hook #'my/advice-my-theme) +) #+end_src Defining colors for =tab-bar.el=: @@ -2522,6 +2528,7 @@ The built-in =load-theme= does not deactivate the previous theme, so here's a fu (eq enabled-theme theme))) do (disable-theme enabled-theme)) (load-theme theme t) + (my/update-my-theme) (when current-prefix-arg (my/regenerate-desktop))) #+end_src @@ -3280,6 +3287,7 @@ I'm not actually using that, but its query editor is pretty useful to debug =tre #+begin_src emacs-lisp (use-package combobulate :straight (:host github :repo "mickeynp/combobulate") + :disabled :commands (combobulate)) #+end_src *** DAP @@ -8429,7 +8437,8 @@ Display icons for files. (string-match-p "/gnu/store" default-directory)) (nerd-icons-dired-mode)))) :config - (advice-add #'dired-create-empty-file :around #'nerd-icons-dired--refresh-advice)) + ;; (advice-add #'dired-create-empty-file :around #'nerd-icons-dired--refresh-advice) + ) #+end_src Provides stuff like =dired-open-xdg= @@ -9388,6 +9397,7 @@ Finally, a function that inserts the overlay in buffer if it's available and cal #+begin_src emacs-lisp (use-package eshell-atuin :straight (:host github :repo "SqrtMinusOne/eshell-atuin") + :when (executable-find "atuin") :after eshell :config (eshell-atuin-mode) From aa1754053279ffca06427c77079d5816be57f69c Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 12 Nov 2025 17:50:23 +0300 Subject: [PATCH 03/18] emacs: fix EXWM issues --- .emacs.d/desktop.el | 3 ++- .emacs.d/modules/sqrt-i3.el | 3 ++- .gnupg/gpg-agent.conf | 2 +- Arch.org | 7 +++++-- Desktop.org | 5 ++++- Emacs.org | 4 +++- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.emacs.d/desktop.el b/.emacs.d/desktop.el index e020fe0..b3fd359 100644 --- a/.emacs.d/desktop.el +++ b/.emacs.d/desktop.el @@ -6,7 +6,8 @@ (call-process-shell-command "feh --bg-fill ~/Pictures/wallpaper.jpg")) (defun my/exwm-run-shepherd () - (when (string-empty-p (shell-command-to-string "pgrep -u pavel shepherd")) + (when (and (string-empty-p (shell-command-to-string "pgrep -u pavel shepherd")) + (executable-find "shepherd")) (call-process "shepherd"))) (use-package pinentry diff --git a/.emacs.d/modules/sqrt-i3.el b/.emacs.d/modules/sqrt-i3.el index 51dfb1d..871d668 100644 --- a/.emacs.d/modules/sqrt-i3.el +++ b/.emacs.d/modules/sqrt-i3.el @@ -1,6 +1,7 @@ ;;; -*- lexical-binding: t -*- (unless (or my/remote-server my/nested-emacs) - (add-hook 'after-init-hook #'server-start)) + ;; (add-hook 'after-init-hook #'server-start) + ) (defmacro i3-msg (&rest args) `(start-process "emacs-i3-windmove" nil "i3-msg" ,@args)) diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf index 432f364..63a3ebf 100644 --- a/.gnupg/gpg-agent.conf +++ b/.gnupg/gpg-agent.conf @@ -3,5 +3,5 @@ default-cache-ttl 3600 max-cache-ttl 3600 allow-emacs-pinentry allow-loopback-pinentry -pinentry-program /home/pavel/.guix-profile/bin/pinentry +pinentry-program /usr/bin/pinentry # Pinentry:3 ends here diff --git a/Arch.org b/Arch.org index 7a831f0..369385c 100644 --- a/Arch.org +++ b/Arch.org @@ -77,7 +77,6 @@ git clone git@github.com:SqrtMinusOne/dotfiles.git "/home/pavel/30-39 Life/32 or #+end_src Install wakatime: - #+begin_src bash cd ~/00-Scratch/ git clone https://github.com/wakatime/wakatime-cli.git @@ -92,7 +91,11 @@ And create the =~/.wakatime.cfg= file with the following contents: api_key = #+end_src -Then run =emacs= and make sure it starts. +Then run =emacs= and make sure it starts. Run: +- =M-x nerd-icons-install-fonts= +- =M-x all-the-icons-install-fonts= + +If everything works, login into EXWM. * Metapac configuration [[https://github.com/ripytide/metapac][metapac]] is a declarative wrapper around different package managers, including [[https://wiki.archlinux.org/title/Pacman][pacman]] and [[https://github.com/Morganamilo/paru][paru]]. This means the required packages can be listed in configuration files and checked into version control. diff --git a/Desktop.org b/Desktop.org index faacadf..067ac23 100644 --- a/Desktop.org +++ b/Desktop.org @@ -31,6 +31,7 @@ I used to define color codes here (see [[https://github.com/SqrtMinusOne/dotfile To use them, let's define a noweb block: #+NAME: get-color + #+begin_src emacs-lisp :var name="black" quote=0 (let ((color (or (my/color-value name)))) (if (> quote 0) @@ -267,7 +268,8 @@ As of now, these are polybar, feh and, shepherd: (call-process-shell-command "feh --bg-fill ~/Pictures/wallpaper.jpg")) (defun my/exwm-run-shepherd () - (when (string-empty-p (shell-command-to-string "pgrep -u pavel shepherd")) + (when (and (string-empty-p (shell-command-to-string "pgrep -u pavel shepherd")) + (executable-find "shepherd")) (call-process "shepherd"))) #+end_src *** Pinentry @@ -1709,6 +1711,7 @@ bindsym XF86MonBrightnessUp exec light -A 5 bindsym XF86MonBrightnessDown exec light -U 5 #+end_src *** Screenshots + #+begin_src conf-space # Screenshots bindsym --release Print exec "flameshot gui" diff --git a/Emacs.org b/Emacs.org index e5a5087..8fc7085 100644 --- a/Emacs.org +++ b/Emacs.org @@ -1116,8 +1116,10 @@ This script is being run from the [[file:Desktop.org::*i3wm][i3 configuration]]. For this to work, we need to make sure that Emacs starts a server, so here is an expression to do just that: #+BEGIN_SRC emacs-lisp (unless (or my/remote-server my/nested-emacs) - (add-hook 'after-init-hook #'server-start)) + ;; (add-hook 'after-init-hook #'server-start) + ) #+END_SRC +Edit [2025-11-12 Wed]: This has stopped working with EXWM. And here is a simple macro to do the Emacs -> i3 part: #+begin_src emacs-lisp From 6328304e70f5d87bfbc6a3611c15c08c91916434 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 12 Nov 2025 18:21:01 +0300 Subject: [PATCH 04/18] alacritty: migrate to toml --- .config/alacritty/alacritty.toml | 152 +++++++++++++++++++++++ .config/alacritty/alacritty.yml | 69 ----------- Console.org | 207 ++++++++++++++++++++++--------- 3 files changed, 298 insertions(+), 130 deletions(-) create mode 100644 .config/alacritty/alacritty.toml delete mode 100644 .config/alacritty/alacritty.yml diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..78577e4 --- /dev/null +++ b/.config/alacritty/alacritty.toml @@ -0,0 +1,152 @@ +decorations = "none" + +[colors.bright] +Black = "#484848" +Blue = "#cbcfff" +Cyan = "#88c8ff" +Green = "#8adf80" +Magenta = "#df8fff" +Red = "#ff8f88" +White = "#ffffff" +Yellow = "#fac200" + +[colors.normal] +black = "#222222" +blue = "#375cd8" +cyan = "#1f6fbf" +green = "#217a3c" +magenta = "#ba35af" +red = "#cc3333" +white = "#fff8f0" +yellow = "#8a5d00" + +[colors.primary] +background = "#fff8f0" +foreground = "#222222" + +[env] +TERM = "xterm-256color" + +[font] +size = 10 + +[font.normal] +family = "JetBrainsMono Nerd Font" +style = "Regular" + +[[keyboard.bindings]] +action = "Paste" +key = "Paste" + +[[keyboard.bindings]] +action = "Copy" +key = "Copy" + +[[keyboard.bindings]] +action = "ClearLogNotice" +key = "L" +mods = "Control" + +[[keyboard.bindings]] +chars = "\f" +key = "L" +mode = "~Vi|~Search" +mods = "Control" + +[[keyboard.bindings]] +action = "ScrollPageUp" +key = "PageUp" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollPageDown" +key = "PageDown" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollToTop" +key = "Home" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollToBottom" +key = "End" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ReceiveChar" +key = "Space" +mode = "~Search" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "Paste" +key = "V" +mode = "~Vi" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "Copy" +key = "C" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "ReceiveChar" +key = "F" +mode = "~Search" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "ReceiveChar" +key = "B" +mode = "~Search" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "PasteSelection" +key = "Insert" +mods = "Shift" + +[[keyboard.bindings]] +action = "ResetFontSize" +key = "Key0" +mods = "Control" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "Equals" +mods = "Control" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "Plus" +mods = "Control" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "NumpadAdd" +mods = "Control" + +[[keyboard.bindings]] +action = "DecreaseFontSize" +key = "Minus" +mods = "Control" + +[[keyboard.bindings]] +action = "DecreaseFontSize" +key = "NumpadSubtract" +mods = "Control" + +[window] +dynamic_padding = true +opacity = 1 + +[window.padding] +x = 0 +y = 0 + +[keyboard] diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml deleted file mode 100644 index 2a94929..0000000 --- a/.config/alacritty/alacritty.yml +++ /dev/null @@ -1,69 +0,0 @@ -# [[file:../../Console.org::*Alacritty][Alacritty:1]] -decorations: none - -font: - normal: - family: JetBrainsMono Nerd Font - style: Regular - - size: 10 - -env: - TERM: xterm-256color - -colors: - primary: - background: '#fff8f0' - foreground: '#222222' - normal: - black: '#222222' - red: '#cc3333' - green: '#217a3c' - yellow: '#8a5d00' - blue: '#375cd8' - magenta: '#ba35af' - cyan: '#1f6fbf' - white: '#fff8f0' - bright: - Black: '#484848' - Red: '#ff8f88' - Green: '#8adf80' - Yellow: '#fac200' - Blue: '#cbcfff' - Magenta: '#df8fff' - Cyan: '#88c8ff' - White: '#ffffff' - -window: - padding: - x: 0 - y: 0 - dynamic_padding: true - opacity: 1 - -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 } - - # Turn off vi mode - - { key: Space, mods: Shift|Control, mode: ~Search, action: ReceiveChar } - - # (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: ReceiveChar } - - { key: B, mods: Control|Shift, mode: ~Search, action: ReceiveChar } - - { 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 } -# Alacritty:1 ends here diff --git a/Console.org b/Console.org index affced5..a667c85 100644 --- a/Console.org +++ b/Console.org @@ -700,7 +700,7 @@ source ~/.tmux.line.conf #+end_src * Alacritty :PROPERTIES: -:header-args+: :tangle ./.config/alacritty/alacritty.yml :comments link +:header-args+: :tangle ./.config/alacritty/alacritty.toml :comments link :END: | Arch dependency | @@ -712,74 +712,159 @@ source ~/.tmux.line.conf References: - [[https://github.com/alacritty/alacritty/blob/master/alacritty.yml][default config]] -#+begin_src yaml :noweb yes -decorations: none +#+begin_src toml :noweb yes +decorations = "none" -font: - normal: - family: JetBrainsMono Nerd Font - style: Regular +[colors.bright] +Black = "<>" +Red = "<>" +Green = "<>" +Yellow = "<>" +Blue = "<>" +Magenta = "<>" +Cyan = "<>" +White = "<>" - size: 10 +[colors.normal] +black = "<>" +red = "<>" +green = "<>" +yellow = "<>" +blue = "<>" +magenta = "<>" +cyan = "<>" +white = "<>" -env: - TERM: xterm-256color +[colors.primary] +background: "<>" +foreground: "<>" -colors: - primary: - background: '<>' - foreground: '<>' - normal: - black: '<>' - red: '<>' - green: '<>' - yellow: '<>' - blue: '<>' - magenta: '<>' - cyan: '<>' - white: '<>' - bright: - Black: '<>' - Red: '<>' - Green: '<>' - Yellow: '<>' - Blue: '<>' - Magenta: '<>' - Cyan: '<>' - White: '<>' +[env] +TERM = "xterm-256color" -window: - padding: - x: 0 - y: 0 - dynamic_padding: true - opacity: 1 +[font] +size = 10 -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 } +[font.normal] +family = "JetBrainsMono Nerd Font" +style = "Regular" - # Turn off vi mode - - { key: Space, mods: Shift|Control, mode: ~Search, action: ReceiveChar } +[[keyboard.bindings]] +action = "Paste" +key = "Paste" - # (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: ReceiveChar } - - { key: B, mods: Control|Shift, mode: ~Search, action: ReceiveChar } - - { 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 } +[[keyboard.bindings]] +action = "Copy" +key = "Copy" + +[[keyboard.bindings]] +action = "ClearLogNotice" +key = "L" +mods = "Control" + +[[keyboard.bindings]] +chars = "\f" +key = "L" +mode = "~Vi|~Search" +mods = "Control" + +[[keyboard.bindings]] +action = "ScrollPageUp" +key = "PageUp" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollPageDown" +key = "PageDown" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollToTop" +key = "Home" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ScrollToBottom" +key = "End" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +action = "ReceiveChar" +key = "Space" +mode = "~Search" +mods = "Shift|Control" + +[[keyboard.bindings]] +action = "Paste" +key = "V" +mode = "~Vi" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "Copy" +key = "C" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "ReceiveChar" +key = "F" +mode = "~Search" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "ReceiveChar" +key = "B" +mode = "~Search" +mods = "Control|Shift" + +[[keyboard.bindings]] +action = "PasteSelection" +key = "Insert" +mods = "Shift" + +[[keyboard.bindings]] +action = "ResetFontSize" +key = "Key0" +mods = "Control" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "Equals" +mods = "Control" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "Plus" +mods = "Control" + +[[keyboard.bindings]] +action = "IncreaseFontSize" +key = "NumpadAdd" +mods = "Control" + +[[keyboard.bindings]] +action = "DecreaseFontSize" +key = "Minus" +mods = "Control" + +[[keyboard.bindings]] +action = "DecreaseFontSize" +key = "NumpadSubtract" +mods = "Control" + +[window] +dynamic_padding = true +opacity = 1 + +[window.padding] +x = 0 +y = 0 + +[keyboard] #+end_src * Bottom | Arch dependency | Description | From cbd5ff7b0c8881f9495331b615c9526e4dda645f Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 12 Nov 2025 18:22:54 +0300 Subject: [PATCH 05/18] emacs: ef-themes workaround --- .emacs.d/modules/sqrt-general-ui.el | 11 +++++++---- Emacs.org | 10 ++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.emacs.d/modules/sqrt-general-ui.el b/.emacs.d/modules/sqrt-general-ui.el index 42b94b6..4e9994a 100644 --- a/.emacs.d/modules/sqrt-general-ui.el +++ b/.emacs.d/modules/sqrt-general-ui.el @@ -138,8 +138,10 @@ (defun my/modus-get-base (color) (let ((base-value (string-to-number (substring (symbol-name color) 4 5))) - (base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette)))) - (base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette))))) + (base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette + (or (my/modus-p) (my/ef-p)))))) + (base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette + (or (my/modus-p) (my/ef-p))))))) (nth base-value (ct-gradient 9 base-start base-end t)))) (defun my/prot-color (color palette) @@ -179,10 +181,10 @@ (t (cadr (assoc color palette)))))) (defun my/modus-color (color) - (my/prot-color color (modus-themes-get-theme-palette))) + (my/prot-color color (modus-themes-get-theme-palette (my/modus-p)))) (defun my/ef-color (color) - (my/prot-color color (modus-themes-get-theme-palette))) + (my/prot-color color (modus-themes-get-theme-palette (my/ef-p)))) (defconst my/test-colors-list '(black red green yellow blue magenta cyan white light-black @@ -276,6 +278,7 @@ (eq enabled-theme theme))) do (disable-theme enabled-theme)) (load-theme theme t) + (my/update-my-theme) (when current-prefix-arg (my/regenerate-desktop))) diff --git a/Emacs.org b/Emacs.org index 8d0878f..3e5a814 100644 --- a/Emacs.org +++ b/Emacs.org @@ -2436,8 +2436,10 @@ And the same for =modus-themes=. =my/modus-color= has to accept the same argumen #+begin_src emacs-lisp (defun my/modus-get-base (color) (let ((base-value (string-to-number (substring (symbol-name color) 4 5))) - (base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette)))) - (base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette))))) + (base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette + (or (my/modus-p) (my/ef-p)))))) + (base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette + (or (my/modus-p) (my/ef-p))))))) (nth base-value (ct-gradient 9 base-start base-end t)))) (defun my/prot-color (color palette) @@ -2477,10 +2479,10 @@ And the same for =modus-themes=. =my/modus-color= has to accept the same argumen (t (cadr (assoc color palette)))))) (defun my/modus-color (color) - (my/prot-color color (modus-themes-get-theme-palette))) + (my/prot-color color (modus-themes-get-theme-palette (my/modus-p)))) (defun my/ef-color (color) - (my/prot-color color (modus-themes-get-theme-palette))) + (my/prot-color color (modus-themes-get-theme-palette (my/ef-p)))) #+end_src Test the three functions. From 9ffcbde6d2cd04a24e1a4f742be975b62c451d4f Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 12 Nov 2025 18:23:14 +0300 Subject: [PATCH 06/18] arch: upd --- .config/metapac/groups/system.toml | 1 + Arch.org | 3 ++- Desktop.org | 40 ++++++++++++++++++++---------- bin/polybar.sh | 4 +++ 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.config/metapac/groups/system.toml b/.config/metapac/groups/system.toml index ba053a0..53bb320 100644 --- a/.config/metapac/groups/system.toml +++ b/.config/metapac/groups/system.toml @@ -24,6 +24,7 @@ arch = [ "openssh", "metapac", "nano", +"inetutils", "linux-firmware", "linux", "lightdm-gtk-greeter", diff --git a/Arch.org b/Arch.org index 369385c..3e956bd 100644 --- a/Arch.org +++ b/Arch.org @@ -71,12 +71,12 @@ yadm clone git@github.com:SqrtMinusOne/dotfiles.git Checkout the changed files. Clone the org-mode repo: - #+begin_src bash git clone git@github.com:SqrtMinusOne/dotfiles.git "/home/pavel/30-39 Life/32 org-mode" #+end_src Install wakatime: + #+begin_src bash cd ~/00-Scratch/ git clone https://github.com/wakatime/wakatime-cli.git @@ -165,6 +165,7 @@ Some necessary Arch packages: | lightdm-gtk-greeter | | linux | | linux-firmware | +| inetutils | | nano | | metapac | | openssh | diff --git a/Desktop.org b/Desktop.org index 26f82e2..7937fd5 100644 --- a/Desktop.org +++ b/Desktop.org @@ -30,8 +30,8 @@ Removed features: I used to define color codes here (see [[https://github.com/SqrtMinusOne/dotfiles/commit/2dbf1cdd008ec0061456782cca3ebd76e603b31e][previous version of the file]]), now I just get colors from the current Emacs theme. To use them, let's define a noweb block: -#+NAME: get-color +#+NAME: get-color #+begin_src emacs-lisp :var name="black" quote=0 (let ((color (or (my/color-value name)))) (if (> quote 0) @@ -1966,17 +1966,19 @@ As we want to interweave polybar modules with these glyphs in the right order an Also excluding some modules from certain monitors, which for now is about excluding =battery= from the monitors of my desktop PC: #+NAME: polybar_modules_exclude -| Monitor | Exclude | -|----------+---------| -| DVI-D-0 | battery | -| HDMI-A-0 | battery | -| HDMI-0 | battery | -| DP-1 | battery | -| eDP | nvidia | -| eDP-1 | nvidia | -| DVI-D-0 | nvidia | -| HDMI-A-0 | nvidia | -| HDMI-1 | nvidia | +| Monitor | Exclude | +|-----------+---------| +| DVI-D-0 | battery | +| HDMI-A-0 | battery | +| HDMI-0 | battery | +| DP-1 | battery | +| Virtual-1 | battery | +| eDP | nvidia | +| eDP-1 | nvidia | +| DVI-D-0 | nvidia | +| HDMI-A-0 | nvidia | +| HDMI-1 | nvidia | +| Virtual-1 | nvidia | Another thing we need to do is to set the color of modules in accordance with the =polybar_modules= table. The background can be determined from the =Color= column with the following code block: #+NAME: get-polybar-bg @@ -2242,6 +2244,7 @@ declare -A FONT_SIZES=( ["HDMI-1"]="13" ["HDMI-0"]="13" ["DP-1"]="13" + ["Virtual-1"]="13" ) declare -A EMOJI_SCALE=( ["eDP"]="9" @@ -2251,6 +2254,7 @@ declare -A EMOJI_SCALE=( ["HDMI-1"]="10" ["HDMI-0"]="10" ["DP-1"]="10" + ["Virtual-1"]="13" ) declare -A BAR_HEIGHT=( ["eDP"]="29" @@ -2260,6 +2264,7 @@ declare -A BAR_HEIGHT=( ["HDMI-1"]="29" ["HDMI-0"]="29" ["DP-1"]="29" + ["Virtual-1"]="29" ) declare -A BLOCKS=( ["eDP"]="<>" @@ -2269,6 +2274,7 @@ declare -A BLOCKS=( ["HDMI-1"]="<>" ["HDMI-0"]="<>" ["DP-1"]="<>" + ["Virtual-1"]="<>" ) declare -A TEMP_HWMON_PATHS=( @@ -4372,6 +4378,10 @@ flatpak install -y --user flathub chat.rocket.RocketChat :END: [[https://www.gnu.org/software/shepherd/manual/html_node/index.html][GNU Shepherd]] is a service management system for GNU Guix. I'll probably migrate to systemd since I'm not on Guix anymore. +| Arch dependency | Disabled | +|-----------------+----------| +| shepherd | t | + ** Music | Category | Arch dependency | |----------+-----------------| @@ -4416,6 +4426,10 @@ MPD watcher ** GNU Mcron [[https://www.gnu.org/software/mcron/][GNU Mcron]] is a replacement for cron, written in Scheme. +| Arch dependency | Disabled | +|-----------------+----------| +| mcron | t | + #+begin_src scheme (define mcron (make @@ -4638,7 +4652,7 @@ Run services ;; opensnitch-ui )) #+end_src -* Acch settings +* Arch settings Other desktop programs I use are listed below. | Category | Arch dependency | Description | diff --git a/bin/polybar.sh b/bin/polybar.sh index a558500..fbb2ac4 100755 --- a/bin/polybar.sh +++ b/bin/polybar.sh @@ -25,6 +25,7 @@ declare -A FONT_SIZES=( ["HDMI-1"]="13" ["HDMI-0"]="13" ["DP-1"]="13" + ["Virtual-1"]="13" ) declare -A EMOJI_SCALE=( ["eDP"]="9" @@ -34,6 +35,7 @@ declare -A EMOJI_SCALE=( ["HDMI-1"]="10" ["HDMI-0"]="10" ["DP-1"]="10" + ["Virtual-1"]="13" ) declare -A BAR_HEIGHT=( ["eDP"]="29" @@ -43,6 +45,7 @@ declare -A BAR_HEIGHT=( ["HDMI-1"]="29" ["HDMI-0"]="29" ["DP-1"]="29" + ["Virtual-1"]="29" ) declare -A BLOCKS=( ["eDP"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--cyan temperature glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background " @@ -52,6 +55,7 @@ declare -A BLOCKS=( ["HDMI-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--cyan temperature glyph-cyan--cyan battery glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background " ["HDMI-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan nvidia glyph-light-cyan--cyan cpu glyph-cyan--cyan temperature glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background " ["DP-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan nvidia glyph-light-cyan--cyan cpu glyph-cyan--cyan temperature glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background " + ["Virtual-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--cyan temperature glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background " ) declare -A TEMP_HWMON_PATHS=( From 97be99256562415f8aad1d1ef20c98d01e45080e Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Thu, 13 Nov 2025 13:34:18 +0300 Subject: [PATCH 07/18] *: update for arch --- .config/alacritty/alacritty.toml | 18 +- .config/metapac/config.toml | 2 +- .config/metapac/groups/desktop.toml | 4 +- .config/metapac/groups/emacs.toml | 2 + .config/metapac/groups/system.toml | 1 + .config/systemd/user/aw-qt.service | 8 + .config/systemd/user/deterred-mpd.service | 9 + .config/systemd/user/mpd.service | 8 + .config/systemd/user/nm-applet.service | 8 + .config/systemd/user/vnstat.service | 8 + .config/systemd/user/xsettingsd.service | 8 + .emacs.d/desktop.el | 4 + .emacs.d/modules/sqrt-dired.el | 3 +- .xsession | 2 +- Arch.org | 56 ++-- Desktop.org | 366 +++++++--------------- Emacs.org | 23 +- bin/polybar.sh | 2 + 18 files changed, 229 insertions(+), 303 deletions(-) create mode 100644 .config/systemd/user/aw-qt.service create mode 100644 .config/systemd/user/deterred-mpd.service create mode 100644 .config/systemd/user/mpd.service create mode 100644 .config/systemd/user/nm-applet.service create mode 100644 .config/systemd/user/vnstat.service create mode 100644 .config/systemd/user/xsettingsd.service diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 78577e4..f31ff14 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,14 +1,14 @@ -decorations = "none" +# decorations = "none" [colors.bright] -Black = "#484848" -Blue = "#cbcfff" -Cyan = "#88c8ff" -Green = "#8adf80" -Magenta = "#df8fff" -Red = "#ff8f88" -White = "#ffffff" -Yellow = "#fac200" +black = "#484848" +blue = "#cbcfff" +cyan = "#88c8ff" +green = "#8adf80" +magenta = "#df8fff" +red = "#ff8f88" +white = "#ffffff" +yellow = "#fac200" [colors.normal] black = "#222222" diff --git a/.config/metapac/config.toml b/.config/metapac/config.toml index cc583e0..cf7c10d 100644 --- a/.config/metapac/config.toml +++ b/.config/metapac/config.toml @@ -3,7 +3,7 @@ enabled_backends = ["arch"] hostname_groups_enabled = true [hostname_groups] -kek = ["browsers"] +weiss = ["system","office","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"] archlinux = ["system","office","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"] diff --git a/.config/metapac/groups/desktop.toml b/.config/metapac/groups/desktop.toml index 1376be0..4de4020 100644 --- a/.config/metapac/groups/desktop.toml +++ b/.config/metapac/groups/desktop.toml @@ -1,4 +1,5 @@ arch = [ +"vnstat", "activitywatch-bin", "xdg-desktop-portal", "flatpak", @@ -14,5 +15,4 @@ arch = [ "gnome-themes-extra", "xsettingsd", "papirus-icon-theme", -"gtk-engines", -"gtk-engine-murrine",] +"gtk-engines",] diff --git a/.config/metapac/groups/emacs.toml b/.config/metapac/groups/emacs.toml index 965dd58..856bdb0 100644 --- a/.config/metapac/groups/emacs.toml +++ b/.config/metapac/groups/emacs.toml @@ -3,8 +3,10 @@ arch = [ "the_silver_searcher", "ripgrep", "hledger", +"rclone", "gnu-free-fonts", "ttf-unifont", +"telegram-tdlib", "yt-dlp", "mpv", "python-youtube-transcript-api", diff --git a/.config/metapac/groups/system.toml b/.config/metapac/groups/system.toml index 53bb320..3a9fe94 100644 --- a/.config/metapac/groups/system.toml +++ b/.config/metapac/groups/system.toml @@ -23,6 +23,7 @@ arch = [ "pacman-contrib", "openssh", "metapac", +"networkmanager", "nano", "inetutils", "linux-firmware", diff --git a/.config/systemd/user/aw-qt.service b/.config/systemd/user/aw-qt.service new file mode 100644 index 0000000..5c914d8 --- /dev/null +++ b/.config/systemd/user/aw-qt.service @@ -0,0 +1,8 @@ +[Unit] +Description=ActivityWatch + +[Service] +ExecStart=/usr/bin/aw-qt + +[Install] +WantedBy=wm-session.target diff --git a/.config/systemd/user/deterred-mpd.service b/.config/systemd/user/deterred-mpd.service new file mode 100644 index 0000000..f3aa368 --- /dev/null +++ b/.config/systemd/user/deterred-mpd.service @@ -0,0 +1,9 @@ +[Unit] +Description=DETERRED MPD Watcher +ConditionPathExists=/home/pavel/10-19 Code/13 Other Projects/13.02 sqrt-data/13.02.R Repos/13.02.R.05 deterred/watchers/deterred-mpd.py + +[Service] +ExecStart=/usr/bin/python "/home/pavel/10-19 Code/13 Other Projects/13.02 sqrt-data/13.02.R Repos/13.02.R.05 deterred/watchers/deterred-mpd.py" "--db" "/home/pavel/.deterred/database.db" + +[Install] +WantedBy=wm-session.target diff --git a/.config/systemd/user/mpd.service b/.config/systemd/user/mpd.service new file mode 100644 index 0000000..ce25e0c --- /dev/null +++ b/.config/systemd/user/mpd.service @@ -0,0 +1,8 @@ +[Unit] +Description=Music Player Daemon + +[Service] +ExecStart=/usr/bin/mpd --no-daemon + +[Install] +WantedBy=graphical-session.target diff --git a/.config/systemd/user/nm-applet.service b/.config/systemd/user/nm-applet.service new file mode 100644 index 0000000..175017a --- /dev/null +++ b/.config/systemd/user/nm-applet.service @@ -0,0 +1,8 @@ +[Unit] +Description=Network Manager Applet + +[Service] +ExecStart=/usr/bin/nm-applet + +[Install] +WantedBy=wm-session.target diff --git a/.config/systemd/user/vnstat.service b/.config/systemd/user/vnstat.service new file mode 100644 index 0000000..1b81b7f --- /dev/null +++ b/.config/systemd/user/vnstat.service @@ -0,0 +1,8 @@ +[Unit] +Description=vnStat network monitor + +[Service] +ExecStart=/usr/bin/vnstatd + +[Install] +WantedBy=wm-session.target diff --git a/.config/systemd/user/xsettingsd.service b/.config/systemd/user/xsettingsd.service new file mode 100644 index 0000000..be57f95 --- /dev/null +++ b/.config/systemd/user/xsettingsd.service @@ -0,0 +1,8 @@ +[Unit] +Description=X Settings Daemon + +[Service] +ExecStart=/usr/bin/xsettingsd + +[Install] +WantedBy=wm-session.target diff --git a/.emacs.d/desktop.el b/.emacs.d/desktop.el index f3ceaff..d43d12f 100644 --- a/.emacs.d/desktop.el +++ b/.emacs.d/desktop.el @@ -10,6 +10,9 @@ (executable-find "shepherd")) (call-process "shepherd"))) +(defun my/exwm-run-systemd () + (call-process "systemctl" nil nil nil "--user" "start" "wm-session.target")) + (use-package pinentry :straight t :after (exwm) @@ -592,6 +595,7 @@ _d_: Discord (my/exwm-run-polybar) (my/exwm-set-wallpaper) (my/exwm-run-shepherd) + (my/exwm-run-systemd) (my/run-in-background "gpgconf --reload gpg-agent") (when (my/is-arch) (my/run-in-background "set_layout"))) diff --git a/.emacs.d/modules/sqrt-dired.el b/.emacs.d/modules/sqrt-dired.el index 7e903c1..735673c 100644 --- a/.emacs.d/modules/sqrt-dired.el +++ b/.emacs.d/modules/sqrt-dired.el @@ -116,7 +116,8 @@ (string-match-p "/gnu/store" default-directory)) (nerd-icons-dired-mode)))) :config - (advice-add #'dired-create-empty-file :around #'nerd-icons-dired--refresh-advice)) + ;; (advice-add #'dired-create-empty-file :around #'nerd-icons-dired--refresh-advice) + ) (use-package dired-open :straight t diff --git a/.xsession b/.xsession index cea5dc7..a0985ed 100755 --- a/.xsession +++ b/.xsession @@ -21,7 +21,7 @@ xss-lock -- i3lock -f -i /home/pavel/Pictures/lock-wallpaper.png & # Some apps that have to be launched only once. picom & # nm-applet & -dunst & +# dunst & copyq & # Run the Emacs startup script as a session. diff --git a/Arch.org b/Arch.org index 3e956bd..e1467ba 100644 --- a/Arch.org +++ b/Arch.org @@ -1,5 +1,5 @@ -#+PROPERTY: header-args :mkdirp yes #+TITLE: Arch Linux +#+PROPERTY: header-args :mkdirp yes I've decided to switch to [[https://archlinux.org/][Arch Linux]] and configure it declaratively with [[https://github.com/ripytide/metapac][metapac]]. @@ -70,13 +70,23 @@ yadm clone git@github.com:SqrtMinusOne/dotfiles.git #+end_src Checkout the changed files. -Clone the org-mode repo: +Clone org-mode and passwords repos: #+begin_src bash -git clone git@github.com:SqrtMinusOne/dotfiles.git "/home/pavel/30-39 Life/32 org-mode" +git clone ssh://git@git.sqrtminusone.xyz:222/sqrtminusone/org-mode.git "/home/pavel/30-39 Life/32 org-mode" +git clone ssh://git@git.sqrtminusone.xyz:222/sqrtminusone/passwords.git "/home/pavel/.password-store" +#+end_src + +And don't forget to configure git: +#+begin_src bash +git config --global user.email "thexcloud@gmail.com" +git config --global user.name "SqrtMinusOne" +#+end_src + +#+begin_src bash +sudo systemctl enable --now NetworkManager #+end_src Install wakatime: - #+begin_src bash cd ~/00-Scratch/ git clone https://github.com/wakatime/wakatime-cli.git @@ -95,8 +105,15 @@ Then run =emacs= and make sure it starts. Run: - =M-x nerd-icons-install-fonts= - =M-x all-the-icons-install-fonts= +Run =rclone config=, configure the remotes. Then =M-x my/index-commands-sync=. + If everything works, login into EXWM. +Create some directories: +#+begin_src bash +mkdir -p /home/pavel/Pictures/screenshots/ +#+end_src + * Metapac configuration [[https://github.com/ripytide/metapac][metapac]] is a declarative wrapper around different package managers, including [[https://wiki.archlinux.org/title/Pacman][pacman]] and [[https://github.com/Morganamilo/paru][paru]]. This means the required packages can be listed in configuration files and checked into version control. @@ -106,20 +123,20 @@ In =metapac=, packages are listed in "groups", each group being a TOML file stat Below is the table enabling different groups on different hostnames: #+NAME: metapac-groups -| Profile | archlinux | kek | -| browsers | + | + | -| console | + | | -| desktop | + | | -| desktop-misc | + | | -| desktop-polybar | + | | -| desktop-rofi | + | | -| dev | + | | -| emacs | + | | -| latex | + | | -| mail | + | | -| music | + | | -| office | + | | -| system | + | | +| Profile | archlinux | weiss | +| browsers | + | + | +| console | + | + | +| desktop | + | + | +| desktop-misc | + | + | +| desktop-polybar | + | + | +| desktop-rofi | + | + | +| dev | + | + | +| emacs | + | + | +| latex | + | + | +| mail | + | + | +| music | + | + | +| office | + | + | +| system | + | + | And the code to format it as TOML: #+NAME: metapac-groups-format @@ -167,6 +184,7 @@ Some necessary Arch packages: | linux-firmware | | inetutils | | nano | +| networkmanager | | metapac | | openssh | | pacman-contrib | @@ -202,5 +220,5 @@ Various drivers, I'm not sure which I actually need, so... #+end_src #+begin_src scheme :tangle .config/metapac/groups/system.toml :noweb yes -<> +<ger> #+end_src diff --git a/Desktop.org b/Desktop.org index 7937fd5..7e73e5b 100644 --- a/Desktop.org +++ b/Desktop.org @@ -121,6 +121,7 @@ Also, Xresources are used to set =Xft= settings. Unfortunately, the DPI setting ((string-equal hostname "eminence") 120) ((string-equal hostname "violet") 120) ((string-equal hostname "iris") 120) + ((string-equal hostname "weiss") 120) (t 96))) #+end_src @@ -130,13 +131,13 @@ Xft.dpi: <> ** Themes A few programs I use to customize the apperance are listed below. -| Arch dependency | Description | -|--------------------+-------------------------| -| gtk-engine-murrine | My preferred GTK theme | -| gtk-engines | | -| papirus-icon-theme | My preferred Icon theme | -| xsettingsd | X11 settings daemon | -| gnome-themes-extra | | +| Arch dependency | Description | Disabled | +|--------------------+-------------------------+----------| +| gtk-engine-murrine | My preferred GTK theme | t | +| gtk-engines | | | +| papirus-icon-theme | My preferred Icon theme | | +| xsettingsd | X11 settings daemon | | +| gnome-themes-extra | | | [[https://github.com/derat/xsettingsd][xsettingsd]] is a lightweight daemon which configures X11 applications. It is launched with shepherd in the [[*Services][Services]] section. @@ -244,7 +245,7 @@ xss-lock -- i3lock -f -i /home/pavel/Pictures/lock-wallpaper.png & # Some apps that have to be launched only once. picom & # nm-applet & -dunst & +# dunst & copyq & # Run the Emacs startup script as a session. @@ -271,6 +272,9 @@ As of now, these are polybar, feh and, shepherd: (when (and (string-empty-p (shell-command-to-string "pgrep -u pavel shepherd")) (executable-find "shepherd")) (call-process "shepherd"))) + +(defun my/exwm-run-systemd () + (call-process "systemctl" nil nil nil "--user" "start" "wm-session.target")) #+end_src *** Pinentry The GUI pinentry doesn't work too well with EXWM because of issues with popup windows, so we will use the Emacs one. @@ -1216,6 +1220,7 @@ And the EXWM config itself. (my/exwm-run-polybar) (my/exwm-set-wallpaper) (my/exwm-run-shepherd) + (my/exwm-run-systemd) (my/run-in-background "gpgconf --reload gpg-agent") (when (my/is-arch) (my/run-in-background "set_layout"))) @@ -2231,6 +2236,8 @@ elif [ "$hostname" = "eminence" ]; then fi elif [ "$hostname" = "iris" ]; then TRAY_MONITOR="HDMI-1" +elif [ "$hostname" = "weiss" ]; then + TRAY_MONITOR="eDP-1" else TRAY_MONITOR="DP-1" fi @@ -3293,7 +3300,7 @@ References: ### Misc/Advanced ### dmenu = /usr/bin/dmenu -p dunst: - browser = /home/pavel/.guix-extra-profiles/browsers/browsers/bin/firefox + browser = /user/bin/firefox always_run_script = true title = Dunst class = Dunst @@ -3309,15 +3316,16 @@ References: mouse_middle_click = do_action mouse_right_click = close_all -[experimental] - per_monitor_dpi = false - -[shortcuts] + ### Shortcuts close = ctrl+space close_all = ctrl+shift+space history = ctrl+grave context = ctrl+shift+period +[experimental] + per_monitor_dpi = false + + [urgency_low] background = <> frame_color = <> @@ -4373,14 +4381,33 @@ flatpak install -y --user flathub com.github.wwmm.pulseeffects flatpak install -y --user flathub chat.rocket.RocketChat #+end_example * Services -:PROPERTIES: -:header-args+: :tangle ~/.config/shepherd/init.scm -:END: -[[https://www.gnu.org/software/shepherd/manual/html_node/index.html][GNU Shepherd]] is a service management system for GNU Guix. I'll probably migrate to systemd since I'm not on Guix anymore. +See [[https://wiki.archlinux.org/title/Systemd/User][systemd/User]] on Arch Wiki how to create user services. -| Arch dependency | Disabled | -|-----------------+----------| -| shepherd | t | +After editing the services, run: +#+begin_src bash +systemctl --user daemon-reload +#+end_src + +It's required to enable them manually for now: +#+begin_src bash +systemctl --user enable --now nm-applet +systemctl --user enable --now aw-qt +systemctl --user enable --now deterred-mpd +systemctl --user enable --now vnstat +systemctl --user enable --now xsettingsd +systemctl --user enable --now flameshot +#+end_src + +#+RESULTS: + +** Custom target +Creating a custom target because otherwise systemd tries to launch everything before the WM is loaded. + +#+begin_src conf :tangle .config/systemd/user/wm-session.target +[Unit] +Description=Window Manager Session +After=graphical-session.target +#+end_src ** Music | Category | Arch dependency | @@ -4393,51 +4420,29 @@ flatpak install -y --user flathub chat.rocket.RocketChat | music | cuetools | | music | flac | -Music player daemon -#+begin_src scheme -(define mpd - (make - #:provides '(mpd) - #:respawn? #t - #:start (make-forkexec-constructor '("mpd" "--no-daemon")) - #:stop (make-kill-destructor))) +#+begin_src conf :tangle .config/systemd/user/mpd.service +[Unit] +Description=Music Player Daemon + +[Service] +ExecStart=/usr/bin/mpd --no-daemon + +[Install] +WantedBy=graphical-session.target #+end_src -MPD watcher -#+begin_src scheme -(define sqrt-data-agent-mpd - (make - #:provides '(sqrt-data-agent-mpd) - #:respawn? #t - #:start (make-forkexec-constructor '("sqrt_data_agent_mpd")) - #:stop (make-kill-destructor) - #:requires '(mpd))) +#+begin_src conf :tangle .config/systemd/user/deterred-mpd.service +[Unit] +Description=DETERRED MPD Watcher +ConditionPathExists=/home/pavel/10-19 Code/13 Other Projects/13.02 sqrt-data/13.02.R Repos/13.02.R.05 deterred/watchers/deterred-mpd.py -(define deterred-mpd - (make - #:provides '(deterred-mpd) - #:respawn? #t - #:start (make-forkexec-constructor - '("python" "/home/pavel/10-19 Code/13 Other Projects/13.02 sqrt-data/13.02.R Repos/13.02.R.05 deterred/watchers/deterred-mpd.py" - "--db" "/home/pavel/.deterred/database.db")) - #:stop (make-kill-destructor) - #:requires '(mpd))) +[Service] +ExecStart=/usr/bin/python "/home/pavel/10-19 Code/13 Other Projects/13.02 sqrt-data/13.02.R Repos/13.02.R.05 deterred/watchers/deterred-mpd.py" "--db" "/home/pavel/.deterred/database.db" + +[Install] +WantedBy=wm-session.target #+end_src -** GNU Mcron -[[https://www.gnu.org/software/mcron/][GNU Mcron]] is a replacement for cron, written in Scheme. -| Arch dependency | Disabled | -|-----------------+----------| -| mcron | t | - -#+begin_src scheme -(define mcron - (make - #:provides '(mcron) - #:respawn? #t - #:start (make-forkexec-constructor '("mcron")) - #:stop (make-kill-destructor))) -#+end_src ** ActivityWatch [[https://activitywatch.net/][ActivityWatch]] is a FOSS time tracker. It tracks screen and application usage and has integrations with browsers, Emacs, etc. @@ -4445,212 +4450,65 @@ MPD watcher |-------------------| | activitywatch-bin | -aw-server -#+begin_src scheme -(define aw-server - (make - #:provides '(aw-server) - #:respawn? #t - #:start (make-forkexec-constructor '("aw-server")) - #:stop (make-kill-destructor))) +#+begin_src conf :tangle .config/systemd/user/aw-qt.service +[Unit] +Description=ActivityWatch + +[Service] +ExecStart=/usr/bin/aw-qt + +[Install] +WantedBy=wm-session.target #+end_src -=aw-watcher-afk= has some problems with statup, so there is a wrapper script - -#+begin_src sh :tangle ~/bin/scripts/aw-watcher-afk-wrapper -sleep 5 -aw-watcher-afk -#+end_src - -aw-watcher-afk -#+begin_src scheme -(define aw-watcher-afk - (make - #:provides '(aw-watcher-afk) - #:requires '(aw-server) - #:respawn? #t - #:start (make-forkexec-constructor '("/home/pavel/bin/scripts/aw-watcher-afk-wrapper")) - #:stop (make-kill-destructor))) -#+end_src - -aw-watcher-window -#+begin_src scheme -(define aw-watcher-window - (make - #:provides '(aw-watcher-window) - #:requires '(aw-server) - #:respawn? #t - #:start (make-forkexec-constructor '("aw-watcher-window")) - #:stop (make-kill-destructor))) -#+end_src -** PulseEffects -#+begin_src scheme -(define pulseeffects - (make - #:provides '(pulseeffects) - #:respawn? #t - #:start (make-forkexec-constructor '("flatpak" "run" "com.github.wwmm.pulseeffects" "--gapplication-service")) - #:stop (make-kill-destructor))) -#+end_src ** xsettingsd -#+begin_src scheme -(define xsettingsd - (make - #:provides '(xsettingsd) - #:respawn? #t - #:start (make-forkexec-constructor '("xsettingsd")) - #:stop (make-kill-destructor))) +#+begin_src conf :tangle .config/systemd/user/xsettingsd.service +[Unit] +Description=X Settings Daemon + +[Service] +ExecStart=/usr/bin/xsettingsd + +[Install] +WantedBy=wm-session.target #+end_src ** nm-applet -#+begin_src scheme -(define nm-applet - (make - #:provides '(nm-applet) - #:respawn? #t - #:start (make-forkexec-constructor '("nm-applet")) - #:stop (make-kill-destructor))) -#+end_src -** Discord rich presence +#+begin_src conf :tangle .config/systemd/user/nm-applet.service +[Unit] +Description=Network Manager Applet -References: -- [[https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc)][Rich Precense (discord rpc)]] +[Service] +ExecStart=/usr/bin/nm-applet -#+begin_src scheme -(define discord-rich-presence - (make - #:provides '(discord-rich-presence) - #:one-shot? #t - #:start (make-system-constructor "ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-0"))) -#+end_src -** Polkit Authentication agent -Launch an authentication agent. Necessary for stuff like =pkexec=. I suspect I'm not doing that the intended way, but it seems to work. - -#+begin_src scheme -(define polkit-gnome - (make - #:provides '(polkit-gnome) - #:respawn? #t - #:start (make-forkexec-constructor '("/lib/polkit-gnome/polkit-gnome-authentication-agent-1")) - #:stop (make-kill-destructor))) -#+end_src -** Xmodmap -#+begin_src scheme -(define xmodmap - (make - #:provides '(xmodmap) - #:one-shot? #t - #:start (make-system-constructor "xmodmap /home/pavel/.Xmodmap"))) -#+end_src -** VPN -Run my [[file:Guix.org::*OpenVPN][OpenVPN setup]]. Not lauching this automatially, as it requires an active connection. - -#+begin_src scheme -(define vpn - (make - #:provides '(vpn) - #:respawn? #t - #:start (make-forkexec-constructor '("/home/pavel/bin/scripts/vpn-start")) - #:stop (make-kill-destructor))) -#+end_src -** Davmail -#+begin_src scheme -(define davmail - (make - #:provides '(davmail) - #:respawn? #t - #:start (make-forkexec-constructor '("/home/pavel/bin/davmail")) - #:stop (make-kill-destructor))) +[Install] +WantedBy=wm-session.target #+end_src ** vnstatd -#+begin_src scheme -(define vnstatd - (make - #:provides '(vnstatd) - #:respawn? #t - #:start (make-forkexec-constructor '("vnstatd" "-n")) - #:stop (make-kill-destructor))) + +| Arch dependency | +|-----------------| +| vnstat | + +#+begin_src conf :tangle .config/systemd/user/vnstat.service +[Unit] +Description=vnStat network monitor + +[Service] +ExecStart=/usr/bin/vnstatd + +[Install] +WantedBy=wm-session.target #+end_src -** opensnitch -[[https://github.com/evilsocket/opensnitch][opensnitch]] is a linux firewall. +** flameshot +#+begin_src conf :tangle .config/systemd/user/flameshot.service +[Unit] +Description=Flameshot -=sudoers= has to be modified this to work. -#+begin_src scheme -(define opensnitchd - (make - #:provides '(opensnitchd) - #:respawn? #t - #:start (make-forkexec-constructor '("sudo" "opensnitchd")) - #:stop (make-kill-destructor))) +[Service] +ExecStart=/usr/bin/flameshot -(define opensnitch-ui - (make - #:provides '(opensnitch-ui) - #:respawn? #t - #:start (make-forkexec-constructor '("sudo" "opensnitch-ui")) - #:stop (make-kill-destructor))) -#+end_src -** ollama -#+begin_src scheme -(define ollama - (make - #:provides '(ollama) - #:respawn? #t - #:start (make-forkexec-constructor '("ollama" "serve")) - #:stop (make-kill-destructor))) -#+end_src - -** Shepherd config -For some reason, running start on a one-shot service started to hang shepherd, not sure why... Turining these off for now. - -Register services: -#+begin_src scheme -(register-services - mpd - sqrt-data-agent-mpd - deterred-mpd - mcron - aw-server - aw-watcher-afk - aw-watcher-window - pulseeffects - xsettingsd - ;; discord-rich-presence - polkit-gnome - vpn - davmail - ;; xmodmap - nm-applet - vnstatd - ;; opensnitchd - ;; opensnitch-ui - ollama) -#+end_src - -Daemonize shepherd -#+begin_src scheme -(action 'shepherd 'daemonize) -#+end_src - -Run services -#+begin_src scheme -(for-each start '(mpd - sqrt-data-agent-mpd - deterred-mpd - mcron - aw-server - aw-watcher-afk - aw-watcher-window - pulseeffects - xsettingsd - ;; discord-rich-presence - ;; polkit-gnome - davmail - ;; ; xmodmap - ;; nm-applet - vnstatd - ;; opensnitchd - ;; opensnitch-ui - )) +[Install] +WantedBy=wm-session.target #+end_src * Arch settings Other desktop programs I use are listed below. diff --git a/Emacs.org b/Emacs.org index 3e5a814..a2237ab 100644 --- a/Emacs.org +++ b/Emacs.org @@ -11420,6 +11420,7 @@ Or you can load up Element for a moment to see what the mention was, if that's e | Arch dependency | Disabled | |--------------------+----------| | emacs-telega-sever | t | +| telegram-tdlib | | | ttf-unifont | | | gnu-free-fonts | | @@ -11436,10 +11437,8 @@ Or you can load up Element for a moment to see what the mention was, if that's e :background (my/color-value 'fg)) (telega-entity-type-spoiler :background (my/color-value 'base8))) :config - (when (file-exists-p "~/.guix-extra-profiles/emacs/emacs/bin/telega-server") - (setq telega-server-command - (expand-file-name - "~/.guix-extra-profiles/emacs/emacs/bin/telega-server"))) + (setq telega-server-libs-prefix "/usr") + (setq telega-emoji-use-images nil) (setq telega-chat-fill-column 80) (setq telega-completing-read-function #'completing-read) @@ -11463,18 +11462,6 @@ Or you can load up Element for a moment to see what the mention was, if that's e telega-webpage-mode 3 "telega")) #+end_src -Building =telega-server= can create problems. On Guix I can use the Guix package definition, on termux just build manually. -#+begin_src emacs-lisp -(defun my/telega-server-build () - (interactive) - (setq telega-server-libs-prefix - (if (executable-find "guix") - (string-trim - (shell-command-to-string "guix build tdlib")) - (expand-file-name "~/bin/td/build/res/usr/local"))) - (telega-server-build "CC=gcc")) -#+end_src - Setting up the modeline. The default mode string doesn't look great with my other modeline modules, so I override that. #+begin_src emacs-lisp (add-hook 'telega-load-hook #'telega-mode-line-mode) @@ -12795,6 +12782,10 @@ The return value is a list of commands as defined by #+RESULTS: : my/index--mega-commands **** rclone +| Arch dependency | +|-----------------| +| rclone | + This section wraps the [[https://rclone.org/bisync/][bisync]] command for rclone, which implements two-way sync. The general approach is: diff --git a/bin/polybar.sh b/bin/polybar.sh index fbb2ac4..209a857 100755 --- a/bin/polybar.sh +++ b/bin/polybar.sh @@ -12,6 +12,8 @@ elif [ "$hostname" = "eminence" ]; then fi elif [ "$hostname" = "iris" ]; then TRAY_MONITOR="HDMI-1" +elif [ "$hostname" = "weiss" ]; then + TRAY_MONITOR="eDP-1" else TRAY_MONITOR="DP-1" fi From 9dd35d6a9d0a1894a50c25b936a4157412a3d44c Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Thu, 13 Nov 2025 13:34:28 +0300 Subject: [PATCH 08/18] mail: remove MS Exchange from the list --- Mail.org | 2 +- Mail/.notmuch/hooks/pre-new | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Mail.org b/Mail.org index f29038a..75d1204 100644 --- a/Mail.org +++ b/Mail.org @@ -298,7 +298,7 @@ echo "Running pre-new filters" <> echo "Pre-new filters done" -parallel --link -j0 "(cd /home/pavel/Mail/{1}/ && {2} {3})" ::: thexcloud progin6304 pvkorytov_etu ::: "$GMI" "$GMI" "offlineimap" ::: sync sync "" +parallel --link -j0 "(cd /home/pavel/Mail/{1}/ && {2} {3})" ::: thexcloud progin6304 pvkorytov_etu ::: "$GMI" "$GMI" "offlineimap" ::: sync sync "-a pvkorytov-mbox" #+end_src *** =post_new= diff --git a/Mail/.notmuch/hooks/pre-new b/Mail/.notmuch/hooks/pre-new index a747ee5..835b1ff 100755 --- a/Mail/.notmuch/hooks/pre-new +++ b/Mail/.notmuch/hooks/pre-new @@ -35,5 +35,5 @@ notmuch search --output=files "NOT path:pvkorytov_etu_mbox/Etu.Grad_School/cur/* notmuch search --output=files "NOT path:pvkorytov_etu_mbox/Archive/cur/** AND path:pvkorytov_etu_mbox/** AND NOT tag:inbox AND NOT tag:sent AND NOT tag:spam AND NOT tag:trash AND NOT tag:job.digital AND NOT tag:job.digital.docs AND NOT tag:job.digital.support AND NOT tag:job.digital.superservice AND NOT tag:job.digital.applicants AND NOT tag:job.digital.testers AND NOT tag:job.moevm AND NOT tag:etu AND NOT tag:etu.grad-school AND tag:pvkorytov" | xargs -I ! mv ! ~/Mail/pvkorytov_etu_mbox/Archive/cur/ echo "Pre-new filters done" -parallel --link -j0 "(cd /home/pavel/Mail/{1}/ && {2} {3})" ::: thexcloud progin6304 pvkorytov_etu ::: "$GMI" "$GMI" "offlineimap" ::: sync sync "" +parallel --link -j0 "(cd /home/pavel/Mail/{1}/ && {2} {3})" ::: thexcloud progin6304 pvkorytov_etu ::: "$GMI" "$GMI" "offlineimap" ::: sync sync "-a pvkorytov-mbox" # =pre_new=:2 ends here From e57ade6297345a99ba4d918089d557c58486dcac Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Thu, 13 Nov 2025 14:25:08 +0300 Subject: [PATCH 09/18] polybar: fix font --- .config/polybar/config | 5 +++-- .config/rclone/filters-bisync | 3 +++ Desktop.org | 10 +++------- 3 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 .config/rclone/filters-bisync diff --git a/.config/polybar/config b/.config/polybar/config index ef69d82..6011cbe 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -188,8 +188,9 @@ radius = 0.0 font-0 = pango:monospace:size=13;2 font-1 = NotoEmoji:scale=10:antialias=false;1 font-2 = fontawesome:pixelsize=13;3 -font-3 = JetBrains Mono Nerd Font:monospace:size=13;4 -font-4 = JetBrains Mono Nerd Font:monospace:size=17;4 +font-3 = JetBrainsMono Nerd Font:style=Medium,Regular:size=13;4 +font-4 = JetBrainsMono Nerd Font:style=Medium,Regular:size=17;4 +font-5 = Adwaita Mono:style=Regular:size=13;3 ; Global bar config:3 ends here ; [[file:../../Desktop.org::*Global bar config][Global bar config:4]] diff --git a/.config/rclone/filters-bisync b/.config/rclone/filters-bisync new file mode 100644 index 0000000..b411f4e --- /dev/null +++ b/.config/rclone/filters-bisync @@ -0,0 +1,3 @@ +- .* +- ~* +- .debris diff --git a/Desktop.org b/Desktop.org index 7e73e5b..992c663 100644 --- a/Desktop.org +++ b/Desktop.org @@ -2171,16 +2171,12 @@ radius = 0.0 Fonts #+begin_src conf-windows -; font-0 = ${env:FONT0:pango:monospace:size=10;1} -; font-1 = ${env:FONT1:NotoEmoji:scale=10:antialias=false;0} -; font-2 = ${env:FONT2:fontawesome:pixelsize=10;1} -; font-3 = ${env:FONT3:JetBrains Mono Nerd Font:monospace:size=10;1} - font-0 = pango:monospace:size=13;2 font-1 = NotoEmoji:scale=10:antialias=false;1 font-2 = fontawesome:pixelsize=13;3 -font-3 = JetBrains Mono Nerd Font:monospace:size=13;4 -font-4 = JetBrains Mono Nerd Font:monospace:size=17;4 +font-3 = JetBrainsMono Nerd Font:style=Medium,Regular:size=13;4 +font-4 = JetBrainsMono Nerd Font:style=Medium,Regular:size=17;4 +font-5 = Adwaita Mono:style=Regular:size=13;3 #+end_src Modules. Because I sometimes set up different blocks on different monitors, they are set via environment variables. From 2247f9f322a95b8fc44f0265e440b47992e06045 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Thu, 13 Nov 2025 14:30:49 +0300 Subject: [PATCH 10/18] mail: add check-email to systemd timers --- .config/systemd/user/flameshot.service | 8 +++++++ .config/systemd/user/notmuch.service | 6 ++++++ .config/systemd/user/notmuch.timer | 9 ++++++++ Mail.org | 29 +++++++++++++++++++++++--- 4 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 .config/systemd/user/flameshot.service create mode 100644 .config/systemd/user/notmuch.service create mode 100644 .config/systemd/user/notmuch.timer diff --git a/.config/systemd/user/flameshot.service b/.config/systemd/user/flameshot.service new file mode 100644 index 0000000..27a39a9 --- /dev/null +++ b/.config/systemd/user/flameshot.service @@ -0,0 +1,8 @@ +[Unit] +Description=Flameshot + +[Service] +ExecStart=/usr/bin/flameshot + +[Install] +WantedBy=wm-session.target diff --git a/.config/systemd/user/notmuch.service b/.config/systemd/user/notmuch.service new file mode 100644 index 0000000..6b5e210 --- /dev/null +++ b/.config/systemd/user/notmuch.service @@ -0,0 +1,6 @@ +[Unit] +Description=Update notmuch mail index + +[Service] +Type=oneshot +ExecStart=/usr/bin/bash /home/pavel/bin/scripts/check-email diff --git a/.config/systemd/user/notmuch.timer b/.config/systemd/user/notmuch.timer new file mode 100644 index 0000000..84dff16 --- /dev/null +++ b/.config/systemd/user/notmuch.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run notmuch new every 5 minutes + +[Timer] +OnBootSec=1min +OnUnitActiveSec=5min + +[Install] +WantedBy=timers.target diff --git a/Mail.org b/Mail.org index 75d1204..7d735d2 100644 --- a/Mail.org +++ b/Mail.org @@ -358,10 +358,33 @@ fi echo "$(date +%s)" > $CHECK_FILE #+end_src -The script is ran via GNU Mcron every 5 minutes. -#+begin_src scheme :tangle ~/.config/cron/mail.guile -(job "*/5 * * * * " "~/bin/scripts/check-email") +The script is ran via systemd every 5 minutes. +#+begin_src conf :tangle .config/systemd/user/notmuch.service +[Unit] +Description=Update notmuch mail index + +[Service] +Type=oneshot +ExecStart=/usr/bin/bash /home/pavel/bin/scripts/check-email #+end_src + +#+begin_src conf :tangle .config/systemd/user/notmuch.timer +[Unit] +Description=Run notmuch sync script every 5 minutes + +[Timer] +OnBootSec=1min +OnUnitActiveSec=5min + +[Install] +WantedBy=timers.target +#+end_src + +Don't forget to run: +#+begin_src bash +systemctl --user enable --now notmuch.timer +#+end_src + * MSMTP | Arch dependency | |-----------------| From 7ec9be88083e1b14e898d14e09a9c605bbe955ea Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Thu, 13 Nov 2025 14:31:02 +0300 Subject: [PATCH 11/18] console: use ssh-agent from systemd --- .profile | 18 +++--------------- Arch.org | 6 ++++++ Console.org | 33 ++++++++++++++++++++------------- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/.profile b/.profile index 8b486f3..68ef667 100755 --- a/.profile +++ b/.profile @@ -34,21 +34,9 @@ fi # My paths:1 ends here #!/usr/bin/env bash -# [[file:Console.org::*ssh-agent][ssh-agent:1]] -SSH_AGENT_DIR="/tmp" - -if [ "$IS_ANDROID" == "true" ]; then - SSH_AGENT_DIR="/data/data/com.termux/files/tmp" - mkdir -p $SSH_AGENT_DIR -fi - -if ! pgrep -u "$USER" ssh-agent > /dev/null; then - ssh-agent -t 1h > "$SSH_AGENT_DIR/ssh-agent.env" -fi -if [[ ! -f "$SSH_AUTH_SOCK" ]]; then - source "$SSH_AGENT_DIR/ssh-agent.env" >/dev/null -fi -# ssh-agent:1 ends here +# [[file:Console.org::*ssh-agent][ssh-agent:3]] +export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket +# ssh-agent:3 ends here # [[file:Console.org::*Misc settings][Misc settings:1]] export JUPYTER_CONFIG_DIR=$HOME/.config/jupyter diff --git a/Arch.org b/Arch.org index e1467ba..2fa7b3f 100644 --- a/Arch.org +++ b/Arch.org @@ -64,6 +64,12 @@ gpg --edit-key trust #+end_src +Also the following to =~/.ssh/config=: +#+begin_src conf-space +Host * + AddKeysToAgent yes +#+end_src + Then, clone the dotfiles repo with =yadm=: #+begin_src bash yadm clone git@github.com:SqrtMinusOne/dotfiles.git diff --git a/Console.org b/Console.org index a667c85..d99a6f4 100644 --- a/Console.org +++ b/Console.org @@ -87,9 +87,8 @@ fi ** ssh-agent I'm paranoid so I encrypt my SSH keys. -Got the idea for below from [[https://wiki.archlinux.org/title/SSH_keys#SSH_agents][ArchWiki]]: - -#+begin_src bash +I used to do the below, as instructed by [[https://wiki.archlinux.org/title/SSH_keys#SSH_agents][ArchWiki]]: +#+begin_src bash :tangle no SSH_AGENT_DIR="/tmp" if [ "$IS_ANDROID" == "true" ]; then @@ -104,6 +103,16 @@ if [[ ! -f "$SSH_AUTH_SOCK" ]]; then source "$SSH_AGENT_DIR/ssh-agent.env" >/dev/null fi #+end_src + +But for now switched to the [[https://wiki.archlinux.org/title/SSH_keys#Start_ssh-agent_with_systemd_user][systemd unit]], which requires: +#+begin_src bash :tangle no +systemctl --user enable --now ssh-agent.service +#+end_src + +#+begin_src bash +export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket +#+end_src + ** Misc settings Set Jupyter config PATH. I keep it from my Guix config where it defaulted to some readonly folder. #+begin_src sh @@ -713,17 +722,15 @@ References: - [[https://github.com/alacritty/alacritty/blob/master/alacritty.yml][default config]] #+begin_src toml :noweb yes -decorations = "none" - [colors.bright] -Black = "<>" -Red = "<>" -Green = "<>" -Yellow = "<>" -Blue = "<>" -Magenta = "<>" -Cyan = "<>" -White = "<>" +black = "<>" +red = "<>" +green = "<>" +yellow = "<>" +blue = "<>" +magenta = "<>" +cyan = "<>" +white = "<>" [colors.normal] black = "<>" From 1861aa7cf87fb69b4b6b8cd4199bf6f4774719ea Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Fri, 14 Nov 2025 01:22:24 +0300 Subject: [PATCH 12/18] *: update for arch again --- .config/alacritty/alacritty.toml | 26 +++++++-------- .config/bottom/bottom.toml | 4 ++- .config/dunst/dunstrc | 11 ++++--- .config/metapac/groups/browsers.toml | 1 + .config/metapac/groups/console.toml | 1 + .config/metapac/groups/system.toml | 6 ++-- .config/polybar/config | 5 --- .config/qutebrowser/config.py | 8 ++--- .config/rofi/config.rasi | 20 ++++++------ .emacs.d/desktop.el | 3 +- .emacs.d/modules/sqrt-ai.el | 2 +- .emacs.d/modules/sqrt-general-ui.el | 18 +++++----- .emacs.d/modules/sqrt-index.el | 31 ++++++++++-------- .emacs.d/modules/sqrt-org-productivity.el | 2 ++ .emacs.d/modules/sqrt-telega.el | 15 ++------- .emacs.d/modules/sqrt-terms.el | 1 + .emacs.d/modules/sqrt-wakatime.el | 1 + .nix-channels | 1 - .profile | 4 +++ .tmux.line.conf | 6 ++-- Arch.org | 12 +++++-- Console.org | 40 +++++++++++++++++++++-- Desktop.org | 6 ++-- Emacs.org | 20 +++++++----- bin/davmail-6.0.0-3375/davmail.properties | 16 --------- bin/dummies/lsb_release | 8 ----- bin/polybar/aw_afk.sh | 2 +- bin/scripts/activate-profiles | 39 ---------------------- bin/scripts/aw-watcher-afk-wrapper | 5 --- bin/scripts/guix-off | 4 --- 30 files changed, 149 insertions(+), 169 deletions(-) delete mode 100644 .nix-channels delete mode 100644 bin/davmail-6.0.0-3375/davmail.properties delete mode 100755 bin/dummies/lsb_release delete mode 100755 bin/scripts/activate-profiles delete mode 100755 bin/scripts/aw-watcher-afk-wrapper delete mode 100755 bin/scripts/guix-off diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index f31ff14..9bc23eb 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,24 +1,23 @@ -# decorations = "none" - +# [[file:../../Console.org::*Alacritty][Alacritty:1]] [colors.bright] black = "#484848" -blue = "#cbcfff" -cyan = "#88c8ff" -green = "#8adf80" -magenta = "#df8fff" -red = "#ff8f88" +red = "#d00000" +green = "#008900" +yellow = "#808000" +blue = "#0000ff" +magenta = "#dd22dd" +cyan = "#008899" white = "#ffffff" -yellow = "#fac200" [colors.normal] black = "#222222" -blue = "#375cd8" -cyan = "#1f6fbf" -green = "#217a3c" -magenta = "#ba35af" red = "#cc3333" -white = "#fff8f0" +green = "#217a3c" yellow = "#8a5d00" +blue = "#375cd8" +magenta = "#ba35af" +cyan = "#1f6fbf" +white = "#fff8f0" [colors.primary] background = "#fff8f0" @@ -150,3 +149,4 @@ x = 0 y = 0 [keyboard] +# Alacritty:1 ends here diff --git a/.config/bottom/bottom.toml b/.config/bottom/bottom.toml index c2e2390..ca88482 100644 --- a/.config/bottom/bottom.toml +++ b/.config/bottom/bottom.toml @@ -1,7 +1,9 @@ [flags] hide_table_gap = true # Remove space in tables -color = "default-light" process_command = true +[styles] +theme = "default-light" + [processes] columns = ["PID", "State", "Name", "CPU%", "Mem%", "R/s", "W/s", "User"] diff --git a/.config/dunst/dunstrc b/.config/dunst/dunstrc index 9424584..686431c 100644 --- a/.config/dunst/dunstrc +++ b/.config/dunst/dunstrc @@ -53,7 +53,7 @@ ### Misc/Advanced ### dmenu = /usr/bin/dmenu -p dunst: - browser = /home/pavel/.guix-extra-profiles/browsers/browsers/bin/firefox + browser = /user/bin/firefox always_run_script = true title = Dunst class = Dunst @@ -69,15 +69,16 @@ mouse_middle_click = do_action mouse_right_click = close_all -[experimental] - per_monitor_dpi = false - -[shortcuts] + ### Shortcuts close = ctrl+space close_all = ctrl+shift+space history = ctrl+grave context = ctrl+shift+period +[experimental] + per_monitor_dpi = false + + [urgency_low] background = "#f6ece8" frame_color = "#baafba" diff --git a/.config/metapac/groups/browsers.toml b/.config/metapac/groups/browsers.toml index 5ecd895..d9e87a6 100644 --- a/.config/metapac/groups/browsers.toml +++ b/.config/metapac/groups/browsers.toml @@ -1,3 +1,4 @@ arch = [ +"firefox-tridactyl", "firefox", "ungoogled-chromium-bin",] diff --git a/.config/metapac/groups/console.toml b/.config/metapac/groups/console.toml index 07aabbf..ba4f6a0 100644 --- a/.config/metapac/groups/console.toml +++ b/.config/metapac/groups/console.toml @@ -28,6 +28,7 @@ arch = [ "tmux", "starship", "nushell", +"atuin", "shell-color-scripts-git", "fish", "xorg-xhost", diff --git a/.config/metapac/groups/system.toml b/.config/metapac/groups/system.toml index 3a9fe94..cf29180 100644 --- a/.config/metapac/groups/system.toml +++ b/.config/metapac/groups/system.toml @@ -8,12 +8,13 @@ arch = [ "libva-intel-driver", "zram-generator", "yadm", -"wpa_supplicant", +"wireplumber", "wireless_tools", "wget", "xterm", "vim", "smartmontools", +"sof-firmware", "pipewire-jack", "pipewire-pulse", "pipewire-alsa", @@ -34,4 +35,5 @@ arch = [ "grub", "decman", "base-devel", -"base",] +"base", +"amneziavpn-bin",] diff --git a/.config/polybar/config b/.config/polybar/config index 6011cbe..7bb6eb4 100644 --- a/.config/polybar/config +++ b/.config/polybar/config @@ -180,11 +180,6 @@ radius = 0.0 ; Global bar config:2 ends here ; [[file:../../Desktop.org::*Global bar config][Global bar config:3]] -; font-0 = ${env:FONT0:pango:monospace:size=10;1} -; font-1 = ${env:FONT1:NotoEmoji:scale=10:antialias=false;0} -; font-2 = ${env:FONT2:fontawesome:pixelsize=10;1} -; font-3 = ${env:FONT3:JetBrains Mono Nerd Font:monospace:size=10;1} - font-0 = pango:monospace:size=13;2 font-1 = NotoEmoji:scale=10:antialias=false;1 font-2 = fontawesome:pixelsize=13;3 diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index b34ce86..5532d97 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -39,13 +39,13 @@ palette = { # 'background': '#282a36', 'background-alt': "#f6ece8", # 'background-alt': '#282a36', - 'background-attention': "#ff8f88", + 'background-attention': "#d00000", # 'background-attention': '#181920', 'border': "#baafba", # 'border': '#282a36', - 'current-line': "#5f5f5f", + 'current-line': "#9da4b3", # 'current-line': '#44475a', - 'selection': "#5f5f5f", + 'selection': "#9da4b3", # 'selection': '#44475a', 'foreground': "#222222", # 'foreground': '#f8f8f2', @@ -61,7 +61,7 @@ palette = { # 'green': '#50fa7b', 'orange': "#8f5a3a", # 'orange': '#ffb86c', - 'pink': "#df8fff", + 'pink': "#dd22dd", # 'pink': '#ff79c6', 'purple': "#6052cf", # 'purple': '#bd93f9', diff --git a/.config/rofi/config.rasi b/.config/rofi/config.rasi index faab084..ee4b538 100644 --- a/.config/rofi/config.rasi +++ b/.config/rofi/config.rasi @@ -9,12 +9,12 @@ cyan: #1f6fbf; white: #fff8f0; light-black: #484848; - light-red: #ff8f88; - light-green: #8adf80; - light-yellow: #fac200; - light-blue: #cbcfff; - light-magenta: #df8fff; - light-cyan: #88c8ff; + light-red: #d00000; + light-green: #008900; + light-yellow: #808000; + light-blue: #0000ff; + light-magenta: #dd22dd; + light-cyan: #008899; light-white: #ffffff; @@ -25,8 +25,8 @@ border-color: #baafba; selected-normal-background: #375cd8; selected-normal-foreground: #fff8f0; - selected-active-background: #cbcfff; - selected-active-foreground: #222222; + selected-active-background: #0000ff; + selected-active-foreground: #fff8f0; selected-urgent-background: #cc3333; selected-urgent-foreground: #fff8f0; normal-foreground: @foreground; @@ -37,8 +37,8 @@ urgent-background: @background; alternate-normal-background: #f6ece8; alternate-normal-foreground: @foreground; - alternate-active-background: #222222; - alternate-active-foreground: #cbcfff; + alternate-active-background: #fff8f0; + alternate-active-foreground: #0000ff; alternate-urgent-background: #fff8f0; alternate-urgent-foreground: #cc3333; spacing: 2; diff --git a/.emacs.d/desktop.el b/.emacs.d/desktop.el index d43d12f..b268d78 100644 --- a/.emacs.d/desktop.el +++ b/.emacs.d/desktop.el @@ -592,11 +592,12 @@ _d_: Discord (defun my/exwm-init () (exwm-workspace-switch 1) - (my/exwm-run-polybar) (my/exwm-set-wallpaper) (my/exwm-run-shepherd) (my/exwm-run-systemd) (my/run-in-background "gpgconf --reload gpg-agent") + (my/exwm-run-polybar) + (setenv "DBUS_SESSION_BUS_ADDRESS" "unix:path=/run/user/1000/bus") (when (my/is-arch) (my/run-in-background "set_layout"))) diff --git a/.emacs.d/modules/sqrt-ai.el b/.emacs.d/modules/sqrt-ai.el index 8a4ed9c..d228a9f 100644 --- a/.emacs.d/modules/sqrt-ai.el +++ b/.emacs.d/modules/sqrt-ai.el @@ -28,7 +28,7 @@ :key (lambda () (my/password-store-get-field "My_Online/Accounts/openrouter" "api-key")) :stream t - :models '("anthropic/claude-sonnet-4" + :models '("anthropic/claude-sonnet-4.5" "qwen/qwen3-coder" "qwen/qwen3-coder:free")) (setq gptel--known-backends diff --git a/.emacs.d/modules/sqrt-general-ui.el b/.emacs.d/modules/sqrt-general-ui.el index 4e9994a..78078d7 100644 --- a/.emacs.d/modules/sqrt-general-ui.el +++ b/.emacs.d/modules/sqrt-general-ui.el @@ -137,11 +137,12 @@ (t (doom-color color))))))) (defun my/modus-get-base (color) - (let ((base-value (string-to-number (substring (symbol-name color) 4 5))) - (base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette - (or (my/modus-p) (my/ef-p)))))) - (base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette - (or (my/modus-p) (my/ef-p))))))) + (let* ((base-value (string-to-number (substring (symbol-name color) 4 5))) + (palette (modus-themes-get-theme-palette + (or (my/modus-p) (my/ef-p)) + :with-overrides :with-user-palette)) + (base-start (cadr (assoc 'bg-main palette))) + (base-end (cadr (assoc 'fg-dim palette)))) (nth base-value (ct-gradient 9 base-start base-end t)))) (defun my/prot-color (color palette) @@ -181,10 +182,11 @@ (t (cadr (assoc color palette)))))) (defun my/modus-color (color) - (my/prot-color color (modus-themes-get-theme-palette (my/modus-p)))) + (my/prot-color color (modus-themes-get-theme-palette + (or (my/modus-p) (my/ef-p)) + :with-overrides :with-user-palette))) -(defun my/ef-color (color) - (my/prot-color color (modus-themes-get-theme-palette (my/ef-p)))) +(defalias 'my/ef-color 'my/modus-color) (defconst my/test-colors-list '(black red green yellow blue magenta cyan white light-black diff --git a/.emacs.d/modules/sqrt-index.el b/.emacs.d/modules/sqrt-index.el index d6e9ff6..d4c6bb8 100644 --- a/.emacs.d/modules/sqrt-index.el +++ b/.emacs.d/modules/sqrt-index.el @@ -463,21 +463,24 @@ def rclone_run_all(folders): total_transfers += res.get('stats', {}).get('transfers', 0) total_deleted += res.get('stats', {}).get('deletes', 0) total_renamed += res.get('stats', {}).get('renames', 0) + + msg = '' + level = 'normal' + if total_transfers > 0: + msg += f'''Transferred {total_transfers} files ({sizeof_fmt(total_bytes)})\n''' + if total_deleted > 0: + msg += f'''Deleted {total_transfers} files\n''' + if total_renamed > 0: + msg += f'''Renamed {total_renamed} files\n''' + if len(error_folders) > 0: - error_msg = f'Sync error for remote {REMOTE}!' + msg += '''\nSync errors for the following folders:''' for folder in error_folders: - error_msg += '''\n- ''' + folder - notify(f'rclone sync {REMOTE}', error_msg, level='critical') - else: - msg = '' - if total_transfers > 0: - msg += f'''Transferred {total_transfers} files ({sizeof_fmt(total_bytes)})\n''' - if total_deleted > 0: - msg += f'''Deleted {total_transfers} files\n''' - if total_renamed > 0: - msg += f'''Renamed {total_renamed} files\n''' - if len(msg) > 0: - notify(f'rclone sync {REMOTE}', msg) + msg += '''\n- ''' + folder + level = 'critical' + + if len(msg) > 0: + notify(f'rclone sync {REMOTE}', msg, level=level) if __name__ == '__main__': rclone_run_all(FOLDERS) @@ -583,7 +586,7 @@ The return value is a list of commands as defined by E.g. 10.03.R.01 Project Name -> Project Name." (replace-regexp-in-string - (rx bos (+ (| num alpha "." "-")) space) "" name)) + (rx bos (+ num) (? "." (+ (| num alpha "." "-"))) space) "" name)) (defun my/index--wakatime-escape (string) "Escape STRING for use in a WakaTime config file." diff --git a/.emacs.d/modules/sqrt-org-productivity.el b/.emacs.d/modules/sqrt-org-productivity.el index 6b08d1a..947d1e7 100644 --- a/.emacs.d/modules/sqrt-org-productivity.el +++ b/.emacs.d/modules/sqrt-org-productivity.el @@ -152,6 +152,8 @@ (org-element-property :end element)))) (with-temp-buffer (insert s) + (let (org-mode-hook) + (org-mode)) (org-clock-sum) org-clock-file-total-minutes))) diff --git a/.emacs.d/modules/sqrt-telega.el b/.emacs.d/modules/sqrt-telega.el index 4710ffc..b9aa369 100644 --- a/.emacs.d/modules/sqrt-telega.el +++ b/.emacs.d/modules/sqrt-telega.el @@ -11,10 +11,8 @@ :background (my/color-value 'fg)) (telega-entity-type-spoiler :background (my/color-value 'base8))) :config - (when (file-exists-p "~/.guix-extra-profiles/emacs/emacs/bin/telega-server") - (setq telega-server-command - (expand-file-name - "~/.guix-extra-profiles/emacs/emacs/bin/telega-server"))) + (setq telega-server-libs-prefix "/usr") + (setq telega-emoji-use-images nil) (setq telega-chat-fill-column 80) (setq telega-completing-read-function #'completing-read) @@ -37,15 +35,6 @@ telega-image-mode 3 "telega" telega-webpage-mode 3 "telega")) -(defun my/telega-server-build () - (interactive) - (setq telega-server-libs-prefix - (if (executable-find "guix") - (string-trim - (shell-command-to-string "guix build tdlib")) - (expand-file-name "~/bin/td/build/res/usr/local"))) - (telega-server-build "CC=gcc")) - (add-hook 'telega-load-hook #'telega-mode-line-mode) (setq telega-mode-line-string-format '("[" diff --git a/.emacs.d/modules/sqrt-terms.el b/.emacs.d/modules/sqrt-terms.el index 7b2f16b..45000d5 100644 --- a/.emacs.d/modules/sqrt-terms.el +++ b/.emacs.d/modules/sqrt-terms.el @@ -346,6 +346,7 @@ (use-package eshell-atuin :straight (:host github :repo "SqrtMinusOne/eshell-atuin") + :when (executable-find "atuin") :after eshell :config (eshell-atuin-mode) diff --git a/.emacs.d/modules/sqrt-wakatime.el b/.emacs.d/modules/sqrt-wakatime.el index dcda0f0..e92f945 100644 --- a/.emacs.d/modules/sqrt-wakatime.el +++ b/.emacs.d/modules/sqrt-wakatime.el @@ -6,6 +6,7 @@ (advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path (or + (executable-find "wakatime") (executable-find "wakatime-cli") (expand-file-name "~/bin/wakatime-cli"))))) (when (file-exists-p "~/.wakatime.cfg") diff --git a/.nix-channels b/.nix-channels deleted file mode 100644 index f0c6733..0000000 --- a/.nix-channels +++ /dev/null @@ -1 +0,0 @@ -https://nixos.org/channels/nixpkgs-unstable nixpkgs diff --git a/.profile b/.profile index 68ef667..393c3ab 100755 --- a/.profile +++ b/.profile @@ -46,6 +46,10 @@ export JUPYTER_CONFIG_DIR=$HOME/.config/jupyter export GIO_EXTRA_MODULES="" # Misc settings:2 ends here +# [[file:Console.org::*Misc settings][Misc settings:3]] +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +# Misc settings:3 ends here + # [[file:Console.org::*Other package managers][Other package managers:1]] if [ -d "$HOME/.cask" ]; then export PATH="/home/pavel/.cask/bin:$PATH" diff --git a/.tmux.line.conf b/.tmux.line.conf index 98bd9b1..abd3568 100644 --- a/.tmux.line.conf +++ b/.tmux.line.conf @@ -13,8 +13,8 @@ set -g status-left-length "100" setw -g window-status-activity-style "none,fg=#375cd8,bg=#f6ece8" setw -g window-status-separator "" setw -g window-status-style "none,fg=#222222,bg=#f6ece8" -set -g status-left "#[fg=#fff8f0,bg=#375cd8] #S #[fg=#375cd8,bg=#cbcfff,nobold,nounderscore,noitalics]#[fg=#222222,bg=#cbcfff] #W #[fg=#cbcfff,bg=#f6ece8,nobold,nounderscore,noitalics]" -set -g status-right "%-H:%M #[bg=#f6ece8,fg=#cbcfff,nobold,nounderscore,noitalics]#[fg=#222222,bg=#cbcfff] %a, %b %d #[bg=#cbcfff,fg=#375cd8,nobold,nounderscore,noitalics]#[fg=#fff8f0,bg=#375cd8] #H " -setw -g window-status-format "#[fg=#f6ece8,bg=#cbcfff,nobold,nounderscore,noitalics]#[fg=#222222,bg=#cbcfff] #I #W #[align=left] #[fg=#cbcfff,bg=#f6ece8,nobold,nounderscore,noitalics]" +set -g status-left "#[fg=#fff8f0,bg=#375cd8] #S #[fg=#375cd8,bg=#0000ff,nobold,nounderscore,noitalics]#[fg=#fff8f0,bg=#0000ff] #W #[fg=#0000ff,bg=#f6ece8,nobold,nounderscore,noitalics]" +set -g status-right "%-H:%M #[bg=#f6ece8,fg=#0000ff,nobold,nounderscore,noitalics]#[fg=#fff8f0,bg=#0000ff] %a, %b %d #[bg=#0000ff,fg=#375cd8,nobold,nounderscore,noitalics]#[fg=#fff8f0,bg=#375cd8] #H " +setw -g window-status-format "#[fg=#f6ece8,bg=#0000ff,nobold,nounderscore,noitalics]#[fg=#fff8f0,bg=#0000ff] #I #W #[align=left] #[fg=#0000ff,bg=#f6ece8,nobold,nounderscore,noitalics]" setw -g window-status-current-format "#[fg=#f6ece8,bg=#375cd8,nobold,nounderscore,noitalics]#[fg=#fff8f0,bg=#375cd8] #I #W #[fg=#375cd8,bg=#f6ece8,nobold,nounderscore,noitalics]" # UI:1 ends here diff --git a/Arch.org b/Arch.org index 2fa7b3f..8a64a4a 100644 --- a/Arch.org +++ b/Arch.org @@ -110,6 +110,7 @@ api_key = Then run =emacs= and make sure it starts. Run: - =M-x nerd-icons-install-fonts= - =M-x all-the-icons-install-fonts= +- =M-x treesit-install-language-grammar= Run =rclone config=, configure the remotes. Then =M-x my/index-commands-sync=. @@ -120,6 +121,11 @@ Create some directories: mkdir -p /home/pavel/Pictures/screenshots/ #+end_src +Also run: +#+begin_src bash +sudo chmod +s /usr/bin/light +#+end_src + * Metapac configuration [[https://github.com/ripytide/metapac][metapac]] is a declarative wrapper around different package managers, including [[https://wiki.archlinux.org/title/Pacman][pacman]] and [[https://github.com/Morganamilo/paru][paru]]. This means the required packages can be listed in configuration files and checked into version control. @@ -179,6 +185,7 @@ package_manager = "paru" Some necessary Arch packages: | Arch dependency | |---------------------| +| amneziavpn-bin | | base | | base-devel | | decman | @@ -200,12 +207,13 @@ Some necessary Arch packages: | pipewire-alsa | | pipewire-pulse | | pipewire-jack | +| sof-firmware | | smartmontools | | vim | | xterm | | wget | | wireless_tools | -| wpa_supplicant | +| wireplumber | | yadm | | zram-generator | @@ -226,5 +234,5 @@ Various drivers, I'm not sure which I actually need, so... #+end_src #+begin_src scheme :tangle .config/metapac/groups/system.toml :noweb yes -<ger> +<> #+end_src diff --git a/Console.org b/Console.org index d99a6f4..bd5b8ae 100644 --- a/Console.org +++ b/Console.org @@ -123,6 +123,13 @@ Somehow LibreOffice doesn't work without the following: #+begin_src sh export GIO_EXTRA_MODULES="" #+end_src + +Not sure why this is necessary. + +#+begin_src sh +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus +#+end_src + ** Other package managers Using other package managers requires some extra work. @@ -504,6 +511,11 @@ if type -q direnv end #+end_src ** atuin + +| Arch dependency | +|-----------------| +| atuin | + #+begin_src fish if type -q atuin set -gx ATUIN_NOBIND "true" @@ -743,8 +755,8 @@ cyan = "<>" white = "<>" [colors.primary] -background: "<>" -foreground: "<>" +background = "<>" +foreground = "<>" [env] TERM = "xterm-256color" @@ -890,9 +902,11 @@ See the [[https://github.com/ClementTsang/bottom/blob/master/sample_configs/defa #+begin_src toml :tangle .config/bottom/bottom.toml :noweb yes [flags] hide_table_gap = true # Remove space in tables -color = "<>" process_command = true +[styles] +theme = "<>" + [processes] columns = ["PID", "State", "Name", "CPU%", "Mem%", "R/s", "W/s", "User"] #+end_src @@ -1061,6 +1075,26 @@ fi (job "0 * * * *" "autocommit /home/pavel/30-39\\ Life/32\\ org-mode/") (job "0,15,30,45 * * * *" "autocommit ~/.password-store") #+end_src + +Systemd timers: +#+begin_src conf :tangle .config/systemd/user/autocommit-org-mode.service +[Unit] +Description=Autocommit org-mode + +[Service] +Type=oneshot +ExecStart=/usr/bin/bash /home/pavel/bin/scripts/autocommit "/home/pavel/30-39 Life/32 org-mode" +#+end_src + +#+begin_src conf :tangle .config/systemd/user/autocommit-password-store.service +[Unit] +Description=Autocommit .password-store + +[Service] +Type=oneshot +ExecStart=/usr/bin/bash /home/pavel/bin/scripts/autocommit "/home/pavel/.password-store" +#+end_src + * Arch settings #+NAME: packages #+begin_src emacs-lisp :tangle no diff --git a/Desktop.org b/Desktop.org index 992c663..18ff546 100644 --- a/Desktop.org +++ b/Desktop.org @@ -1217,11 +1217,12 @@ And the EXWM config itself. (defun my/exwm-init () (exwm-workspace-switch 1) - (my/exwm-run-polybar) (my/exwm-set-wallpaper) (my/exwm-run-shepherd) (my/exwm-run-systemd) (my/run-in-background "gpgconf --reload gpg-agent") + (my/exwm-run-polybar) + (setenv "DBUS_SESSION_BUS_ADDRESS" "unix:path=/run/user/1000/bus") (when (my/is-arch) (my/run-in-background "set_layout"))) @@ -2815,7 +2816,7 @@ afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_$ status=$(echo ${afk_event} | jq -r '.[0].data.status') afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d @! +"%H:%M") -uptime=$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! +"%H:%M") +uptime=$(date -ud @$(uptime -r | awk '{print $2}') +%H:%M) res="${afk_time} / ${uptime}" if [[ $status == 'afk' ]]; then # echo "%{u<>}%{+u} [AFK] $res %{u-}" @@ -4225,6 +4226,7 @@ This section generates manifests for various desktop software that I'm using. |----------+------------------------| | browsers | ungoogled-chromium-bin | | browsers | firefox | +| browsers | firefox-tridactyl | ** Office & Multimedia | Category | Arch dependency | |----------+-----------------| diff --git a/Emacs.org b/Emacs.org index 5b3132e..957f153 100644 --- a/Emacs.org +++ b/Emacs.org @@ -2435,11 +2435,12 @@ Now, let's get the current color from =doom=. =doom-themes= provide =doom-color= And the same for =modus-themes=. =my/modus-color= has to accept the same arguments as I use for =my/doom-color= for backward compatibility, which requires a bit more tuning. #+begin_src emacs-lisp (defun my/modus-get-base (color) - (let ((base-value (string-to-number (substring (symbol-name color) 4 5))) - (base-start (cadr (assoc 'bg-main (modus-themes-get-theme-palette - (or (my/modus-p) (my/ef-p)))))) - (base-end (cadr (assoc 'fg-dim (modus-themes-get-theme-palette - (or (my/modus-p) (my/ef-p))))))) + (let* ((base-value (string-to-number (substring (symbol-name color) 4 5))) + (palette (modus-themes-get-theme-palette + (or (my/modus-p) (my/ef-p)) + :with-overrides :with-user-palette)) + (base-start (cadr (assoc 'bg-main palette))) + (base-end (cadr (assoc 'fg-dim palette)))) (nth base-value (ct-gradient 9 base-start base-end t)))) (defun my/prot-color (color palette) @@ -2479,10 +2480,11 @@ And the same for =modus-themes=. =my/modus-color= has to accept the same argumen (t (cadr (assoc color palette)))))) (defun my/modus-color (color) - (my/prot-color color (modus-themes-get-theme-palette (my/modus-p)))) + (my/prot-color color (modus-themes-get-theme-palette + (or (my/modus-p) (my/ef-p)) + :with-overrides :with-user-palette))) -(defun my/ef-color (color) - (my/prot-color color (modus-themes-get-theme-palette (my/ef-p)))) +(defalias 'my/ef-color 'my/modus-color) #+end_src Test the three functions. @@ -6163,6 +6165,8 @@ We can get the clocked value in minutes with =org-clock-sum=. This weird functio (org-element-property :end element)))) (with-temp-buffer (insert s) + (let (org-mode-hook) + (org-mode)) (org-clock-sum) org-clock-file-total-minutes))) #+end_src diff --git a/bin/davmail-6.0.0-3375/davmail.properties b/bin/davmail-6.0.0-3375/davmail.properties deleted file mode 100644 index aaaa8aa..0000000 --- a/bin/davmail-6.0.0-3375/davmail.properties +++ /dev/null @@ -1,16 +0,0 @@ -# [[file:../../Mail.org::*DavMail][DavMail:1]] -davmail.server=true -davmail.mode=Auto -davmail.url=https://mail.etu.ru/owa/ - -davmail.server.certificate.hash=0C:9E:CF:D3:62:26:DB:FA:F1:EE:36:9D:60:E7:31:71:CF:1F:92:85 - -davmail.caldavPort=1080 -davmail.imapPort=1143 -davmail.ldapPort=1389 -davmail.popPort=1110 -davmail.smtpPort=1025 - -davmail.imapAutoExpunge=false -davmail.enableKeepalive=false -# DavMail:1 ends here diff --git a/bin/dummies/lsb_release b/bin/dummies/lsb_release deleted file mode 100755 index fd96c3b..0000000 --- a/bin/dummies/lsb_release +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -# [[file:../../Guix.org::*Slack][Slack:2]] -echo "LSB Version: Hey. I spent an hour figuring out why Slack doesn't launch." -echo "Distributor ID: It seems like it requires an lsb_release." -echo "Description: But GNU Guix doesn't have one." -echo "Release: 42.2" -echo "Codename: n/a" -# Slack:2 ends here diff --git a/bin/polybar/aw_afk.sh b/bin/polybar/aw_afk.sh index b30c92e..18e1687 100755 --- a/bin/polybar/aw_afk.sh +++ b/bin/polybar/aw_afk.sh @@ -4,7 +4,7 @@ afk_event=$(curl -s -X GET "http://localhost:5600/api/0/buckets/aw-watcher-afk_$ status=$(echo ${afk_event} | jq -r '.[0].data.status') afk_time=$(echo "${afk_event}" | jq -r '.[0].duration' | xargs -I ! date -u -d @! +"%H:%M") -uptime=$(uptime | awk '{ print substr($3, 0, length($3) - 1) }' | xargs -I ! date -d ! +"%H:%M") +uptime=$(date -ud @$(uptime -r | awk '{print $2}') +%H:%M) res="${afk_time} / ${uptime}" if [[ $status == 'afk' ]]; then # echo "%{u#cc3333}%{+u} [AFK] $res %{u-}" diff --git a/bin/scripts/activate-profiles b/bin/scripts/activate-profiles deleted file mode 100755 index f7b8d54..0000000 --- a/bin/scripts/activate-profiles +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# [[file:../../Guix.org::*Activate profiles][Activate profiles:1]] -GREEN='\033[1;32m' -RED='\033[1;30m' -NC='\033[0m' -GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles - -profiles=$* -if [[ $# -eq 0 ]]; then - profiles="$HOME/.config/guix/manifests/*.scm"; -fi - -for profile in $profiles; do - # Remove the path and file extension, if any - profileName=$(basename $profile) - profileName="${profileName%.*}" - profilePath="$GUIX_EXTRA_PROFILES/$profileName" - manifestPath=$HOME/.config/guix/manifests/$profileName.scm - - if [ -f $manifestPath ]; then - echo - echo -e "${GREEN}Activating profile:" $manifestPath "${NC}" - echo - - mkdir -p $profilePath - guix package --manifest=$manifestPath --profile="$profilePath/$profileName" - - # Source the new profile - GUIX_PROFILE="$profilePath/$profileName" - if [ -f $GUIX_PROFILE/etc/profile ]; then - . "$GUIX_PROFILE"/etc/profile - else - echo -e "${RED}Couldn't find profile:" $GUIX_PROFILE/etc/profile "${NC}" - fi - else - echo "No profile found at path" $profilePath - fi -done -# Activate profiles:1 ends here diff --git a/bin/scripts/aw-watcher-afk-wrapper b/bin/scripts/aw-watcher-afk-wrapper deleted file mode 100755 index d01610d..0000000 --- a/bin/scripts/aw-watcher-afk-wrapper +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -# [[file:../../Desktop.org::*ActivityWatch][ActivityWatch:2]] -sleep 5 -aw-watcher-afk -# ActivityWatch:2 ends here diff --git a/bin/scripts/guix-off b/bin/scripts/guix-off deleted file mode 100755 index e4c2e79..0000000 --- a/bin/scripts/guix-off +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -# [[file:../../Guix.org::*Turn off Guix profiles][Turn off Guix profiles:1]] -export PATH=$(echo $PATH | tr ":" "\n" | grep -vE "guix|nix|gnu" | tr "\n" ":") -# Turn off Guix profiles:1 ends here From 9bc24714b4aa71c3f3866e284dfe3ea905e16be2 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Tue, 18 Nov 2025 10:48:19 +0300 Subject: [PATCH 13/18] console: fix micromamba for Arch --- .bashrc | 4 ++-- .config/fish/config.fish | 4 ++-- Console.org | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.bashrc b/.bashrc index 38cd094..7bce6d6 100644 --- a/.bashrc +++ b/.bashrc @@ -129,9 +129,9 @@ fi # [[file:Console.org::*Micromamba][Micromamba:1]] init_mamba () { - export MAMBA_EXE="/home/pavel/.guix-extra-profiles/dev/dev/bin/micromamba"; + export MAMBA_EXE="/usr/bin/micromamba"; export MAMBA_ROOT_PREFIX="/home/pavel/micromamba"; - __mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)" + __mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__mamba_setup" else diff --git a/.config/fish/config.fish b/.config/fish/config.fish index 73883c4..e0ce685 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -38,9 +38,9 @@ set fish_greeting # [[file:../../Console.org::*Micromamba][Micromamba:1]] function init_mamba - set -gx MAMBA_EXE "/home/pavel/.guix-extra-profiles/dev/dev/bin/micromamba" + set -gx MAMBA_EXE "/usr/bin/micromamba" set -gx MAMBA_ROOT_PREFIX "/home/pavel/micromamba" - $MAMBA_EXE shell hook --shell fish --prefix $MAMBA_ROOT_PREFIX | source + $MAMBA_EXE shell hook --shell fish --root-prefix $MAMBA_ROOT_PREFIX | source end if test -n "$INIT_MAMBA"; diff --git a/Console.org b/Console.org index bd5b8ae..c3224f6 100644 --- a/Console.org +++ b/Console.org @@ -358,9 +358,9 @@ Yeah, tell this to yourself #+begin_src bash init_mamba () { - export MAMBA_EXE="/home/pavel/.guix-extra-profiles/dev/dev/bin/micromamba"; + export MAMBA_EXE="/usr/bin/micromamba"; export MAMBA_ROOT_PREFIX="/home/pavel/micromamba"; - __mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)" + __mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__mamba_setup" else @@ -455,9 +455,9 @@ set fish_greeting First, a function to initialize micromamba. #+begin_src fish function init_mamba - set -gx MAMBA_EXE "/home/pavel/.guix-extra-profiles/dev/dev/bin/micromamba" + set -gx MAMBA_EXE "/usr/bin/micromamba" set -gx MAMBA_ROOT_PREFIX "/home/pavel/micromamba" - $MAMBA_EXE shell hook --shell fish --prefix $MAMBA_ROOT_PREFIX | source + $MAMBA_EXE shell hook --shell fish --root-prefix $MAMBA_ROOT_PREFIX | source end if test -n "$INIT_MAMBA"; From d67006bfcee14b6fb8f0cf17868129668ceeae63 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Tue, 18 Nov 2025 10:49:17 +0300 Subject: [PATCH 14/18] desktop: ponymix -> wpctl --- .emacs.d/desktop.el | 6 +++--- Desktop.org | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.emacs.d/desktop.el b/.emacs.d/desktop.el index b268d78..9e6bc17 100644 --- a/.emacs.d/desktop.el +++ b/.emacs.d/desktop.el @@ -702,11 +702,11 @@ _d_: Discord (,(kbd "s-i") . ,(my/app-command "copyq menu")) ;; Basic controls - (,(kbd "") . ,(my/app-command "ponymix increase 5 --max-volume 150")) - (,(kbd "") . ,(my/app-command "ponymix decrease 5 --max-volume 150")) + (,(kbd "") . ,(my/app-command "wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+")) + (,(kbd "") . ,(my/app-command "wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-")) (,(kbd "") . ,(my/app-command "light -A 5")) (,(kbd "") . ,(my/app-command "light -U 5")) - (,(kbd "") . ,(my/app-command "ponymix toggle")) + (,(kbd "") . ,(my/app-command "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle")) (,(kbd "") . ,(my/app-command "mpc toggle")) (,(kbd "") . ,(my/app-command "mpc pause")) diff --git a/Desktop.org b/Desktop.org index 18ff546..67a2867 100644 --- a/Desktop.org +++ b/Desktop.org @@ -906,11 +906,11 @@ And keybindings that are available in both =char-mode= and =line-mode=: (,(kbd "s-i") . ,(my/app-command "copyq menu")) ;; Basic controls - (,(kbd "") . ,(my/app-command "ponymix increase 5 --max-volume 150")) - (,(kbd "") . ,(my/app-command "ponymix decrease 5 --max-volume 150")) + (,(kbd "") . ,(my/app-command "wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+")) + (,(kbd "") . ,(my/app-command "wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-")) (,(kbd "") . ,(my/app-command "light -A 5")) (,(kbd "") . ,(my/app-command "light -U 5")) - (,(kbd "") . ,(my/app-command "ponymix toggle")) + (,(kbd "") . ,(my/app-command "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle")) (,(kbd "") . ,(my/app-command "mpc toggle")) (,(kbd "") . ,(my/app-command "mpc pause")) From db033371c3f6ac86374480dff66912d78ef35892 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Sun, 23 Nov 2025 14:41:40 +0300 Subject: [PATCH 15/18] arch: update software --- .config/metapac/groups/dev.toml | 2 ++ .config/metapac/groups/latex.toml | 1 + .config/metapac/groups/office.toml | 1 + .config/rclone/filters-bisync | 1 - Arch.org | 8 ++++++++ Desktop.org | 26 +++++++++++++++----------- Emacs.org | 1 - 7 files changed, 27 insertions(+), 13 deletions(-) diff --git a/.config/metapac/groups/dev.toml b/.config/metapac/groups/dev.toml index f2e2449..7085547 100644 --- a/.config/metapac/groups/dev.toml +++ b/.config/metapac/groups/dev.toml @@ -1,4 +1,5 @@ arch = [ +"dbeaver", "rust", "git", "wireshark-qt", @@ -25,6 +26,7 @@ arch = [ "libvirt", "virt-manager", "postgresql", +"docker-compose", "docker", "pandoc-cli", "micromamba-bin",] diff --git a/.config/metapac/groups/latex.toml b/.config/metapac/groups/latex.toml index 57f35e3..e892bc0 100644 --- a/.config/metapac/groups/latex.toml +++ b/.config/metapac/groups/latex.toml @@ -1,4 +1,5 @@ arch = [ +"ttf-dejavu", "ttf-ms-fonts", "python-pygments", "biber", diff --git a/.config/metapac/groups/office.toml b/.config/metapac/groups/office.toml index 77525dc..45ce486 100644 --- a/.config/metapac/groups/office.toml +++ b/.config/metapac/groups/office.toml @@ -1,4 +1,5 @@ arch = [ +"rocketchat-desktop", "obs-studio", "okular", "inkscape", diff --git a/.config/rclone/filters-bisync b/.config/rclone/filters-bisync index b411f4e..edb16ac 100644 --- a/.config/rclone/filters-bisync +++ b/.config/rclone/filters-bisync @@ -1,3 +1,2 @@ -- .* - ~* - .debris diff --git a/Arch.org b/Arch.org index 8a64a4a..1a8c0f3 100644 --- a/Arch.org +++ b/Arch.org @@ -119,6 +119,7 @@ If everything works, login into EXWM. Create some directories: #+begin_src bash mkdir -p /home/pavel/Pictures/screenshots/ +mkdir -p /home/pavel/.mpd/ #+end_src Also run: @@ -126,6 +127,13 @@ Also run: sudo chmod +s /usr/bin/light #+end_src +For I've decided to use =NetworkManager=, but Arch Linux uses =iwd= by default, which causes issues. Disable it by: +#+begin_src bash +sudo systemctl disable --now iwd +sudo systemctl disable --now systemd-networkd +#+end_src +And reboot. After the reboot, =NetworkManager= should run using =wpa_supplicant= as backend for Wi-Fi. + * Metapac configuration [[https://github.com/ripytide/metapac][metapac]] is a declarative wrapper around different package managers, including [[https://wiki.archlinux.org/title/Pacman][pacman]] and [[https://github.com/Morganamilo/paru][paru]]. This means the required packages can be listed in configuration files and checked into version control. diff --git a/Desktop.org b/Desktop.org index 67a2867..b389a5e 100644 --- a/Desktop.org +++ b/Desktop.org @@ -4228,16 +4228,17 @@ This section generates manifests for various desktop software that I'm using. | browsers | firefox | | browsers | firefox-tridactyl | ** Office & Multimedia -| Category | Arch dependency | -|----------+-----------------| -| office | libreoffice-fresh | -| office | gimp | -| office | krita | -| office | ffmpeg | -| office | kdenlive | -| office | inkscape | -| office | okular | -| office | obs-studio | +| Category | Arch dependency | +|----------+--------------------| +| office | libreoffice-fresh | +| office | gimp | +| office | krita | +| office | ffmpeg | +| office | kdenlive | +| office | inkscape | +| office | okular | +| office | obs-studio | +| office | rocketchat-desktop | ** LaTeX | Category | Arch dependency | Disabled | |----------+--------------------------+----------| @@ -4263,12 +4264,14 @@ This section generates manifests for various desktop software that I'm using. | latex | biber | | | latex | python-pygments | | | latex | ttf-ms-fonts | | +| latex | ttf-dejavu | | ** Dev | Category | Arch dependency | Disabled | |----------+-------------------+----------| | dev | micromamba-bin | | | dev | pandoc-cli | | | dev | docker | | +| dev | docker-compose | | | dev | postgresql | | | dev | virt-manager | | | dev | libvirt | | @@ -4290,11 +4293,12 @@ This section generates manifests for various desktop software that I'm using. | dev | python | | | dev | python-pip | | | dev | python-virtualenv | | -| dev | python-build | | +| dev | python-build | | | dev | socat | | | dev | wireshark-qt | | | dev | git | | | dev | rust | | +| dev | dbeaver | | ** Manifests #+NAME: packages #+begin_src emacs-lisp :tangle no :var category="" diff --git a/Emacs.org b/Emacs.org index 957f153..7288344 100644 --- a/Emacs.org +++ b/Emacs.org @@ -12811,7 +12811,6 @@ First, default options for =rclone bisync=: A [[https://rclone.org/bisync/#filtering][filters file]] for rclone: #+begin_src text :tangle ~/.config/rclone/filters-bisync -- .* - ~* - .debris #+end_src From 6c489b4a321e5a961c68b6002b893af4f142b3ca Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Sun, 23 Nov 2025 21:52:41 +0300 Subject: [PATCH 16/18] arch: add violet --- .config/metapac/config.toml | 1 + .config/metapac/groups/desktop-misc.toml | 1 + .config/metapac/groups/system.toml | 1 - .config/systemd/user/notmuch.timer | 2 +- Arch.org | 49 ++++++++++++++++-------- 5 files changed, 37 insertions(+), 17 deletions(-) diff --git a/.config/metapac/config.toml b/.config/metapac/config.toml index cf7c10d..414eabf 100644 --- a/.config/metapac/config.toml +++ b/.config/metapac/config.toml @@ -3,6 +3,7 @@ enabled_backends = ["arch"] hostname_groups_enabled = true [hostname_groups] +violet = ["system","office","nvidia","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"] weiss = ["system","office","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"] archlinux = ["system","office","music","mail","latex","emacs","dev","desktop-rofi","desktop-polybar","desktop-misc","desktop","console","browsers"] diff --git a/.config/metapac/groups/desktop-misc.toml b/.config/metapac/groups/desktop-misc.toml index e1215a3..a16b695 100644 --- a/.config/metapac/groups/desktop-misc.toml +++ b/.config/metapac/groups/desktop-misc.toml @@ -1,4 +1,5 @@ arch = [ +"veracrypt", "android-file-transfer", "remmina", "noto-fonts-emoji", diff --git a/.config/metapac/groups/system.toml b/.config/metapac/groups/system.toml index cf29180..1f9285f 100644 --- a/.config/metapac/groups/system.toml +++ b/.config/metapac/groups/system.toml @@ -2,7 +2,6 @@ arch = [ "xf86-video-ati", "xf86-video-amdgpu", "vulkan-radeon", -"nvidia-utils", "vulkan-intel", "intel-media-driver", "libva-intel-driver", diff --git a/.config/systemd/user/notmuch.timer b/.config/systemd/user/notmuch.timer index 84dff16..19083a8 100644 --- a/.config/systemd/user/notmuch.timer +++ b/.config/systemd/user/notmuch.timer @@ -1,5 +1,5 @@ [Unit] -Description=Run notmuch new every 5 minutes +Description=Run notmuch sync script every 5 minutes [Timer] OnBootSec=1min diff --git a/Arch.org b/Arch.org index 1a8c0f3..ddba870 100644 --- a/Arch.org +++ b/Arch.org @@ -70,6 +70,12 @@ Host * AddKeysToAgent yes #+end_src +And run: +#+begin_src bash +systemctl enable --user --now ssh-agent +#+end_src +It looks like it is necessary to run at least once. + Then, clone the dotfiles repo with =yadm=: #+begin_src bash yadm clone git@github.com:SqrtMinusOne/dotfiles.git @@ -134,6 +140,8 @@ sudo systemctl disable --now systemd-networkd #+end_src And reboot. After the reboot, =NetworkManager= should run using =wpa_supplicant= as backend for Wi-Fi. +Don't forget to sync mail and enable the sync timer. + * Metapac configuration [[https://github.com/ripytide/metapac][metapac]] is a declarative wrapper around different package managers, including [[https://wiki.archlinux.org/title/Pacman][pacman]] and [[https://github.com/Morganamilo/paru][paru]]. This means the required packages can be listed in configuration files and checked into version control. @@ -143,20 +151,21 @@ In =metapac=, packages are listed in "groups", each group being a TOML file stat Below is the table enabling different groups on different hostnames: #+NAME: metapac-groups -| Profile | archlinux | weiss | -| browsers | + | + | -| console | + | + | -| desktop | + | + | -| desktop-misc | + | + | -| desktop-polybar | + | + | -| desktop-rofi | + | + | -| dev | + | + | -| emacs | + | + | -| latex | + | + | -| mail | + | + | -| music | + | + | -| office | + | + | -| system | + | + | +| Profile | archlinux | weiss | violet | +| browsers | + | + | + | +| console | + | + | + | +| desktop | + | + | + | +| desktop-misc | + | + | + | +| desktop-polybar | + | + | + | +| desktop-rofi | + | + | + | +| dev | + | + | + | +| emacs | + | + | + | +| latex | + | + | + | +| mail | + | + | + | +| music | + | + | + | +| nvidia | | | + | +| office | + | + | + | +| system | + | + | + | And the code to format it as TOML: #+NAME: metapac-groups-format @@ -231,16 +240,26 @@ Various drivers, I'm not sure which I actually need, so... | libva-intel-driver | | intel-media-driver | | vulkan-intel | -| nvidia-utils | | vulkan-radeon | | xf86-video-amdgpu | | xf86-video-ati | +NVIDIA drivers for violet +| Category | Arch dependency | +|----------+-----------------| +| nvidia | cuda | +| nvidia | nvidia-utils | +| nvidia | nvidia | + #+NAME: packages #+begin_src emacs-lisp :tangle no :var category="" (my/format-arch-dependencies category) #+end_src +#+begin_src scheme :tangle .config/metapac/groups/nvidia.toml :noweb yes +<> +#+end_src + #+begin_src scheme :tangle .config/metapac/groups/system.toml :noweb yes <> #+end_src From 2e64d77ba80dfbd81fb38359f9d6a228adaa1278 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Sun, 23 Nov 2025 21:52:49 +0300 Subject: [PATCH 17/18] emacs: some updates --- .emacs.d/desktop.el | 12 ++--- .emacs.d/modules/sqrt-emms.el | 2 + .emacs.d/modules/sqrt-index.el | 79 ++++++++++++++++++++++++++------ Desktop.org | 14 +++--- Emacs.org | 84 ++++++++++++++++++++++++++++------ 5 files changed, 153 insertions(+), 38 deletions(-) diff --git a/.emacs.d/desktop.el b/.emacs.d/desktop.el index 9e6bc17..ae29ae8 100644 --- a/.emacs.d/desktop.el +++ b/.emacs.d/desktop.el @@ -381,14 +381,14 @@ DIR is either 'left or 'right." _t_: Terminal (Alacritty) _b_: Browser (Firefox) _s_: Rocket.Chat -_e_: Element -_d_: Discord +_d_: DBeaver +_c_: Chromium " ("t" (lambda () (interactive) (my/run-in-background "alacritty"))) ("b" (lambda () (interactive) (my/run-in-background "firefox"))) - ("s" (lambda () (interactive) (my/run-in-background "flatpak run chat.rocket.RocketChat"))) - ("e" (lambda () (interactive) (my/run-in-background "flatpak run im.riot.Riot"))) - ("d" (lambda () (interactive) (my/run-in-background "flatpak run com.discordapp.Discord")))) + ("s" (lambda () (interactive) (my/run-in-background "rocketchat-desktop"))) + ("d" (lambda () (interactive) (my/run-in-background "dbeaver"))) + ("c" (lambda () (interactive) (my/run-in-background "chromium")))) (defun my/exwm-lock () (interactive) @@ -594,10 +594,10 @@ _d_: Discord (my/exwm-set-wallpaper) (my/exwm-run-shepherd) - (my/exwm-run-systemd) (my/run-in-background "gpgconf --reload gpg-agent") (my/exwm-run-polybar) (setenv "DBUS_SESSION_BUS_ADDRESS" "unix:path=/run/user/1000/bus") + (my/exwm-run-systemd) (when (my/is-arch) (my/run-in-background "set_layout"))) diff --git a/.emacs.d/modules/sqrt-emms.el b/.emacs.d/modules/sqrt-emms.el index 95d2b47..732011b 100644 --- a/.emacs.d/modules/sqrt-emms.el +++ b/.emacs.d/modules/sqrt-emms.el @@ -82,6 +82,8 @@ ;; I have everything I need in polybar (emms-mode-line-mode -1) (emms-playing-time-display-mode -1) + (delq 'emms-mark-mode evil-emacs-state-modes) + (delq 'emms-browser-mode evil-emacs-state-modes) (defun emms-info-mpd-process (track info) (dolist (data info) (let ((name (car data)) diff --git a/.emacs.d/modules/sqrt-index.el b/.emacs.d/modules/sqrt-index.el index d4c6bb8..41d085c 100644 --- a/.emacs.d/modules/sqrt-index.el +++ b/.emacs.d/modules/sqrt-index.el @@ -375,8 +375,11 @@ REMOTE = '' FOLDERS = json.loads('') OPTIONS = json.loads('') +for folder, i in zip(FOLDERS, range(len(FOLDERS))): + folder['id'] = i -def rclone_make_command(local_path, remote_path, remote): + +def rclone_make_command(local_path, remote_path, remote, extra_args=[]): return [ 'rclone', 'bisync', @@ -390,7 +393,8 @@ def rclone_make_command(local_path, remote_path, remote): 'NEVER', '--use-json-log', '--stats', - '9999m' + '9999m', + *extra_args ] @@ -418,15 +422,26 @@ def process_output(output): except Exception: print(line) -def rclone_run(folder): +def process_command_for_print(command): + res = [] + for c in command: + if ' ' in c: + res.append(f'\\'{c}\\'') + else: + res.append(c) + return ' '.join(res) + + +def rclone_run(folder, extra_args=[]): command = rclone_make_command( - folder['local-path'], folder['remote-path'], folder['remote'] + folder['local-path'], folder['remote-path'], folder['remote'], extra_args ) try: + print(str(folder['id']) + '. ' + process_command_for_print(command)) result = subprocess.run(command, check=True, capture_output=True, text=True) except subprocess.CalledProcessError as e: print(f'=== Error syncing {folder['local-path']} ===') - print(f'Command: {' '.join(command)}') + print(f'Command: {process_command_for_print(command)}') print(f'--- STDOUT ---') process_output(e.stdout) print(f'--- STDERR ---') @@ -434,7 +449,6 @@ def rclone_run(folder): return {'success': False, 'stats': {}} return {'success': True, 'stats': parse_rclone_stats(result.stderr)} - def notify(summary, body, level='normal', expire_time=5000): subprocess.run(['notify-send', '-u', level, '-t', str(expire_time), summary, body]) @@ -447,17 +461,16 @@ def sizeof_fmt(num, suffix='B'): return f'{num:.1f}Yi{suffix}' -def rclone_run_all(folders): +def rclone_run_all(folders, extra_args=[]): error_folders = [] total_bytes = 0 total_transfers = 0 total_deleted = 0 total_renamed = 0 for folder in folders: - print(f'Running rclone for {folder}') - res = rclone_run(folder) + res = rclone_run(folder, extra_args) if not res['success']: - error_folders.append(folder['local-path']) + error_folders.append(folder) else: total_bytes += res.get('stats', {}).get('bytes', 0) total_transfers += res.get('stats', {}).get('transfers', 0) @@ -469,21 +482,44 @@ def rclone_run_all(folders): if total_transfers > 0: msg += f'''Transferred {total_transfers} files ({sizeof_fmt(total_bytes)})\n''' if total_deleted > 0: - msg += f'''Deleted {total_transfers} files\n''' + msg += f'''Deleted {total_deleted} files\n''' if total_renamed > 0: msg += f'''Renamed {total_renamed} files\n''' if len(error_folders) > 0: msg += '''\nSync errors for the following folders:''' for folder in error_folders: - msg += '''\n- ''' + folder + msg += '''\n- ''' + str(folder['id']) + '. ' + folder['local-path'] level = 'critical' if len(msg) > 0: notify(f'rclone sync {REMOTE}', msg, level=level) +def parse_arguments(): + if len(sys.argv) < 2: + return None, [] + + id_arg = sys.argv[1] + folder_ids = [int(x.strip()) for x in id_arg.split(',')] + + extra_args = sys.argv[2:] + + return folder_ids, extra_args + + if __name__ == '__main__': - rclone_run_all(FOLDERS) + folder_ids, extra_args = parse_arguments() + + if folder_ids is None: + selected_folders = FOLDERS + else: + selected_folders = [f for f in FOLDERS if f['id'] in folder_ids] + found_ids = {f['id'] for f in selected_folders} + missing_ids = set(folder_ids) - found_ids + if missing_ids: + print(f'Warning: folder IDs not found: {sorted(missing_ids)}') + + rclone_run_all(selected_folders, extra_args) ")) (setq script (thread-last script @@ -562,6 +598,23 @@ The return value is a list of commands as defined by commands)) (nreverse commands))) +(defun my/index-rclone-reset () + "Delete all rclone test files." + (interactive) + (let* ((tree (my/index--tree-retrive)) + (folders (my/index--rclone-get-folders tree)) + files-to-delete) + (dolist (folder folders) + (let ((test-file-path + (concat + (alist-get :local-path folder) + (format ".rclone-test-%s" (alist-get :remote folder))))) + (when (file-exists-p test-file-path) + (push test-file-path files-to-delete)))) + (when (y-or-n-p (format "Delete %d files" (seq-length files-to-delete))) + (dolist (file files-to-delete) + (delete-file file))))) + (defun my/index--git-commands (tree) "Get commands to clone the yet uncloned git repos in TREE. diff --git a/Desktop.org b/Desktop.org index b389a5e..1b5314f 100644 --- a/Desktop.org +++ b/Desktop.org @@ -965,14 +965,14 @@ A +transient+ hydra for shortcuts for the most frequent apps. _t_: Terminal (Alacritty) _b_: Browser (Firefox) _s_: Rocket.Chat -_e_: Element -_d_: Discord +_d_: DBeaver +_c_: Chromium " ("t" (lambda () (interactive) (my/run-in-background "alacritty"))) ("b" (lambda () (interactive) (my/run-in-background "firefox"))) - ("s" (lambda () (interactive) (my/run-in-background "flatpak run chat.rocket.RocketChat"))) - ("e" (lambda () (interactive) (my/run-in-background "flatpak run im.riot.Riot"))) - ("d" (lambda () (interactive) (my/run-in-background "flatpak run com.discordapp.Discord")))) + ("s" (lambda () (interactive) (my/run-in-background "rocketchat-desktop"))) + ("d" (lambda () (interactive) (my/run-in-background "dbeaver"))) + ("c" (lambda () (interactive) (my/run-in-background "chromium")))) #+end_src *** Locking up Run i3lock. @@ -1219,10 +1219,10 @@ And the EXWM config itself. (my/exwm-set-wallpaper) (my/exwm-run-shepherd) - (my/exwm-run-systemd) (my/run-in-background "gpgconf --reload gpg-agent") (my/exwm-run-polybar) (setenv "DBUS_SESSION_BUS_ADDRESS" "unix:path=/run/user/1000/bus") + (my/exwm-run-systemd) (when (my/is-arch) (my/run-in-background "set_layout"))) @@ -4239,6 +4239,7 @@ This section generates manifests for various desktop software that I'm using. | office | okular | | office | obs-studio | | office | rocketchat-desktop | + ** LaTeX | Category | Arch dependency | Disabled | |----------+--------------------------+----------| @@ -4540,6 +4541,7 @@ Other desktop programs I use are listed below. | desktop-misc | noto-fonts-emoji | | | desktop-misc | remmina | | | desktop-misc | android-file-transfer | | +| desktop-misc | veracrypt | | #+NAME: packages #+begin_src emacs-lisp :tangle no diff --git a/Emacs.org b/Emacs.org index 7288344..63f358d 100644 --- a/Emacs.org +++ b/Emacs.org @@ -10433,6 +10433,8 @@ References: ;; I have everything I need in polybar (emms-mode-line-mode -1) (emms-playing-time-display-mode -1) + (delq 'emms-mark-mode evil-emacs-state-modes) + (delq 'emms-browser-mode evil-emacs-state-modes) <>) #+end_src **** MPD @@ -12870,8 +12872,11 @@ REMOTE = '' FOLDERS = json.loads('') OPTIONS = json.loads('') +for folder, i in zip(FOLDERS, range(len(FOLDERS))): + folder['id'] = i -def rclone_make_command(local_path, remote_path, remote): + +def rclone_make_command(local_path, remote_path, remote, extra_args=[]): return [ 'rclone', 'bisync', @@ -12885,7 +12890,8 @@ def rclone_make_command(local_path, remote_path, remote): 'NEVER', '--use-json-log', '--stats', - '9999m' + '9999m', + ,*extra_args ] @@ -12913,15 +12919,26 @@ def process_output(output): except Exception: print(line) -def rclone_run(folder): +def process_command_for_print(command): + res = [] + for c in command: + if ' ' in c: + res.append(f'\\'{c}\\'') + else: + res.append(c) + return ' '.join(res) + + +def rclone_run(folder, extra_args=[]): command = rclone_make_command( - folder['local-path'], folder['remote-path'], folder['remote'] + folder['local-path'], folder['remote-path'], folder['remote'], extra_args ) try: + print(str(folder['id']) + '. ' + process_command_for_print(command)) result = subprocess.run(command, check=True, capture_output=True, text=True) except subprocess.CalledProcessError as e: print(f'=== Error syncing {folder['local-path']} ===') - print(f'Command: {' '.join(command)}') + print(f'Command: {process_command_for_print(command)}') print(f'--- STDOUT ---') process_output(e.stdout) print(f'--- STDERR ---') @@ -12929,7 +12946,6 @@ def rclone_run(folder): return {'success': False, 'stats': {}} return {'success': True, 'stats': parse_rclone_stats(result.stderr)} - def notify(summary, body, level='normal', expire_time=5000): subprocess.run(['notify-send', '-u', level, '-t', str(expire_time), summary, body]) @@ -12942,17 +12958,16 @@ def sizeof_fmt(num, suffix='B'): return f'{num:.1f}Yi{suffix}' -def rclone_run_all(folders): +def rclone_run_all(folders, extra_args=[]): error_folders = [] total_bytes = 0 total_transfers = 0 total_deleted = 0 total_renamed = 0 for folder in folders: - print(f'Running rclone for {folder}') - res = rclone_run(folder) + res = rclone_run(folder, extra_args) if not res['success']: - error_folders.append(folder['local-path']) + error_folders.append(folder) else: total_bytes += res.get('stats', {}).get('bytes', 0) total_transfers += res.get('stats', {}).get('transfers', 0) @@ -12964,21 +12979,44 @@ def rclone_run_all(folders): if total_transfers > 0: msg += f'''Transferred {total_transfers} files ({sizeof_fmt(total_bytes)})\n''' if total_deleted > 0: - msg += f'''Deleted {total_transfers} files\n''' + msg += f'''Deleted {total_deleted} files\n''' if total_renamed > 0: msg += f'''Renamed {total_renamed} files\n''' if len(error_folders) > 0: msg += '''\nSync errors for the following folders:''' for folder in error_folders: - msg += '''\n- ''' + folder + msg += '''\n- ''' + str(folder['id']) + '. ' + folder['local-path'] level = 'critical' if len(msg) > 0: notify(f'rclone sync {REMOTE}', msg, level=level) +def parse_arguments(): + if len(sys.argv) < 2: + return None, [] + + id_arg = sys.argv[1] + folder_ids = [int(x.strip()) for x in id_arg.split(',')] + + extra_args = sys.argv[2:] + + return folder_ids, extra_args + + if __name__ == '__main__': - rclone_run_all(FOLDERS) + folder_ids, extra_args = parse_arguments() + + if folder_ids is None: + selected_folders = FOLDERS + else: + selected_folders = [f for f in FOLDERS if f['id'] in folder_ids] + found_ids = {f['id'] for f in selected_folders} + missing_ids = set(folder_ids) - found_ids + if missing_ids: + print(f'Warning: folder IDs not found: {sorted(missing_ids)}') + + rclone_run_all(selected_folders, extra_args) #+end_src A function that templates the script above: @@ -13073,6 +13111,26 @@ The return value is a list of commands as defined by (nreverse commands))) #+end_src +Also, a command to remove all =.rclone-test-*= files. This is necessary, e.g. after a change in the filter file. +#+begin_src emacs-lisp +(defun my/index-rclone-reset () + "Delete all rclone test files." + (interactive) + (let* ((tree (my/index--tree-retrive)) + (folders (my/index--rclone-get-folders tree)) + files-to-delete) + (dolist (folder folders) + (let ((test-file-path + (concat + (alist-get :local-path folder) + (format ".rclone-test-%s" (alist-get :remote folder))))) + (when (file-exists-p test-file-path) + (push test-file-path files-to-delete)))) + (when (y-or-n-p (format "Delete %d files" (seq-length files-to-delete))) + (dolist (file files-to-delete) + (delete-file file))))) +#+end_src + **** Git repos To sync git, we just need to clone the required git repos. Removing the repos is handled by the folder sync commands. From 2715390f16a679526de7c0f38133020abe695c03 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Sun, 23 Nov 2025 21:57:40 +0300 Subject: [PATCH 18/18] *: update README --- README.org | 7 +++---- dot-stats/history.json | 12 +++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.org b/README.org index 0c2ba28..4d34789 100644 --- a/README.org +++ b/README.org @@ -9,7 +9,7 @@ I use the [[https://leanpub.com/lit-config/read][literate configuration]] strate The files themselves are managed and deployed via [[https://yadm.io/][yadm]], although I use Org Mode for things like config templating. -My current GNU/Linux distribution is [[https://guix.gnu.org/][GNU Guix]]. I like Guix because, among other things, it allows [[https://guix.gnu.org/cookbook/en/html_node/Advanced-package-management.html#Advanced-package-management][to declare the required software]] in configuration files, so I can have the same set of programs across multiple machines (look for tables with "Guix dependency" in the header). +My current GNU/Linux distribution is [[https://guix.gnu.org/][Arch Linux]], managed declaratively with [[https://github.com/ripytide/metapac][metapac]] (look for tables with "Arch dependency" in the header). I used to use Guix for the same purpose for 4.5 years; I keep the config now for archival purposes. The central program to all of that is, of course, [[https://www.gnu.org/software/emacs/][GNU Emacs]]. At the time of this writing, it takes ~50% of my screen time and has the largest share of configuration here. @@ -22,15 +22,14 @@ Table of contents and software: - [[file:Console.org][Console.org]] - /Active/: [[file:Console.org::*=.profile=][.profile]], [[file:Console.org::*Bash][Bash]], [[file:Console.org::*Fish][Fish]], [[file:Console.org::*Starship prompt][Starship]], [[file:Console.org::*Tmux][Tmux]], [[file:Console.org::*Alacritty][Alacritty]] - /In Limbo/: [[file:Console.org::*Nushell][Nushell]] -- [[file:Guix.org][Guix.org]] +- [[file:Arch.org][Arch.org]] - [[file:Mail.org][Mail.org]] - /Active/: [[file:Mail.org::*Lieer][Lieer]], [[file:Mail.org::*DavMail][DavMail]], [[file:Mail.org::*OfflineIMAP][OfflineIMAP]], [[file:Mail.org::*Notmuch][Notmuch]] +- [[file:Guix.org][Guix.org]] (archive) (/Apparently, links on the second level work only in Emacs 🙁/) A few other repositories I may consider a part of my config: -- [[https://github.com/SqrtMinusOne/channel-q][channel-q]] is my Guix channel -- [[https://github.com/SqrtMinusOne/sqrt-data][sqrt-data]] is a home for my statistics gathering effort - [[https://sqrtminusone.xyz/emacs-packages/][My Emacs Packages]], some of which originated in my Emacs config See also [[https://sqrtminusone.xyz/posts/][my blog posts]]. diff --git a/dot-stats/history.json b/dot-stats/history.json index 7e9af8c..81cbcb7 100644 --- a/dot-stats/history.json +++ b/dot-stats/history.json @@ -2,11 +2,21 @@ { "title": "OS/Distro", "elements": [ + { + "name": "Arch Linux", + "states": [ + { + "startDate": "2025-11-23" + } + ], + "color": "y" + }, { "name": "GNU Guix", "states": [ { - "startDate": "2021-06-11" + "startDate": "2021-06-11", + "endDate": "2025-11-23" } ], "color": "y"