Nudge running Hunk sessions to pick up new theme colors (#13518)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
324f0ba5e6
commit
4ba4a53209
3 files changed
+42
No files matched your search
@@ -424,6 +424,7 @@ post_theme_commands=(
|
|||||||
omarchy-restart-helix
|
omarchy-restart-helix
|
||||||
omarchy-theme-set-foot
|
omarchy-theme-set-foot
|
||||||
omarchy-theme-set-tmux
|
omarchy-theme-set-tmux
|
||||||
|
omarchy-theme-set-hunk
|
||||||
omarchy-theme-set-gnome
|
omarchy-theme-set-gnome
|
||||||
omarchy-theme-set-pi
|
omarchy-theme-set-pi
|
||||||
omarchy-theme-set-claude
|
omarchy-theme-set-claude
|
||||||
|
|||||||
Executable
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# omarchy:summary=Tell running Hunk sessions to pick up the new terminal colors
|
||||||
|
# omarchy:hidden=true
|
||||||
|
|
||||||
|
# Hunk's default terminal theme re-reads the terminal palette on SIGWINCH. Terminals reload
|
||||||
|
# their colors in parallel with this hook, so nudge once now and once after they have settled;
|
||||||
|
# Hunk only repaints when the palette actually changed.
|
||||||
|
|
||||||
|
if pgrep -x hunk >/dev/null; then
|
||||||
|
pkill -WINCH -x hunk
|
||||||
|
sleep 1
|
||||||
|
pkill -WINCH -x hunk
|
||||||
|
fi
|
||||||
@@ -550,6 +550,33 @@ TMUX_LOG="$PI_TMPDIR/tmux.log" PATH="$FAKE_BIN:$ROOT/bin:$PATH" HOME="$PI_TMPDIR
|
|||||||
grep -q 'set-environment -g COLORFGBG 0;15' "$PI_TMPDIR/tmux.log" || fail "tmux sync reads mode from colors.toml"
|
grep -q 'set-environment -g COLORFGBG 0;15' "$PI_TMPDIR/tmux.log" || fail "tmux sync reads mode from colors.toml"
|
||||||
pass "tmux sync reads mode from colors.toml"
|
pass "tmux sync reads mode from colors.toml"
|
||||||
|
|
||||||
|
cat >"$FAKE_BIN/pgrep" <<'EOF'
|
||||||
|
#!/bin/bash
|
||||||
|
[[ -n $HUNK_RUNNING ]]
|
||||||
|
EOF
|
||||||
|
chmod +x "$FAKE_BIN/pgrep"
|
||||||
|
|
||||||
|
cat >"$FAKE_BIN/pkill" <<'EOF'
|
||||||
|
#!/bin/bash
|
||||||
|
echo "$*" >>"${PKILL_LOG:-/dev/null}"
|
||||||
|
EOF
|
||||||
|
chmod +x "$FAKE_BIN/pkill"
|
||||||
|
|
||||||
|
cat >"$FAKE_BIN/sleep" <<'EOF'
|
||||||
|
#!/bin/bash
|
||||||
|
exit 0
|
||||||
|
EOF
|
||||||
|
chmod +x "$FAKE_BIN/sleep"
|
||||||
|
|
||||||
|
HUNK_RUNNING=1 PKILL_LOG="$PI_TMPDIR/pkill.log" PATH="$FAKE_BIN:$ROOT/bin:$PATH" HOME="$PI_TMPDIR" "$ROOT/bin/omarchy-theme-set-hunk"
|
||||||
|
[[ $(grep -c -- '-WINCH -x hunk' "$PI_TMPDIR/pkill.log") == "2" ]] || fail "hunk sync signals running hunk sessions"
|
||||||
|
pass "hunk sync signals running hunk sessions"
|
||||||
|
|
||||||
|
PKILL_LOG="$PI_TMPDIR/pkill-idle.log" PATH="$FAKE_BIN:$ROOT/bin:$PATH" HOME="$PI_TMPDIR" "$ROOT/bin/omarchy-theme-set-hunk"
|
||||||
|
[[ ! -e $PI_TMPDIR/pkill-idle.log ]] || fail "hunk sync skips signaling without running hunk"
|
||||||
|
pass "hunk sync skips signaling without running hunk"
|
||||||
|
rm -f "$FAKE_BIN/pgrep" "$FAKE_BIN/pkill" "$FAKE_BIN/sleep"
|
||||||
|
|
||||||
cat >"$FAKE_BIN/gsettings" <<'EOF'
|
cat >"$FAKE_BIN/gsettings" <<'EOF'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "$*" >>"${GSETTINGS_LOG:-/dev/null}"
|
echo "$*" >>"${GSETTINGS_LOG:-/dev/null}"
|
||||||
|
|||||||
Reference in new issue
Block a user