anyrun: restart daemon after standalone power menu use

The power menu runs anyrun in standalone stdin mode, which kills the
daemon. Explicitly quit the daemon before, then restart it after the
standalone invocation so the launcher stays fast.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-18 12:30:28 +01:00
parent a673881fa5
commit 76bef27ac7

View file

@ -201,6 +201,9 @@ in
extraConfig =
let
powerMenu = pkgs.writeShellScript "power-menu" ''
# Kill the daemon before using anyrun in standalone stdin mode;
# a concurrent standalone instance conflicts with the daemon.
${pkgs.anyrun}/bin/anyrun quit 2>/dev/null || true
choice=$(printf '%s\n' \
$'\uf023 Lock' \
$'\uf08b Logout' \
@ -211,6 +214,8 @@ in
--show-results-immediately true \
--hide-plugin-info true \
--close-on-click true)
# Restart the daemon for instant launcher opens.
${pkgs.anyrun}/bin/anyrun daemon &
case "$choice" in
*Lock) ${pkgs.hyprlock}/bin/hyprlock ;;
*Logout) hyprctl dispatch exit ;;