neodotfiles/user/.local/bin/rs_wall

22 lines
656 B
Text
Raw Normal View History

2023-10-21 13:44:39 +00:00
#!/usr/bin/env bash
# ***This script was made by Clay Gomera (Drake)***
# - Description: A simple wallpaper changer script for rofi/dmenu/wofi
# - Dependencies: {rofi||dmenu||wofi}, fd, swaybg
## WALLPAPER DIRECTORY ##
walldir="$XDG_PICTURES_DIR/Wallpapers" # wallpapers folder, change it to yours
## SELECT PICTURE ##
cd "$walldir" || exit 1
2023-10-22 12:18:23 +00:00
wallpaper=$(fd -p "$walldir" | "$RUNNER" -l 5 -i -p "󰋩 Wallpaper Selector")
2023-10-21 13:44:39 +00:00
if [ -n "$wallpaper" ]; then
pkill wbg
wbg "$wallpaper" &
2023-10-22 12:18:23 +00:00
echo -e "#!/bin/sh\npkill wbg\nwbg $walldir/$wallpaper &" > "$HOME/.config/suckless/wall"
chmod +x "$HOME/.config/suckless/wall"
2023-10-21 13:44:39 +00:00
else
exit 0
fi
exit 0