From f8a2391314432a9e9f0f5f7b79c40dba841420f2 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 12 Sep 2026 14:30:10 +0800 Subject: bump --- clean-cache.sh | 5 ++++- hyprshutdown.sh | 10 ++++++--- hyprsunset.sh | 7 ++++++ walls/awww.sh | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ walls/swww.sh | 62 ----------------------------------------------------- 5 files changed, 84 insertions(+), 66 deletions(-) create mode 100755 walls/awww.sh delete mode 100755 walls/swww.sh diff --git a/clean-cache.sh b/clean-cache.sh index 8ef66e0..0b6ce39 100755 --- a/clean-cache.sh +++ b/clean-cache.sh @@ -11,9 +11,12 @@ pip cache purge || sudo pip cache purge # NPM npm cache clean --force || sudo npm cache clean --force +# bun +bun pm cache rm # pacman -sudo pacman -Scc --noconfirm +sudo rm -rf /var/cache/pacman/pkg/download-* +yay -Scc --noconfirm # trash trash-empty 30 -f diff --git a/hyprshutdown.sh b/hyprshutdown.sh index d9587ed..0c65e76 100755 --- a/hyprshutdown.sh +++ b/hyprshutdown.sh @@ -7,8 +7,10 @@ CONFIRM="Confirm" DUP_ACTION=reboot # or shutdown or reboot DUP_AMOUNT=2 # this only matters if its shutdown or reboot # maybe add hyprsession --save or whatever thats called to restore prev apps -SHUTDOWN="hyprshutdown --post-cmd poweroff" -REBOOT="hyprshutdown --post-cmd reboot" +SHUTDOWN_CMD="poweroff" +SHUTDOWN="hyprshutdown --post-cmd $SHUTDOWN_CMD" +REBOOT_CMD="reboot" +REBOOT="hyprshutdown --post-cmd $REBOOT_CMD" # default ACTION=Shutdown @@ -20,9 +22,11 @@ trap 'kill -- -$$' EXIT function exec_action { if [[ $ACTION == "Shutdown" ]]; then - $SHUTDOWN & disown + $SHUTDOWN & + (wait $!; $SHUTDOWN_CMD) & elif [[ $ACTION == "Reboot" ]]; then $REBOOT & disown + (wait $!; $REBOOT_CMD) & fi kill $SELF } diff --git a/hyprsunset.sh b/hyprsunset.sh index 07a5aa1..4b6e045 100755 --- a/hyprsunset.sh +++ b/hyprsunset.sh @@ -9,6 +9,13 @@ NORMAL_TEMP=6000 SUNRISE_HOUR=6 SUNSET_HOUR=20 +set -E + +trap ' +CMD="$BASH_COMMAND" +hyprsunset & +$BASH_COMMAND' ERR + apply_settings() { current_hour=$(date +%H | sed 's/^0//') diff --git a/walls/awww.sh b/walls/awww.sh new file mode 100755 index 0000000..64f4edd --- /dev/null +++ b/walls/awww.sh @@ -0,0 +1,66 @@ +#!/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/" +awwwarg="--transition-type any --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 ! awww query; do awww-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 + current_bg="$(cat $XDG_CACHE_HOME/current.bg)" + + # 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 + awww img $current_bg $awwwarg + 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 = $current_bg" > "$XDG_CONFIG_HOME/hypr/bg.conf" + + # reload hyprland + hyprctl reload config-only & + + # reload hx + pkill -USR1 hx + pkill -USR1 kitty + + swaync-client --reload-css + + # gdbus call --session --dest com.mitchellh.ghostty --object-path /com/mitchellh/ghostty --method org.gtk.Actions.Activate reload-config [] [] & + # kitten @ action load_config_file + # kitty @ set-colors --all --configured ~/.config/kitty/colors.conf + killall -SIGUSR1 kitty + + echo $wallpappath > $XDG_CACHE_HOME/current.bg + # update hyprlock + killall -SIGUSR2 hyprlock + + pywalfox update + + fcitx5-remote -r + + nice -n 20 wallust run --backend full --skip-templates --skip-sequences $wallpappath + + if awww query; then + sleep $DELAY + else + echo -e "${RED}awww not running, skipping sleep - END${NC}" + awww-daemon & + fi +done diff --git a/walls/swww.sh b/walls/swww.sh deleted file mode 100755 index 29d00d7..0000000 --- a/walls/swww.sh +++ /dev/null @@ -1,62 +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/" -swwwarg="--transition-type any --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 - current_bg="$(cat $XDG_CACHE_HOME/current.bg)" - - # 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 $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 = $current_bg" > "$XDG_CONFIG_HOME/hypr/bg.conf" - - # reload hyprland - hyprctl reload config-only & - - # reload hx - pkill -USR1 hx - pkill -USR1 kitty - - swaync-client --reload-css - - # gdbus call --session --dest com.mitchellh.ghostty --object-path /com/mitchellh/ghostty --method org.gtk.Actions.Activate reload-config [] [] & - # kitten @ action load_config_file - # kitty @ set-colors --all --configured ~/.config/kitty/colors.conf - killall -SIGUSR1 kitty - - 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