Ajout : script pour basculer l'état d'activité de l'écran
This commit is contained in:
parent
2dabb80d6e
commit
71ebea0a9e
1 changed files with 21 additions and 0 deletions
21
bin/togglescreen
Normal file
21
bin/togglescreen
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/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
|
||||||
|
|
Loading…
Reference in a new issue