Skip to content

Commit a099c94

Browse files
pgratz1claude
andcommitted
RK3576: Fix ES not appearing on glasses at boot
Two issues prevented ES from showing on DP Alt Mode displays connected at boot: 1. for_window rule used 'focus output' instead of 'move output' — the former only moves cursor focus to DP-1, not the ES window itself. Change to 'move output DP-1' so ES is actually moved when it opens. 2. dp_monitor could miss the boot-time hotplug event: sway fires the output "change" event before finishing output configuration, so wlr-randr shows DP-1 as Enabled: no and dp_monitor sees no external display. Add a 10s timeout to the subscribe loop so dp_monitor retries periodically as a fallback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6a18810 commit a099c94

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

  • projects/ROCKNIX/packages

projects/ROCKNIX/packages/sysutils/system-utils/sources/scripts/dp_monitor

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ sleep 3
6565

6666
while true; do
6767
_apply
68-
# Block until sway reports an output event, then loop immediately.
69-
# grep -q exits on first '"change"' match, breaking the pipe and
70-
# terminating swaymsg cleanly. '|| true' keeps the loop running
71-
# if sway disconnects.
72-
swaymsg -t subscribe '["output"]' 2>/dev/null | grep -q '"change"' || true
68+
# Block until sway reports an output event (or 10s timeout).
69+
# The timeout acts as a periodic retry to catch events missed when sway
70+
# fires before finishing output configuration (e.g. boot-time hotplug).
71+
# grep -q exits on first '"change"' match, terminating swaymsg cleanly.
72+
timeout 10 swaymsg -t subscribe '["output"]' 2>/dev/null | grep -q '"change"' || true
7373
sleep 0.3
7474
done

projects/ROCKNIX/packages/wayland/compositor/sway/autostart/111-sway-init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ else
119119
# Sway automatically moves workspace 1 to DP-1 when it appears
120120
# and back to DSI-1 when it disconnects.
121121
echo "workspace 1 output DP-1 ${con}" >> $SWAY_HOME/config
122-
echo 'for_window [app_id="emulationstation"] focus output DP-1' >> $SWAY_HOME/config
122+
echo 'for_window [app_id="emulationstation"] move output DP-1' >> $SWAY_HOME/config
123123
fi
124124

125125
# Start the external display monitor on any device that has DP or HDMI

0 commit comments

Comments
 (0)