36 lines
666 B
Bash
Executable File
36 lines
666 B
Bash
Executable File
#!/bin/ksh
|
|
# Dependencias: xinput
|
|
#
|
|
# Autor: Tuxliban Torvalds <o-sanchez@linuxmail.org>
|
|
|
|
script="${0##*/}"
|
|
|
|
function ayuda {
|
|
printf %s "\
|
|
Script para desactivar teclado interno en portátiles mientras se está en el servidor gráfico.
|
|
|
|
Uso: $script [arg]
|
|
Ejemplo:
|
|
$script on Activa teclado interno
|
|
$script off Desactiva teclado interno
|
|
$script --help, -h Muestra este mensaje de ayuda
|
|
|
|
"
|
|
}
|
|
|
|
# Salir si existe un error
|
|
set -e
|
|
|
|
ID=$(xinput --list | awk '/Translated/ {print $7}' | cut -d '=' -f 2)
|
|
|
|
case "$1" in
|
|
on)
|
|
xinput set-int-prop "$ID" "Device Enabled" 8 1
|
|
;;
|
|
off)
|
|
xinput set-int-prop "$ID" "Device Enabled" 8 0
|
|
;;
|
|
--help|-h|*)
|
|
ayuda
|
|
esac
|