mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 06:12:34 +00:00
21 lines
552 B
Bash
Executable File
21 lines
552 B
Bash
Executable File
#!/bin/bash
|
|
|
|
INTERNAL="eDP-1" # check with `hyprctl monitors`
|
|
|
|
# Check lid event handler with:
|
|
#
|
|
# grep -A5 -i lid /proc/bus/input/devices
|
|
#
|
|
# The event is contained in the H: Handlers=kbd event<N>
|
|
#
|
|
DEVICE="/dev/input/event0" # replace with your lid event device
|
|
|
|
evtest --grab "$DEVICE" |
|
|
while read -r line; do
|
|
if echo "$line" | grep -q "SW_LID.*value 1"; then
|
|
hyprctl keyword monitor "$INTERNAL,disable"
|
|
elif echo "$line" | grep -q "SW_LID.*value 0"; then
|
|
hyprctl keyword monitor "$INTERNAL,preferred,auto,auto"
|
|
fi
|
|
done
|