2023-08-21 09:38:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# __ __ _ _
|
|
|
|
# \ \ / /_ _| | |_ __ __ _ _ __ ___ _ __
|
|
|
|
# \ \ /\ / / _` | | | '_ \ / _` | '_ \ / _ \ '__|
|
|
|
|
# \ V V / (_| | | | |_) | (_| | |_) | __/ |
|
|
|
|
# \_/\_/ \__,_|_|_| .__/ \__,_| .__/ \___|_|
|
|
|
|
# |_| |_|
|
|
|
|
#
|
|
|
|
# by Stephan Raabe (2023)
|
|
|
|
# -----------------------------------------------------
|
|
|
|
|
|
|
|
# -----------------------------------------------------
|
|
|
|
# Select wallpaper
|
|
|
|
# -----------------------------------------------------
|
2023-10-17 06:21:57 +00:00
|
|
|
selected=$(ls -1 ~/wallpaper | grep "jpg" | rofi -dmenu -config ~/dotfiles/rofi/config-wallpaper.rasi)
|
2023-08-21 09:38:06 +00:00
|
|
|
|
|
|
|
if [ "$selected" ]; then
|
|
|
|
|
|
|
|
echo "Changing theme..."
|
|
|
|
# -----------------------------------------------------
|
|
|
|
# Update wallpaper with pywal
|
|
|
|
# -----------------------------------------------------
|
|
|
|
wal -q -i ~/wallpaper/$selected
|
|
|
|
|
|
|
|
# -----------------------------------------------------
|
|
|
|
# Get new theme
|
|
|
|
# -----------------------------------------------------
|
|
|
|
source "$HOME/.cache/wal/colors.sh"
|
|
|
|
|
|
|
|
# -----------------------------------------------------
|
2023-09-10 13:03:00 +00:00
|
|
|
# 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
|
|
|
|
# -----------------------------------------------------
|
2023-10-01 09:21:02 +00:00
|
|
|
swww img $wallpaper \
|
|
|
|
--transition-bezier .43,1.19,1,.4 \
|
|
|
|
--transition-fps=60 \
|
|
|
|
--transition-type="random" \
|
|
|
|
--transition-duration=0.7 \
|
|
|
|
--transition-pos "$( hyprctl cursorpos )"
|
|
|
|
|
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
|
|
|
|
# -----------------------------------------------------
|
2023-09-20 11:56:57 +00:00
|
|
|
notify-send "Colors and Wallpaper updated" "with image $newwall"
|
2023-08-21 09:38:06 +00:00
|
|
|
|
|
|
|
echo "Done."
|
|
|
|
fi
|