hyprland-dotfiles/scripts/wallpaper-swww.sh

51 lines
1.8 KiB
Bash
Raw Normal View History

2023-08-21 09:38:06 +00:00
#!/bin/bash
# __ __ _ _
# \ \ / /_ _| | |_ __ __ _ _ __ ___ _ __
# \ \ /\ / / _` | | | '_ \ / _` | '_ \ / _ \ '__|
# \ V V / (_| | | | |_) | (_| | |_) | __/ |
# \_/\_/ \__,_|_|_| .__/ \__,_| .__/ \___|_|
# |_| |_|
#
# by Stephan Raabe (2023)
# -----------------------------------------------------
# -----------------------------------------------------
# Select wallpaper
# -----------------------------------------------------
selected=$(ls -1 ~/wallpaper | grep "jpg" | rofi -dmenu -p "Wallpapers")
if [ "$selected" ]; then
echo "Changing theme..."
# -----------------------------------------------------
# Update wallpaper with pywal
# -----------------------------------------------------
wal -q -i ~/wallpaper/$selected
# -----------------------------------------------------
# Get new theme
# -----------------------------------------------------
source "$HOME/.cache/wal/colors.sh"
# -----------------------------------------------------
# Copy selected wallpaper into .cache folder
2023-08-21 09:38:06 +00:00
# -----------------------------------------------------
2023-08-30 12:45:03 +00:00
cp $wallpaper ~/.cache/current_wallpaper.jpg
2023-08-21 09:38:06 +00:00
newwall=$(echo $wallpaper | sed "s|$HOME/wallpaper/||g")
# -----------------------------------------------------
# Set the new wallpaper
# -----------------------------------------------------
swww img $wallpaper --transition-step 20 --transition-fps=20
2023-08-28 11:33:53 +00:00
~/dotfiles/waybar/launch.sh
2023-09-18 19:03:03 +00:00
sleep 1
2023-08-21 09:38:06 +00:00
# -----------------------------------------------------
# Send notification
# -----------------------------------------------------
notify-send "Theme and Wallpaper updated" "With image $newwall"
echo "Done."
fi