Centralize wallpaper-related filenames in lib/login_variables.sh
authorSiraaj Khandkar <siraaj@khandkar.net>
Sun, 23 Jan 2022 21:11:39 +0000 (16:11 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Sun, 23 Jan 2022 21:11:39 +0000 (16:11 -0500)
home/.xlaunch.d/background
home/bin/wallpaper_fav
home/bin/wallpaper_select
home/lib/login_variables.sh

index 629c4cd..ab4c301 100755 (executable)
@@ -2,10 +2,8 @@
 
 set -e
 
-WALL_FILE=~/wallpaper.txt
-
 BG_COLOR='#b2b2a0'
-BG_IMAGE=$(< "$WALL_FILE")
+BG_IMAGE=$(< "$FILE_WALLPAPER_CURR")
 
 #xsetroot -solid "$BG_COLOR"
 hsetroot -solid "$BG_COLOR"   # Because xsetroot is incompatible with compton.
index e2de403..702cd9f 100755 (executable)
@@ -2,7 +2,5 @@
 
 set -e
 
-FAVS_FILE=~/fav-wallpapers.txt
-
-awk 'NR == 2 {sub("^" $1 " +" $2 " +" $3 " +", ""); print}' ~/.fehbg | xargs sha256sum >> "$FAVS_FILE"
-sort -u "$FAVS_FILE" | sponge "$FAVS_FILE"
+awk 'NR == 2 {sub("^" $1 " +" $2 " +" $3 " +", ""); print}' ~/.fehbg | xargs sha256sum >> "$FILE_WALLPAPER_FAVS"
+sort -u "$FILE_WALLPAPER_FAVS" | sponge "$FILE_WALLPAPER_FAVS"
index 40bb4ca..257fd9f 100755 (executable)
@@ -2,8 +2,5 @@
 
 set -euo pipefail
 
-WALL_FILE=~/wallpaper.txt
-FAVS_FILE=~/wallpaper_favs.txt  # TODO Centralize in lib/vars
-
-sort -k 2 "$FAVS_FILE" | khomenu -l 50 | awk '{sub("^" $1 " +", ""); print}' > "$WALL_FILE"
+sort -k 2 "$FILE_WALLPAPER_FAVS" | khomenu -l 50 | awk '{sub("^" $1 " +", ""); print}' > "$FILE_WALLPAPER_CURR"
 ~/.xlaunch.d/background
index fe0d1cf..9abb8af 100644 (file)
@@ -19,6 +19,8 @@ env | grep ^DIR_ | awk -F= '{print $2}' | xargs -I% mkdir -p '%'
 ### FILEs ###
 export FILE_LOG_MPD="$DIR_LOG_MPD/mpd.log"
 export FILE_VIDEO_CATALOG="$DIR_VIDEO/catalog"
+export FILE_WALLPAPER_CURR="$HOME/wallpaper_curr.txt"
+export FILE_WALLPAPER_FAVS="$HOME/wallpaper_favs.txt"
 
 # .Net Core
 #DOTNET_ROOT_path=$(which dotnet)
This page took 0.033811 seconds and 4 git commands to generate.