diff --git a/bash_aliases b/bash_aliases index 286ce85..43d268d 100644 --- a/bash_aliases +++ b/bash_aliases @@ -121,3 +121,22 @@ function tpm2-contents() { sudo tmp2_pcrread sudo tpm2_pcrread } +alias list-xinput-devices="xinput list" +function disable-xinput-device() { + if [ -z $1 ]; then + echo "Provide a device name fragment."; + else + cdid=$(xinput list | grep "$1" | head -1 | grep -Po 'id=\K[^\t]*' | head -1); + echo "Disabling: $cdid"; + xinput disable $cdid; + fi; +} +function enable-xinput-device() { + if [ -z $1 ]; then + echo "Provide a device name fragment."; + else + cdid=$(xinput list | grep "$1" | head -1 | grep -Po 'id=\K[^\t]*' | head -1); + echo "Enabling: $cdid"; + xinput enable $cdid; + fi; +}