Skip to content

fix(panel): skip restart on upgrade + rename config dirs#16

Merged
prostopasta merged 10 commits into
mainfrom
fix/panel-no-restart-on-update
Jun 15, 2026
Merged

fix(panel): skip restart on upgrade + rename config dirs#16
prostopasta merged 10 commits into
mainfrom
fix/panel-no-restart-on-update

Conversation

@prostopasta

Copy link
Copy Markdown
Owner

Fixes

Panel disappears after auto-update (root cause)

install-panel-launcher.sh was unconditionally pkill-ing and restarting xfce4-panel on every run — including during upgrades triggered from within the xfce-night-switch-update.service cgroup. The restarted panel process is a child of the service, and when the service exits, the cgroup is cleaned up, killing the panel.

Fix: check if the plugin slot is already registered as a launcher in xfconf. If yes → upgrade, skip restart. If no → fresh install, restart required to load the new plugin.

Rename config/cache dirs

~/.config/theme-switcher/~/.config/xfce-night-switch/
~/.cache/theme-switcher/~/.cache/xfce-night-switch/

xfce-night-switch-setup migrates existing directories on upgrade (no config loss).

Commits

  • fix(panel): skip restart when plugin already registered (upgrade) → triggers v1.2.4
  • refactor: rename config/cache dirs from theme-switcher to xfce-night-switch → no release bump

install-panel-launcher.sh now checks if the plugin slot is already
a launcher in xfconf. If so, this is an upgrade — the panel already
has the plugin loaded, so no pkill+restart is needed. Restart only on
fresh install (new plugin ID). This prevents xfce4-panel from being
killed inside the systemd update service's cgroup on every auto-update.
…switch

~/.config/theme-switcher/ → ~/.config/xfce-night-switch/
~/.cache/theme-switcher/  → ~/.cache/xfce-night-switch/
/tmp/theme-switcher-loc.tmp → /tmp/xfce-night-switch-loc.tmp

xfce-night-switch-setup migrates existing dirs on upgrade.
Merged duplicate theme-switcher-config.default into packaging/config.default.
install-panel-launcher.sh: distinguish three cases:
  1. fresh install (plugin not in xfconf) → pkill + start
  2. upgrade + panel running              → skip entirely
  3. upgrade + panel was dead (killed by prior bug) → start without pkill

xfce-night-switch-setup: add PR test confirmation block (cherry-pick from
feat/pr-test-gate); fix ASCII art alignment with printf.
@prostopasta
prostopasta force-pushed the fix/panel-no-restart-on-update branch from 513de8c to 3e2d469 Compare June 15, 2026 17:53
Running setup via 'su -' from postinst caused it to run twice when the
user also called it manually, and showed the interactive PR test prompt
in a non-clean context (competing with dpkg/cron output).

Setup is now always run explicitly by the user or by auto-update.sh.
Tag:     pr-{N}-test-{sha7}   (unique per push, no more overwrites)
Version: x.y.z-pr.{N}.{sha7}

Old releases with pr-{N}-test tag are preserved for history.
- PR confirmation now uses yad GUI dialog (immune to background terminal
  output from cron/services); falls back to read if yad unavailable
- Cron entry redirects output to ~/.local/share/xfce-night-switch/auto-theme.log
  so auto-theme output no longer leaks into the user terminal
- Migrates existing cron entry without log redirect on upgrade
@prostopasta

Copy link
Copy Markdown
Owner Author

/test-passed

After test confirmation:
1. Sets test-gate check to success
2. Waits up to 4 min for all other checks to complete
3. Squash-merges the PR and deletes the branch (--admin to bypass protection)
@github-actions

Copy link
Copy Markdown

🧪 Test build ready — PR #16

Install the test build (Ubuntu/Debian/Mint):

wget -q 'https://github.com/prostopasta/xfce-night-switch/releases/download/pr-16-test-03687b0/xfce-night-switch_1.3.0-pr.16.03687b0_all.deb' -O /tmp/xns-test.deb \
  && sudo dpkg -i /tmp/xns-test.deb \
  && xfce-night-switch-setup

After testing, confirm it works by commenting:

/test-passed

@prostopasta

Copy link
Copy Markdown
Owner Author

/test-passed

@prostopasta
prostopasta merged commit 3dc0f6b into main Jun 15, 2026
3 checks passed
@prostopasta
prostopasta deleted the fix/panel-no-restart-on-update branch June 15, 2026 18:41
prostopasta added a commit that referenced this pull request Jun 28, 2026
…improvements (#16)

* fix(panel): skip restart when plugin already registered (upgrade)

install-panel-launcher.sh now checks if the plugin slot is already
a launcher in xfconf. If so, this is an upgrade — the panel already
has the plugin loaded, so no pkill+restart is needed. Restart only on
fresh install (new plugin ID). This prevents xfce4-panel from being
killed inside the systemd update service's cgroup on every auto-update.

* refactor: rename config/cache dirs from theme-switcher to xfce-night-switch

~/.config/theme-switcher/ → ~/.config/xfce-night-switch/
~/.cache/theme-switcher/  → ~/.cache/xfce-night-switch/
/tmp/theme-switcher-loc.tmp → /tmp/xfce-night-switch-loc.tmp

xfce-night-switch-setup migrates existing dirs on upgrade.
Merged duplicate theme-switcher-config.default into packaging/config.default.

* ci: trigger PR test build

* fix(panel): start panel if dead on upgrade, fix ASCII art in test prompt

install-panel-launcher.sh: distinguish three cases:
  1. fresh install (plugin not in xfconf) → pkill + start
  2. upgrade + panel running              → skip entirely
  3. upgrade + panel was dead (killed by prior bug) → start without pkill

xfce-night-switch-setup: add PR test confirmation block (cherry-pick from
feat/pr-test-gate); fix ASCII art alignment with printf.

* fix(postinst): remove auto-run of xfce-night-switch-setup

Running setup via 'su -' from postinst caused it to run twice when the
user also called it manually, and showed the interactive PR test prompt
in a non-clean context (competing with dpkg/cron output).

Setup is now always run explicitly by the user or by auto-update.sh.

* fix(ci): include commit SHA in PR test build tag and version

Tag:     pr-{N}-test-{sha7}   (unique per push, no more overwrites)
Version: x.y.z-pr.{N}.{sha7}

Old releases with pr-{N}-test tag are preserved for history.

* fix(ci): clean up all test releases when PR is closed/merged

* fix(panel): restart on panel change, skip only when same panel (upgrade)

* fix(setup): yad dialog for PR confirmation; redirect cron to log file

- PR confirmation now uses yad GUI dialog (immune to background terminal
  output from cron/services); falls back to read if yad unavailable
- Cron entry redirects output to ~/.local/share/xfce-night-switch/auto-theme.log
  so auto-theme output no longer leaks into the user terminal
- Migrates existing cron entry without log redirect on upgrade

* fix(ci): auto-merge PR with branch delete after /test-passed

After test confirmation:
1. Sets test-gate check to success
2. Waits up to 4 min for all other checks to complete
3. Squash-merges the PR and deletes the branch (--admin to bypass protection)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant