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 color file to waybar folder
|
|
|
|
# -----------------------------------------------------
|
|
|
|
cp ~/.cache/wal/colors-waybar.css ~/dotfiles/waybar/
|
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-08-21 09:38:06 +00:00
|
|
|
|
|
|
|
# -----------------------------------------------------
|
|
|
|
# Send notification
|
|
|
|
# -----------------------------------------------------
|
|
|
|
notify-send "Theme and Wallpaper updated" "With image $newwall"
|
|
|
|
|
|
|
|
echo "Done."
|
|
|
|
fi
|