Created
December 6, 2018 18:59
-
-
Save mortie/297a966e22e788c80570fa37d4a15809 to your computer and use it in GitHub Desktop.
Automatically show an on-screen keyboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Automatically show an on-screen keyboard when enabling tablet mode. | |
# The script depends on the acpi_listen program from the acpid package, | |
# and the onboard program from the onboard package. | |
listener() { | |
pid= | |
while read -r line; do | |
if [ "$line" = 00000001 ]; then | |
onboard & | |
pid=$! | |
else | |
kill $pid | |
fi | |
done | |
} | |
acpi_listen \ | |
| grep --line-buffered "video/tabletmode" \ | |
| stdbuf -oL cut -d' ' -f4 | listener |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment