From 8285e62178a5cced513bf7b5c5863eaf7574279f Mon Sep 17 00:00:00 2001 From: Robert Morrison Date: Fri, 16 Aug 2024 01:54:40 +0100 Subject: [PATCH] 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. --- Readme.md | 1 + WallChooser | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 65eaa4c..21ed50b 100644 --- a/Readme.md +++ b/Readme.md @@ -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 diff --git a/WallChooser b/WallChooser index d72c72e..08db1b9 100755 --- a/WallChooser +++ b/WallChooser @@ -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 -wal -i "$WALLPAPER" -nq +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"