-
-
Save talwrii/97d6de40d38e635d924d7e25ce799211 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script clciks on the other window and presses enter | |
current_window=$(json-wmctrl | jq 'select(.focus) | .id') | |
# Extract x and y coordinates from the output | |
x=$(xdotool getmouselocation | cut -d ' ' -f 1 | cut -d ':' -f 2) | |
y=$(xdotool getmouselocation | cut -d ' ' -f 2 | cut -d ':' -f 2) | |
# Move x to the other side of the screen by mirroring along the middle | |
xdotool mousemove $((1920 - x)) $y | |
xdotool click 1 | |
xdotool key Up | |
# press enter with xdotool | |
xdotool key Return | |
xdotool mousemove $x $y | |
wmctrl -i -a $current_window |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment