From 787359d155fac85f01b431f074bf4d83a4c177cb Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Sun, 23 Jan 2022 16:11:39 -0500 Subject: [PATCH] Centralize wallpaper-related filenames in lib/login_variables.sh --- home/.xlaunch.d/background | 4 +--- home/bin/wallpaper_fav | 6 ++---- home/bin/wallpaper_select | 5 +---- home/lib/login_variables.sh | 2 ++ 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/home/.xlaunch.d/background b/home/.xlaunch.d/background index 629c4cd..ab4c301 100755 --- a/home/.xlaunch.d/background +++ b/home/.xlaunch.d/background @@ -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. diff --git a/home/bin/wallpaper_fav b/home/bin/wallpaper_fav index e2de403..702cd9f 100755 --- a/home/bin/wallpaper_fav +++ b/home/bin/wallpaper_fav @@ -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" diff --git a/home/bin/wallpaper_select b/home/bin/wallpaper_select index 40bb4ca..257fd9f 100755 --- a/home/bin/wallpaper_select +++ b/home/bin/wallpaper_select @@ -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 diff --git a/home/lib/login_variables.sh b/home/lib/login_variables.sh index fe0d1cf..9abb8af 100644 --- a/home/lib/login_variables.sh +++ b/home/lib/login_variables.sh @@ -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) -- 2.20.1