Skip to content

Instantly share code, notes, and snippets.

@bandi13
bandi13 / pointer_barrier.sh
Last active August 11, 2023 04:53 — forked from Akselmo/pointer_barrier.sh
Restrict mouse to screen
#!/bin/bash
# Original from: https://gist.github.com/Akselmo/d4f35798a222b9af5d0c0f1b4021d11d
# I tightened up the while loop. I find putting a little buffer (like 20 pixels) help reliability
# Usage: ./pointer_barrier.sh [Xleft [Ytop [Xright [Ybottom]]]]
# Example: ./pointer_barrier.sh 0 0 1919 1080
# Requires: sudo apt install xdotool
borderxl=${1:-20}
borderyu=${2:-40}