feat(WallChooser): Allow choosing between light and dark theme

Finally it is possible to create both light and dark themes. This
feature is of no use except for the odd occasion where it gets really
bright around me and I can't see the screen.
This commit is contained in:
Robert Morrison 2024-08-16 01:54:40 +01:00
parent 6aa9e4a0fb
commit 8285e62178
2 changed files with 9 additions and 1 deletions

View File

@ -30,6 +30,7 @@ wallpaper using `swww`
- `fzf`
- `swww`
- `wal`
- `bemenu`
### BarRunner
A tool to run `waybar`, Automatically restarting the bar if any of the

View File

@ -12,6 +12,7 @@ depcheck fzf
depcheck swww
depcheck wal
depcheck foot
depcheck bemenu
## Get wallpaper of choice.
# The single quoted argument of fzf is like that to preserve the variable
@ -27,9 +28,15 @@ WALLPAPER="$(cat /tmp/WallChooserChoice)"
## First set the wallpaper
swww img "$WALLPAPER" &
THEMETYPE="$(printf "light\ndark" | bemenu -c -l2 -W 0.1)"
## Now trigger pywal to update theme data to match
# -n as we don't need to set the wallpaper
if [ "$THEMETYPE" == "light" ]; then
wal -i "$WALLPAPER" -lnq
else
wal -i "$WALLPAPER" -nq
fi
## Now Set the "default" wallpaper symlink
ln -sf "$WALLPAPER" "${GSCRIPTS_WALLPAPERS:-${HOME}/.local/share/backgrounds}/default"