neodotfiles/user/.config/suckless/dmenu/scripts/dmenu_wall

50 lines
1.2 KiB
Text
Raw Normal View History

2022-09-13 01:06:55 +00:00
#!/usr/bin/env bash
# ***This script was made by Clay Gomera (Drake)***
2023-09-04 17:36:18 +00:00
# - Description: A simple dmenu script to set the wallpaper on X
# - Dependencies: dmenu, fd, feh
2022-09-13 01:06:55 +00:00
2023-09-04 17:36:18 +00:00
##########################
## Wallpapers Directory ##
##########################
2023-10-03 14:40:20 +00:00
walldir="$XDG_PICTURES_DIR/wallpapers"
2023-09-04 17:36:18 +00:00
cd "$walldir" || exit # we cd into $walldir in order to get only the file name on the main prompt
2022-09-13 01:06:55 +00:00
2023-09-04 17:36:18 +00:00
#######################
## Wallpaper options ##
#######################
2023-06-24 17:00:22 +00:00
option1="Fill"
option2="Center"
option3="Tile"
option4="Max"
option5="Scale"
2022-09-13 01:06:55 +00:00
options="$option1\n$option2\n$option3\n$option4\n$option5"
2023-09-04 17:36:18 +00:00
##########
## main ##
##########
wallpaper=$(fd -p ./ | dmenu -i -p " 󰋩 Select a wallpaper ") # main prompt
if [ "$wallpaper" ]; then # if the user made a choice
chosenwall=$wallpaper # reassign $wallpaper to $chosenwall
else
exit 0
fi
action=$(echo -e "$options" | dmenu -i -p "  Chose the format ") # options prompt
2022-09-13 01:06:55 +00:00
case "$action" in
2023-06-24 17:00:22 +00:00
$option1*)
2023-09-04 17:36:18 +00:00
feh --bg-fill "$chosenwall";
;;
2023-06-24 17:00:22 +00:00
$option2*)
2023-09-04 17:36:18 +00:00
feh --bg-center "$chosenwall";
;;
2023-06-24 17:00:22 +00:00
$option3*)
2023-09-04 17:36:18 +00:00
feh --bg-tile "$chosenwall";
;;
2023-06-24 17:00:22 +00:00
$option4*)
2023-09-04 17:36:18 +00:00
feh --bg-max "$chosenwall";
;;
2023-06-24 17:00:22 +00:00
$option5*)
2023-09-04 17:36:18 +00:00
feh --bg-scale "$chosenwall";
;;
2022-09-13 01:06:55 +00:00
esac