Skip to content

Instantly share code, notes, and snippets.

@Vocaned
Created November 23, 2025 18:08
Show Gist options
  • Select an option

  • Save Vocaned/2fb9cbdba7e5812ac4a1badd138d1c35 to your computer and use it in GitHub Desktop.

Select an option

Save Vocaned/2fb9cbdba7e5812ac4a1badd138d1c35 to your computer and use it in GitHub Desktop.
#!/bin/sh
input_id="13364:53311:Keychron_Keychron_M6"
output_id="DP-1"
if [ "$1" == "lock" ]; then
swaymsg input "$input_id" map_to_output "$output_id"
echo "Cursor locked to $output_id"
elif [ "$1" == "unlock" ]; then
swaymsg input "$input_id" map_to_output "*"
echo "Cursor unlocked"
else
echo "$(basename "$0") {lock|unlock}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment