Skip to content

Instantly share code, notes, and snippets.

@dgalli1
Created October 13, 2019 17:05
Show Gist options
  • Save dgalli1/dd10c9357c3b402023995f860ca709a9 to your computer and use it in GitHub Desktop.
Save dgalli1/dd10c9357c3b402023995f860ca709a9 to your computer and use it in GitHub Desktop.
#!/bin/bash
is_running=false
trap ctrl_c INT
function ctrl_c() {
pkill xpointerbarrier
exit
}
while true
do
test=$(xdotool getwindowfocus getwindowname)
echo $test
if [ "$test" = "League of Legends (TM) Client" ]; then
if ! $is_running ; then
# top left right bottom
# i would recommnd putting left and right on 5 pxs if you have 3 monitors
nohup xpointerbarrier 0 5 5 0 &>/dev/null &
fi
else
pkill xpointerbarrier
is_running=false
fi
sleep 0.1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment