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

45 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)***
# - Description: A simple wallpaper changer script
2022-12-20 00:15:21 +00:00
# - Dependencies: dmenu, fd, feh
2022-09-13 01:06:55 +00:00
## MAIN VARIABLES AND COMMANDS ##
2022-12-20 00:15:21 +00:00
walldir="pictures/wallpapers/" # wallpapers folder, change it to yours, make sure that it ends with a /
2022-09-13 01:06:55 +00:00
cd "$walldir" || exit
## SELECT PICTURE FUNCTION ##
selectpic() {
2022-12-20 00:15:21 +00:00
wallpaper=$(fd -p "$walldir" | dmenu -i -l 10 -fn "mononoki Nerd Font-10" -nb \#1d2021 -nf \#fbf1c7 -sb \#cc241d -sf \#fbf1c7 -p "select a wallpaper:")
2022-09-13 01:06:55 +00:00
if [ "$wallpaper" ]; then
chosenwall=$wallpaper
else
exit 0
fi
}
selectpic
## WALLPAPER SETTING OPTIONS ##
2022-12-20 00:15:21 +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"
## MAIN ACTION ##
2022-12-20 00:15:21 +00:00
action=$(echo -e "$options" | dmenu -i -l 5 -fn "mononoki Nerd Font-10" -nb \#1d2021 -nf \#fbf1c7 -sb \#cc241d -sf \#fbf1c7 -p "chose the format:")
2022-09-13 01:06:55 +00:00
case "$action" in
$option1*)
feh --bg-fill "$chosenwall";;
$option2*)
feh --bg-center "$chosenwall";;
$option3*)
feh --bg-tile "$chosenwall";;
$option4*)
feh --bg-max "$chosenwall";;
$option5*)
feh --bg-scale "$chosenwall";;
esac
exit 0