aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh26
1 files changed, 26 insertions, 0 deletions
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"