-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdisableInput.sh
More file actions
31 lines (29 loc) · 865 Bytes
/
Copy pathdisableInput.sh
File metadata and controls
31 lines (29 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
#
# @AUTHOR: Luca Leon Happel
#
#######################################
# Disable keyboard and touchpad
#######################################
echo "Disabling keyboard and touchpad"
for id in $(xinput --list | sed -n '/.*Touchpad/s/.*=\([0-9]\+\).*/\1/p')
do
xinput --disable $id
done
for id in $(xinput --list | sed -n '/.*Mouse/s/.*=\([0-9]\+\).*/\1/p')
do
xinput --disable $id
done
for id in $(xinput --list | sed -n '/.*Keyboard/s/.*=\([0-9]\+\).*/\1/p')
do
xinput --disable $id
done
#######################################
# Save current keyboard brightness
#######################################
# TODO: Change this to a more generic solution
for bl in $(brightnessctl --list | sed -n "/.*kbd.*/s/Device '//p" | sed -n "s/' of class 'leds'://p")
do
brightnessctl --device "$bl" --save
brightnessctl --device "$bl" set 0
done