about summary refs log tree commit diff
path: root/scripts/toggle-touchpad.sh
blob: 5a3052829a6b5683b382aad53b224c87513f3e24 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash

ID=$(xinput list | grep -Eo 'TouchPad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}')
STATE=$(xinput list-props "$ID" | awk '/Device Enabled/ {print $4}')

if [ "$STATE" -eq 1 ]
then
    xinput disable "$ID"
else
    xinput enable "$ID"
fi

Consider giving Nix/NixOS a try! <3