From 2ed6f73532d6eff7c91745985e78b3118a550d3a Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 11 Jul 2025 00:30:47 +0300 Subject: [PATCH 1/6] Move profile envvars to separate files categorized by topic --- .config/environment/backup | 4 ++++ .config/environment/editor | 5 +++++ .config/environment/ime | 5 +++++ .config/environment/poetry | 3 +++ .config/environment/utf-8 | 3 +++ .config/environment/zoom | 3 +++ .profile | 15 ++++----------- 7 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 .config/environment/backup create mode 100644 .config/environment/editor create mode 100644 .config/environment/ime create mode 100644 .config/environment/poetry create mode 100644 .config/environment/utf-8 create mode 100644 .config/environment/zoom diff --git a/.config/environment/backup b/.config/environment/backup new file mode 100644 index 0000000..d9088c8 --- /dev/null +++ b/.config/environment/backup @@ -0,0 +1,4 @@ +# keep-sorted start +export BORG_PASSCOMMAND="cat ${HOME}/.keys/borg-passphrase.txt" +export BORG_REPO="/media/backup/" +# keep-sorted end diff --git a/.config/environment/editor b/.config/environment/editor new file mode 100644 index 0000000..af438a9 --- /dev/null +++ b/.config/environment/editor @@ -0,0 +1,5 @@ +# keep-sorted start +export EDITOR="emacsclient --create-frame --no-window-system" +export SUDO_EDITOR="/usr/local/bin/emacs --no-init-file --no-splash --no-window-system" +export VISUAL="emacsclient --create-frame --no-window-system" +# keep-sorted end diff --git a/.config/environment/ime b/.config/environment/ime new file mode 100644 index 0000000..f92aced --- /dev/null +++ b/.config/environment/ime @@ -0,0 +1,5 @@ +# keep-sorted start +export GTK_IM_MODULE="fcitx" +export QT_IM_MODULE="fcitx" +export XMODIFIERS="@im=fcitx" +# keep-sorted end diff --git a/.config/environment/poetry b/.config/environment/poetry new file mode 100644 index 0000000..2074a7a --- /dev/null +++ b/.config/environment/poetry @@ -0,0 +1,3 @@ +# keep-sorted start +export PYTHON_KEYRING_BACKEND="keyring.backends.null.Keyring" +# keep-sorted end diff --git a/.config/environment/utf-8 b/.config/environment/utf-8 new file mode 100644 index 0000000..4977d5f --- /dev/null +++ b/.config/environment/utf-8 @@ -0,0 +1,3 @@ +# keep-sorted start +export LANG="en_IL.utf8" +# keep-sorted end diff --git a/.config/environment/zoom b/.config/environment/zoom new file mode 100644 index 0000000..fc4c113 --- /dev/null +++ b/.config/environment/zoom @@ -0,0 +1,3 @@ +# keep-sorted start +export XDG_CURRENT_DESKTOP="sway" +# keep-sorted end diff --git a/.profile b/.profile index 39944ac..9b2a274 100644 --- a/.profile +++ b/.profile @@ -36,17 +36,10 @@ if [ -d "$(systemd-path user-state-private)"/git-sync ] ; then fi umask 0007 -export SUDO_EDITOR="/usr/local/bin/emacs --no-init-file --no-splash --no-window-system" -export EDITOR="emacsclient --create-frame --no-window-system" -export VISUAL="emacsclient --create-frame --no-window-system" -export GTK_IM_MODULE="fcitx" -export QT_IM_MODULE="fcitx" -export XMODIFIERS="@im=fcitx" -export LANG="en_IL.utf8" -export BORG_REPO="/media/backup/" -export BORG_PASSCOMMAND="cat ${HOME}/.keys/borg-passphrase.txt" -export PYTHON_KEYRING_BACKEND="keyring.backends.null.Keyring" -export XDG_CURRENT_DESKTOP="sway" + +for filename in "$(systemd-path user-configuration)"/environment/*; do + . "$filename" +done # Autolaunch sway for tty1 logins [ "$(tty)" = "/dev/tty1" ] && From 981403aa1d2e11cfedb918c7725c744c0dd05227 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 11 Jul 2025 13:40:23 +0300 Subject: [PATCH 2/6] Remove gdm integration for sway sessions since I launch manually --- .config/setup/04-install-sway-session.sh | 3 --- .config/setup/sway.desktop | 7 ------- .local/bin/run-sway | 7 ------- 3 files changed, 17 deletions(-) delete mode 100755 .config/setup/04-install-sway-session.sh delete mode 100644 .config/setup/sway.desktop delete mode 100755 .local/bin/run-sway diff --git a/.config/setup/04-install-sway-session.sh b/.config/setup/04-install-sway-session.sh deleted file mode 100755 index e1f16a8..0000000 --- a/.config/setup/04-install-sway-session.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/sh - -sudo cp "$(systemd-path user-configuration)"/setup/sway.desktop /usr/share/wayland-sessions/ diff --git a/.config/setup/sway.desktop b/.config/setup/sway.desktop deleted file mode 100644 index 175249e..0000000 --- a/.config/setup/sway.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Version=0.1 -Name=Sway -Comment=An i3-compatible Wayland compositor -Exec=/home/ohad/.local/bin/run-sway -Type=Application -DesktopNames=sway diff --git a/.local/bin/run-sway b/.local/bin/run-sway deleted file mode 100755 index c7f043d..0000000 --- a/.local/bin/run-sway +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/bash - -set -euo pipefail -IFS=$'\n\t' - -source "$(systemd-path user)"/.profile -exec /usr/bin/sway From 0240b4e68a33443136b11effad320bdaaff1d842 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 11 Jul 2025 00:30:47 +0300 Subject: [PATCH 3/6] Collaborate with systemd to load categorized envvars --- .config/environment.d/backup.conf | 4 ++++ .config/environment.d/editor.conf | 5 +++++ .config/environment.d/ime.conf | 5 +++++ .config/environment.d/poetry.conf | 3 +++ .config/environment.d/utf-8.conf | 3 +++ .config/environment.d/zoom.conf | 3 +++ .profile | 15 ++++----------- 7 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 .config/environment.d/backup.conf create mode 100644 .config/environment.d/editor.conf create mode 100644 .config/environment.d/ime.conf create mode 100644 .config/environment.d/poetry.conf create mode 100644 .config/environment.d/utf-8.conf create mode 100644 .config/environment.d/zoom.conf diff --git a/.config/environment.d/backup.conf b/.config/environment.d/backup.conf new file mode 100644 index 0000000..f4eee83 --- /dev/null +++ b/.config/environment.d/backup.conf @@ -0,0 +1,4 @@ +# keep-sorted start +BORG_PASSCOMMAND="cat ${HOME}/.keys/borg-passphrase.txt" +BORG_REPO="/media/backup/" +# keep-sorted end diff --git a/.config/environment.d/editor.conf b/.config/environment.d/editor.conf new file mode 100644 index 0000000..42eb8e0 --- /dev/null +++ b/.config/environment.d/editor.conf @@ -0,0 +1,5 @@ +# keep-sorted start +EDITOR="emacsclient --create-frame --no-window-system" +SUDO_EDITOR="/usr/local/bin/emacs --no-init-file --no-splash --no-window-system" +VISUAL="emacsclient --create-frame --no-window-system" +# keep-sorted end diff --git a/.config/environment.d/ime.conf b/.config/environment.d/ime.conf new file mode 100644 index 0000000..1d33c97 --- /dev/null +++ b/.config/environment.d/ime.conf @@ -0,0 +1,5 @@ +# keep-sorted start +GTK_IM_MODULE="fcitx" +QT_IM_MODULE="fcitx" +XMODIFIERS="@im=fcitx" +# keep-sorted end diff --git a/.config/environment.d/poetry.conf b/.config/environment.d/poetry.conf new file mode 100644 index 0000000..7787852 --- /dev/null +++ b/.config/environment.d/poetry.conf @@ -0,0 +1,3 @@ +# keep-sorted start +PYTHON_KEYRING_BACKEND="keyring.backends.null.Keyring" +# keep-sorted end diff --git a/.config/environment.d/utf-8.conf b/.config/environment.d/utf-8.conf new file mode 100644 index 0000000..f8c7e96 --- /dev/null +++ b/.config/environment.d/utf-8.conf @@ -0,0 +1,3 @@ +# keep-sorted start +LANG="en_IL.utf8" +# keep-sorted end diff --git a/.config/environment.d/zoom.conf b/.config/environment.d/zoom.conf new file mode 100644 index 0000000..0e6ffb2 --- /dev/null +++ b/.config/environment.d/zoom.conf @@ -0,0 +1,3 @@ +# keep-sorted start +XDG_CURRENT_DESKTOP="sway" +# keep-sorted end diff --git a/.profile b/.profile index 39944ac..0fb6ca3 100644 --- a/.profile +++ b/.profile @@ -36,17 +36,10 @@ if [ -d "$(systemd-path user-state-private)"/git-sync ] ; then fi umask 0007 -export SUDO_EDITOR="/usr/local/bin/emacs --no-init-file --no-splash --no-window-system" -export EDITOR="emacsclient --create-frame --no-window-system" -export VISUAL="emacsclient --create-frame --no-window-system" -export GTK_IM_MODULE="fcitx" -export QT_IM_MODULE="fcitx" -export XMODIFIERS="@im=fcitx" -export LANG="en_IL.utf8" -export BORG_REPO="/media/backup/" -export BORG_PASSCOMMAND="cat ${HOME}/.keys/borg-passphrase.txt" -export PYTHON_KEYRING_BACKEND="keyring.backends.null.Keyring" -export XDG_CURRENT_DESKTOP="sway" + +while read -r l; do + eval export $l +done < <(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator) # Autolaunch sway for tty1 logins [ "$(tty)" = "/dev/tty1" ] && From d1431dc6662d55e0450b0d6240712674ac53de3e Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 11 Jul 2025 13:40:23 +0300 Subject: [PATCH 4/6] Remove gdm integration for sway sessions since I launch manually --- .config/setup/04-install-sway-session.sh | 3 --- .config/setup/sway.desktop | 7 ------- .local/bin/run-sway | 7 ------- 3 files changed, 17 deletions(-) delete mode 100755 .config/setup/04-install-sway-session.sh delete mode 100644 .config/setup/sway.desktop delete mode 100755 .local/bin/run-sway diff --git a/.config/setup/04-install-sway-session.sh b/.config/setup/04-install-sway-session.sh deleted file mode 100755 index e1f16a8..0000000 --- a/.config/setup/04-install-sway-session.sh +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/sh - -sudo cp "$(systemd-path user-configuration)"/setup/sway.desktop /usr/share/wayland-sessions/ diff --git a/.config/setup/sway.desktop b/.config/setup/sway.desktop deleted file mode 100644 index 175249e..0000000 --- a/.config/setup/sway.desktop +++ /dev/null @@ -1,7 +0,0 @@ -[Desktop Entry] -Version=0.1 -Name=Sway -Comment=An i3-compatible Wayland compositor -Exec=/home/ohad/.local/bin/run-sway -Type=Application -DesktopNames=sway diff --git a/.local/bin/run-sway b/.local/bin/run-sway deleted file mode 100755 index c7f043d..0000000 --- a/.local/bin/run-sway +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/bash - -set -euo pipefail -IFS=$'\n\t' - -source "$(systemd-path user)"/.profile -exec /usr/bin/sway From 5b7440f08ddafb678ce29a7937cde9a4c11ee026 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 11 Jul 2025 14:34:36 +0300 Subject: [PATCH 5/6] Make the background file configurable --- .config/environment.d/wallpaper.conf | 3 +++ .config/sway/config | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .config/environment.d/wallpaper.conf diff --git a/.config/environment.d/wallpaper.conf b/.config/environment.d/wallpaper.conf new file mode 100644 index 0000000..a246445 --- /dev/null +++ b/.config/environment.d/wallpaper.conf @@ -0,0 +1,3 @@ +# keep-sorted start +SWAY_WALLPAPER="${HOME}/Documents/wallpapers/solar-system.jpg" +# keep-sorted end diff --git a/.config/sway/config b/.config/sway/config index fc77a2a..b76ca8f 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -303,4 +303,4 @@ include /etc/sway/config.d/* exec systemctl --user import-environment XDG_CURRENT_DESKTOP exec dbus-update-activation-environment --systemd XDG_CURRENT_DESKTOP=sway -output * bg ~/Documents/wallpapers/solar-system.jpg fill +output * bg ${SWAY_WALLPAPER} fill From 433a5dfb13460e306aca580c0dbd8c752109cd2d Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Fri, 11 Jul 2025 14:38:26 +0300 Subject: [PATCH 6/6] Only reload the background image --- .local/bin/get-nasa-apod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/get-nasa-apod b/.local/bin/get-nasa-apod index 5e128b2..f0f2724 100755 --- a/.local/bin/get-nasa-apod +++ b/.local/bin/get-nasa-apod @@ -38,4 +38,4 @@ ln \ --symbolic \ "${outfile}" \ "${WALLPAPERS}/today" -swaymsg reload +swaymsg output "*" bg "${SWAY_WALLPAPER}" fill