From cddeebd21b7e0bee1b8f97d74d9ef74b40abc54b Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 27 Apr 2025 18:29:58 +0800 Subject: walls: organize into one dir --- swww.sh | 61 ------------------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100755 swww.sh (limited to 'swww.sh') diff --git a/swww.sh b/swww.sh deleted file mode 100755 index 391d580..0000000 --- a/swww.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -XDG_PICTURES_DIR="${XDG_PICTURES_DIR:-$HOME/Pictures}" -XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" -XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" -WALLPAPERS="$XDG_PICTURES_DIR/wallpapers/" -current_bg="$(cat $XDG_CACHE_HOME/current.bg)" -swwwarg="--transition-type random --transition-duration 0.85 --transition-fps 160 --transition-bezier 1,0.33,0.3,1" - -# colors -RED='\033[0;31m' -GREEN='\033[0;32m' -NC='\033[0m' - -DELAY=1800 - -while true; do - (while ! swww query; do swww-daemon; done) & - wallpappath=$(find "$WALLPAPERS" | shuf -n 1) - if ! [ $current_bg ]; then - echo -e "${RED}current.bg not set, setting it to $wallpappath${NC}" - echo $wallpappath > $XDG_CACHE_HOME/current.bg - echo -e "${GREEN}Regenerating wallpappath${NC}" - wallpappath=$(find "$WALLPAPERS" | shuf -n 1) - fi - - # wallust run --skip-sequences $(cat $XDG_CACHE_HOME/current.bg) - # wallust run --backend kmeans --skip-sequences $(cat $XDG_CACHE_HOME/current.bg) & # using cache now - swww img $(cat $XDG_CACHE_HOME/current.bg) $swwwarg - wallust run --backend full --skip-sequences $(cat $XDG_CACHE_HOME/current.bg) - # (sleep 0.1; pgrep -f wallust && wallust run --backend kmeans --skip-sequences $(cat $XDG_CACHE_HOME/current.bg)) & - - # tell hypr* where is bg - echo "\$bg = $XDG_CACHE_HOME/$(basename "$current_bg").png" > "$XDG_CONFIG_HOME/hypr/bg.conf" - - # reload hyprland - hyprctl reload config-only & - - swaync-client --reload-css - - gdbus call --session --dest com.mitchellh.ghostty --object-path /com/mitchellh/ghostty --method org.gtk.Actions.Activate reload-config [] [] & - - current_bg=$(cat $XDG_CACHE_HOME/current.bg) - if [[ $current_bg == *.jpg ]]; then - magick convert $current_bg $XDG_CACHE_HOME/bg.png & - else - cp $current_bg $XDG_CACHE_HOME/bg.png - fi - echo $wallpappath > $XDG_CACHE_HOME/current.bg - # update hyprlock - killall -SIGUSR2 hyprlock - - nice -n 20 wallust run --backend full --skip-templates --skip-sequences $wallpappath - - if swww query; then - sleep $DELAY - else - echo -e "${RED}swww not running, skipping sleep - END${NC}" - swww-daemon & - fi -done -- cgit v1.2.3