2024-04-06 23:38:51 +02:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
set -e
|
2023-06-12 22:40:02 +02:00
|
|
|
|
|
|
|
screen_is_on() {
|
2024-04-06 23:39:17 +02:00
|
|
|
[ "$(brightnessctl get)" -ne 0 ]
|
2023-06-12 22:40:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
turn_on_screen() {
|
|
|
|
brightnessctl -r
|
|
|
|
}
|
|
|
|
|
|
|
|
turn_off_screen() {
|
|
|
|
brightnessctl -s
|
2024-04-06 23:39:17 +02:00
|
|
|
brightnessctl set 0
|
2023-06-12 22:40:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if screen_is_on; then
|
|
|
|
turn_off_screen
|
|
|
|
else
|
|
|
|
turn_on_screen
|
|
|
|
fi
|