dotfiles/desktop/.local/bin/flavourchoose
Marty Oehme 46cdb519ea
flavours: Call bemenu selection from wrapper function
If we call the listing and applying function directly we either select a
random colorscheme on *no* selection or we have to make use of either
xargs GNU functionality or something like moreutils ifne to only select
color schemes on selection.

Can additionally set a random theme (if selection is 'random') or a
random light theme (if selection is 'light').
2023-03-07 12:20:41 +01:00

26 lines
511 B
Bash
Executable file

#!/usr/bin/env sh
picker=dmenu
if exist bemenu; then
picker=bemenu
elif exist wofi; then
picker=wofi
elif exist rofi; then
picker=rofi
fi
list=$(flavours list -l)
flavour=$(printf "%s\nrandom\nlight" "$list" | "$picker")
if [ -z "$flavour" ]; then
return
elif [ "$flavour" = "random" ]; then
flavours apply '*'
elif [ "$flavour" = "light" ]; then
flavours apply '*light'
else
flavours apply "$flavour"
fi
if [ "$1" = '-v' ]; then
notify-send "Theme set" "set to: $flavour"
fi