#!/bin/bash # ━━━━━━━━━━ # mouse-home - Move the mouse pointer to its home position # ━━━━━━━━━━ # PUBLIC at `http://reluk.ca/sys/bin/` — for no particular reason. xdotool getwindowfocus mousemove 4155 450 sleep 0.1 windowfocus # Commands `getwindowfocus` and `windowfocus` serve to maintain the original window focus. # Focus preservation failure with Firefox # ────────────────────────── # At times this fails on certain Firefox window, consistently for while, only to recover later. # Cause(s) of failure: # • The latest window if it’s Firefox? # • Toggling the on-screen display? # # Cause(s) of recovery: # • Making a new window? NO # • Paging the window out, then back in? # • Toggling the on-screen display? # # Remedy: # • Adding `--sync` on mouse move? NO # • Adding also `-f` on `getwindowfocus`? NO # • Adding also `--sync` on `windowfocus`? NO # • Adding also `sleep` after mouse move? Apparently YES. # Unwanted focus shifting # ─────────────────────── # Cause: A manual focus shift shortly after calling `mouse-home`. # # Failure: Within about 5 seconds, the focus automatically shifts back, # undoing the manual shift. # # Remedy: # • Removing `--sync` from mouse move?