Compare commits
No commits in common. "7cb3363539c42a6bde189841db2e2062033b35e3" and "7c0ebf50b5780fe8facddb1341c6b5610c5d3ddc" have entirely different histories.
7cb3363539
...
7c0ebf50b5
2 changed files with 4 additions and 15 deletions
11
bin/batstat
11
bin/batstat
|
@ -1,11 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
set -e
|
||||
|
||||
battery_capacity=$(cat "/sys/class/power_supply/${1}/capacity")
|
||||
|
||||
if [ "$battery_capacity" -lt 25 ]; then echo critical
|
||||
elif [ "$battery_capacity" -lt 50 ]; then echo low
|
||||
elif [ "$battery_capacity" -lt 75 ]; then echo medium
|
||||
elif [ "$battery_capacity" -lt 100 ]; then echo high
|
||||
else echo full
|
||||
fi
|
|
@ -1,8 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
set -e
|
||||
#!/bin/sh -e
|
||||
|
||||
screen_is_on() {
|
||||
[ "$(brightnessctl get)" -ne 0 ]
|
||||
[ "$(brightnessctl g)" -ne 0 ]
|
||||
}
|
||||
|
||||
turn_on_screen() {
|
||||
|
@ -11,7 +10,7 @@ turn_on_screen() {
|
|||
|
||||
turn_off_screen() {
|
||||
brightnessctl -s
|
||||
brightnessctl set 0
|
||||
brightnessctl s 0
|
||||
}
|
||||
|
||||
if screen_is_on; then
|
||||
|
@ -19,3 +18,4 @@ if screen_is_on; then
|
|||
else
|
||||
turn_on_screen
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue