pinwheel: Ensure hyprland monitor detection works on start

This commit is contained in:
Alexander Heldt
2026-06-17 12:27:12 +02:00
parent 421c6179d6
commit 0b3e8c162a
+14 -4
View File
@@ -55,12 +55,22 @@ let
esac
}
# Bind workspaces on startup
bind_workspaces
# Start the event listener first so monitoradded events emitted during
# session startup are not lost in the gap before we begin reading them.
${pkgs.socat}/bin/socat -U - UNIX-CONNECT:"$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" | while read -r line; do
handle_event "$line"
done
done &
LISTENER_PID=$!
# Give socat a moment to actually connect before the initial bind.
sleep 0.2
bind_workspaces
# Re-bind once more after the DRM subsystem has had time to enumerate
# external connectors, in case they were not yet present at session start.
(sleep 3; bind_workspaces) &
wait $LISTENER_PID
'';
in
{