tools: pick the live hyprland instance

$XDG_RUNTIME_DIR/hypr keeps folders of dead instances, and the newest one
isn't always alive; take the newest with a .socket.sock
This commit is contained in:
server2
2026-10-08 01:25:33 +02:00
parent 7844a98828
commit e847cbde73
+1 -1
View File
@@ -27,7 +27,7 @@ session='uid=$(id -u)
export XDG_RUNTIME_DIR=/run/user/$uid
export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus
export WAYLAND_DISPLAY=$(ls "$XDG_RUNTIME_DIR" | grep -m1 -x "wayland-[0-9]*")
export HYPRLAND_INSTANCE_SIGNATURE=$(ls -t "$XDG_RUNTIME_DIR/hypr" 2>/dev/null | head -1)
export HYPRLAND_INSTANCE_SIGNATURE=$(cd "$XDG_RUNTIME_DIR/hypr" 2>/dev/null && for d in $(ls -t); do [ -S "$d/.socket.sock" ] && echo "$d" && break; done)
export PATH=$HOME/.cargo/bin:$PATH
mkdir -p '"$work"' && cd '"$work"'
'