Skip to content

Commit 4726fc0

Browse files
committed
Initial commit. Added help
1 parent 0ef0b8a commit 4726fc0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/llight.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#! /bin/bash
2+
3+
echo "llight 1.0 2020"
4+
5+
target_folder=/sys/class/backlight/intel_backlight/
6+
current_brightness=$(cat ${target_folder}/brightness)
7+
max_brightness=$(cat ${target_folder}/max_brightness)
8+
9+
# functions
10+
usage()
11+
{
12+
echo "$(basename $0) -[h | v | g | s | i | d]"
13+
echo " -h shows this help and exit"
14+
echo " -v shows version and exit"
15+
echo " -g shows current brightness and exit"
16+
echo " -s changes brightness by given value. Must be between 1 and ${max_brightness}"
17+
echo " -i increases brightness by given value"
18+
echo " -d decreases brightness by given value"
19+
20+
exit 1
21+
}
22+
23+
if [ $# -eq 0 ]; then
24+
usage
25+
fi
26+
27+
# truncate -s 0 ${target_folder}/brightness
28+
# echo ${current_brightness} > ${target_folder}/brightness
29+
30+
exit 0

0 commit comments

Comments
 (0)