From 411d749a5958b8638675da59c5e140d9b7de2bec Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Thu, 20 Jan 2022 19:18:25 -0500 Subject: [PATCH] Integrate wallpaper management --- home/.xlaunch.d/background | 12 ++++++++++++ home/bin/wallpaper_select | 10 ++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100755 home/.xlaunch.d/background 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 -- 2.20.1