aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubuntuperonista <30541016+ubuntuperonista@users.noreply.github.com>2023-03-02 18:08:32 -0300
committerGitHub <noreply@github.com>2023-03-02 18:08:32 -0300
commit98c1ad2c91a21ca01044592ce740511924fbc021 (patch)
tree104a6c16ea3102d505d9b0d80775eb79322e250c
downloadtouchpad_toggle-98c1ad2c91a21ca01044592ce740511924fbc021.tar.gz
Create touchpad_toggle.sh
-rw-r--r--touchpad_toggle.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/touchpad_toggle.sh b/touchpad_toggle.sh
new file mode 100644
index 0000000..974adb0
--- /dev/null
+++ b/touchpad_toggle.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# tp
+# Pone el touchpad en on/off.
+
+# Ubuntu Peronista
+
+# Obtiene el Identificador del touchpad.
+tp_id=`xinput list | grep -i touchpad | awk '{ print $6 }' | sed 's/id=//'`
+
+
+# Se fija si el touchpad estaba activado o no.
+tp_enabled=`xinput list-props $tp_id | grep Device\ Enabled | awk '{ print $4 }'`
+
+
+if [ $tp_enabled = 0 ]
+then
+ # Si el touchpad estaba desactivado, le da gimonte.
+ xinput set-prop $tp_id "Device Enabled" 1
+ notify-send "Touchpad activado"
+elif [ $tp_enabled = 1 ]
+then
+ # Si el touchad estaba activo, lo apaga.
+ xinput set-prop $tp_id "Device Enabled" 0
+ notify-send "Touchpad desactivado"
+else
+ echo "tp_toggle: No se pudo obtener el status del touchpad desde xinput."
+ exit 1
+fi
Un proyecto texto-plano.xyz