From a77f24d657a6091022754adb1b30750748132216 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 11 Sep 2026 18:42:05 +0200 Subject: feat(install): reload running apps after generating configs install.sh wrote every config and reloaded nothing, so a scheme switch looked half-applied: the files were correct but waybar, kitty, conky and dunst kept drawing the old colours until five commands were run by hand. It now signals waybar, kitty and Hyprland, runs udt-accent (which regenerates the accent and restarts dunst), and restarts conky, which has no hot-reload. Each is guarded on the process actually running, so a missing one is skipped rather than started: verified conky stays stopped when it was not up before. rofi needs nothing, it reads its theme per launch. Qt and GTK apps still need a manual restart and the README says so. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015gbjA2bmswN8jyPDKzrvqe --- install.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 5969c48..6bc0341 100755 --- a/install.sh +++ b/install.sh @@ -77,5 +77,31 @@ if command -v scp >/dev/null 2>&1; then fi fi +# Reload what is running. Writing the configs is not enough: waybar, kitty and +# Hyprland reread on a signal, dunst and conky only on a restart, and rofi +# reads its theme per launch so it needs nothing. Each is guarded, because none +# of them is necessarily running, and a missing one is not an error. +reloaded="" +pgrep -x waybar >/dev/null 2>&1 && killall -SIGUSR2 waybar 2>/dev/null && reloaded="$reloaded waybar" +pgrep -x kitty >/dev/null 2>&1 && pkill -USR1 -x kitty 2>/dev/null && reloaded="$reloaded kitty" +command -v hyprctl >/dev/null 2>&1 && hyprctl reload >/dev/null 2>&1 && reloaded="$reloaded hyprland" + +# udt-accent regenerates the accent and restarts dunst itself. It needs a +# wallpaper to read; without one the accent keeps its current value. +if command -v udt-accent >/dev/null 2>&1 && [ -e "$HOME/.cache/wal/wpaper" ]; then + udt-accent "$HOME/.cache/wal/wpaper" >/dev/null 2>&1 && reloaded="$reloaded accent+dunst" +fi + +# conky has no hot-reload and nothing respawns it, so it is restarted only if +# it was already running. +if pgrep -x conky >/dev/null 2>&1; then + pkill -x conky 2>/dev/null + sleep 0.5 + (conky -d >/dev/null 2>&1 &) + reloaded="$reloaded conky" +fi + +[ -n "$reloaded" ] && echo "reloaded:$reloaded" + echo "installed:" ls -l "$target" "$HOME/bin/udt-accent" -- cgit v1.2.3