21 lines
248 B
Bash
Executable file
21 lines
248 B
Bash
Executable file
#!/bin/sh -e
|
|
|
|
screen_is_on() {
|
|
[ "$(brightnessctl g)" -ne 0 ]
|
|
}
|
|
|
|
turn_on_screen() {
|
|
brightnessctl -r
|
|
}
|
|
|
|
turn_off_screen() {
|
|
brightnessctl -s
|
|
brightnessctl s 0
|
|
}
|
|
|
|
if screen_is_on; then
|
|
turn_off_screen
|
|
else
|
|
turn_on_screen
|
|
fi
|
|
|