Compare commits
2 commits
f8bc3ef54b
...
378a7275bc
Author | SHA1 | Date | |
---|---|---|---|
finga | 378a7275bc | ||
finga | d1b8f48314 |
24
backlight_brightness.sh
Executable file
24
backlight_brightness.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
usage() {
|
||||
echo "usage: $0 value brightness_path"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
actual_brightness=$(cat "$2/actual_brightness")
|
||||
max_brightness=$(cat "$2/max_brightness")
|
||||
new_brightness=$(("$actual_brightness" + "$1"))
|
||||
|
||||
if [ "$new_brightness" -gt "$max_brightness" ]; then
|
||||
new_brightness="$max_brightness"
|
||||
elif [ "$new_brightness" -lt "0" ]; then
|
||||
new_brightness="0"
|
||||
fi
|
||||
|
||||
echo "$new_brightness" > "$2/brightness"
|
|
@ -28,6 +28,7 @@ borg create \
|
|||
--exclude '/var/tmp/*' \
|
||||
--exclude '/share/media/*' \
|
||||
--exclude '/var/lib/libvirt/images/*' \
|
||||
--exclude '/home/finga/.rustup' \
|
||||
\
|
||||
::'{hostname}-{now}' \
|
||||
/etc \
|
||||
|
|
Loading…
Reference in a new issue