Skip to content

Instantly share code, notes, and snippets.

@Nyubis
Created April 18, 2016 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nyubis/2620fadbe91c9bd79c73683fbcc41b65 to your computer and use it in GitHub Desktop.
Save Nyubis/2620fadbe91c9bd79c73683fbcc41b65 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from ctypes import *
from sys import argv
X11 = cdll.LoadLibrary("libX11.so.6")
display = X11.XOpenDisplay(None)
val = 0 if len(argv) < 2 or argv[1].lower() == "off" else 2
X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(val))
X11.XCloseDisplay(display)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment