2022-05-11 10:06:08 +02:00
|
|
|
#!/bin/sh
|
2023-09-21 09:04:18 +02:00
|
|
|
#
|
|
|
|
# v1.0 - 19/09/2023
|
2022-11-28 07:56:13 +01:00
|
|
|
# Dependencias: xinput
|
|
|
|
#
|
|
|
|
# Shell: POSIX compliant
|
2023-09-21 09:04:18 +02:00
|
|
|
# Autor: O. Sánchez <o-sanchez@linuxmail.org> 2023
|
2022-05-11 10:06:08 +02:00
|
|
|
|
2023-05-06 02:50:15 +02:00
|
|
|
script="${0##*/}"
|
2022-11-28 11:34:27 +01:00
|
|
|
|
2022-05-11 10:06:08 +02:00
|
|
|
ayuda(){
|
2023-05-06 02:50:15 +02:00
|
|
|
printf %s "\
|
2022-11-28 07:56:13 +01:00
|
|
|
Script para desactivar teclado interno en portátiles mientras se está en el servidor gráfico.
|
|
|
|
|
2022-11-28 11:34:27 +01:00
|
|
|
Uso: $script [arg]
|
2022-11-28 07:56:13 +01:00
|
|
|
Ejemplo:
|
2022-11-28 11:34:27 +01:00
|
|
|
$script on Activa teclado interno
|
|
|
|
$script off Desactiva teclado interno
|
|
|
|
$script --help, -h Muestra este mensaje de ayuda
|
2022-11-28 07:56:13 +01:00
|
|
|
|
2023-05-06 02:50:15 +02:00
|
|
|
"
|
2022-05-11 10:06:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# 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
|