1
0
Fork 0
forked from ahurac/dotfiles
ahuarc-dotfiles/bin/togglescreen

22 lines
263 B
Text
Raw Normal View History

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