kbtogglr¶
Toggle keyboard on and off.
- kbtogglr.main() int[source]¶
Capture
slaveandmasterkeyboard IDs.Determine whether lock-file exists. Create cache directory and lock-file if it does not to signal to program that keyboard is off, otherwise assume that the keyboard is on.
If the keyboard is off then the lock should be acquired.
Toggle on:
Run
xinputto reattach the keyboard IDs.Send notification to desktop indicating keyboard is enabled.
If the keyboard is on then the lock should not be acquired, either because the keyboard has been toggled on, or the system has been rebooted.
Toggle off:
Run
xinputto detach theslaveID.Send notification, including off image.