Add xinput alias stuff

This commit is contained in:
Captain ALM 2024-05-30 18:29:36 +01:00
parent 1981d4b09c
commit 1094b14b5a
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1

View File

@ -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;
}