From: Siraaj Khandkar Date: Fri, 21 Jan 2022 00:18:25 +0000 (-0500) Subject: Integrate wallpaper management X-Git-Url: https://git.xandkar.net/?p=khome.git;a=commitdiff_plain;h=411d749a5958b8638675da59c5e140d9b7de2bec Integrate wallpaper management --- diff --git a/home/.xlaunch.d/background b/home/.xlaunch.d/background new file mode 100755 index 0000000..629c4cd --- /dev/null +++ b/home/.xlaunch.d/background @@ -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" diff --git a/home/bin/wallpaper_select b/home/bin/wallpaper_select index 7832031..9ad2d7a 100755 --- a/home/bin/wallpaper_select +++ b/home/bin/wallpaper_select @@ -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