diff --git a/scripts/open-metal-lumbridge.sh b/scripts/open-metal-lumbridge.sh index a311682..708e929 100755 --- a/scripts/open-metal-lumbridge.sh +++ b/scripts/open-metal-lumbridge.sh @@ -17,7 +17,7 @@ export XAUTHORITY=${XAUTHORITY:-/run/user/1000/gdm/Xauthority} export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/1000} export DBUS_SESSION_BUS_ADDRESS=${DBUS_SESSION_BUS_ADDRESS:-unix:path=/run/user/1000/bus} -for command_name in cargo wmctrl; do +for command_name in cargo wmctrl xdotool; do if ! command -v "$command_name" >/dev/null 2>&1; then echo "required command not found: $command_name" >&2 exit 1 @@ -48,11 +48,18 @@ fi bacon_id=$(wmctrl -l | awk -v title="$bacon_title" 'index($0, title) { print $1; exit }') if [[ -n "$bacon_id" ]]; then wmctrl -i -r "$bacon_id" -b remove,maximized_vert,maximized_horz - wmctrl -i -r "$bacon_id" -e 0,1720,0,1720,1400 + # GNOME's X11 move coordinate is scaled on this display even though window + # sizes are not; 860 places the frame at physical X=1720. + wmctrl -i -r "$bacon_id" -e 0,860,0,1720,1400 fi wmctrl -i -r "$existing_id" -b remove,maximized_vert,maximized_horz wmctrl -i -r "$existing_id" -e 0,0,0,1720,1400 wmctrl -i -a "$existing_id" +# GPUI's undecorated X11 client ignores direct position requests under GNOME. +# Use the window manager's move interaction to settle it into the left half. +xdotool key alt+F7 +sleep 0.15 +xdotool mousemove 860 660 click 1 echo "Lumbridge is visible in window $existing_id on the left half of the Gigabyte display."