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
|
2023-06-24 17:00:22 +00:00
|
|
|
# - Dependencies: rofi, fd, feh
|
2022-09-13 01:06:55 +00:00
|
|
|
|
|
|
|
## MAIN VARIABLES AND COMMANDS ##
|
2023-06-24 17:00:22 +00:00
|
|
|
walldir="$HOME/Media/Pictures/Wallpapers"
|
2022-09-13 01:06:55 +00:00
|
|
|
cd "$walldir" || exit
|
|
|
|
|
|
|
|
## SELECT PICTURE FUNCTION ##
|
|
|
|
selectpic() {
|
2023-06-24 17:00:22 +00:00
|
|
|
wallpaper=$(fd -p "$walldir" | dmenu -i -p " Select a wallpaper ")
|
|
|
|
if [ "$wallpaper" ]; then
|
|
|
|
chosenwall=$wallpaper
|
|
|
|
else
|
|
|
|
exit 0
|
|
|
|
fi
|
2022-09-13 01:06:55 +00:00
|
|
|
}
|
|
|
|
selectpic
|
|
|
|
|
|
|
|
## WALLPAPER SETTING 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"
|
|
|
|
|
|
|
|
## MAIN ACTION ##
|
2023-06-24 17:00:22 +00:00
|
|
|
action=$(echo -e "$options" | dmenu -i -p " Chose the format ")
|
2022-09-13 01:06:55 +00:00
|
|
|
case "$action" in
|
2023-06-24 17:00:22 +00:00
|
|
|
$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";;
|
2022-09-13 01:06:55 +00:00
|
|
|
esac
|
|
|
|
exit 0
|