Better eww

This commit is contained in:
soraefir
2026-07-19 23:11:43 +02:00
parent 887634421c
commit 58492cae22
6 changed files with 78 additions and 8 deletions
@@ -1,7 +1,12 @@
{ config, lib, pkgs, ... }:
let
# Close the bar if it's already open (wrong screen), then open on the target screen.
# Must go through eww-ensure-daemon: this runs on every monitor hotplug, and a
# bare `eww open` against a busy/dead socket spawns a second daemon, leaving the
# first one's bar and popups on screen with no way to close them.
moveOrOpenBar = screen: "${pkgs.writeShellScript "kanshi-eww-bar-${toString screen}" ''
${pkgs.custom.eww-ensure-daemon}/bin/eww-ensure-daemon || exit 1
if ${pkgs.eww}/bin/eww active-windows 2>/dev/null | grep -qx "bar"; then
${pkgs.eww}/bin/eww close bar
fi