diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-11 18:42:05 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-11 18:42:05 +0200 |
| commit | a77f24d657a6091022754adb1b30750748132216 (patch) | |
| tree | c3d898c6f29e06dd99893005bd4654941f58d1d3 /install.sh | |
| parent | b7a660d5587b7d23dbcfbb39d14de22eb9600754 (diff) | |
| download | unified-desktop-theme-a77f24d657a6091022754adb1b30750748132216.tar.gz unified-desktop-theme-a77f24d657a6091022754adb1b30750748132216.zip | |
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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015gbjA2bmswN8jyPDKzrvqe
Diffstat (limited to 'install.sh')
| -rwxr-xr-x | install.sh | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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" |
