Integrate wallpaper management
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 21 Jan 2022 00:18:25 +0000 (19:18 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 21 Jan 2022 00:18:25 +0000 (19:18 -0500)
home/.xlaunch.d/background [new file with mode: 0755]
home/bin/wallpaper_select

diff --git a/home/.xlaunch.d/background b/home/.xlaunch.d/background
new file mode 100755 (executable)
index 0000000..629c4cd
--- /dev/null
@@ -0,0 +1,12 @@
+#! /bin/bash
+
+set -e
+
+WALL_FILE=~/wallpaper.txt
+
+BG_COLOR='#b2b2a0'
+BG_IMAGE=$(< "$WALL_FILE")
+
+#xsetroot -solid "$BG_COLOR"
+hsetroot -solid "$BG_COLOR"   # Because xsetroot is incompatible with compton.
+feh --bg-scale "$BG_IMAGE"
index 7832031..9ad2d7a 100755 (executable)
@@ -1,7 +1,9 @@
-#! /bin/sh
+#! /bin/bash
 
-set -e
+set -euo pipefail
 
-FAVS_FILE=~/fav-wallpapers.txt  # TODO Centralize in lib/vars
+WALL_FILE=~/wallpaper.txt
+FAVS_FILE=~/wallpaper_favs.txt  # TODO Centralize in lib/vars
 
-khomenu -l 50 < "$FAVS_FILE" | awk '{sub("^" $1 " +", ""); print}' | xargs -I% feh --bg-scale '%'
+khomenu -l 50 < "$FAVS_FILE" | awk '{sub("^" $1 " +", ""); print}' > "$WALL_FILE"
+~/.xlaunch.d/background
This page took 0.038927 seconds and 4 git commands to generate.