Riyyi
6 years ago
6 changed files with 69 additions and 26 deletions
@ -0,0 +1,40 @@ |
|||||||
|
#!/bin/sh |
||||||
|
|
||||||
|
# General brightness management |
||||||
|
|
||||||
|
RELOAD="$HOME/.scripts/panel/brightness.sh" |
||||||
|
|
||||||
|
[ -z "$2" ] && NUM="5" || NUM="$2" |
||||||
|
|
||||||
|
help() { |
||||||
|
B=$(tput bold) |
||||||
|
N=$(tput sgr0) |
||||||
|
|
||||||
|
cat << EOF |
||||||
|
${B}NAME${N} |
||||||
|
brightnesscontrol - control the volume of the system |
||||||
|
|
||||||
|
${B}SYNOPSIS${N} |
||||||
|
./brightnesscontrol.sh <command> [<arg1>] |
||||||
|
|
||||||
|
${B}DESCRIPTION${N} |
||||||
|
Commands can be truncated, i.e. |
||||||
|
\`${B}brightnesscontrol.sh s${N}\` for \`${B}brightnesscontrol.sh set${N}\` |
||||||
|
|
||||||
|
Arguments need to be of numeric value. |
||||||
|
|
||||||
|
${B}COMMANDS${N} |
||||||
|
${B}u*, up <amount>${N} |
||||||
|
|
||||||
|
${B}d*, down <amount>${N} |
||||||
|
|
||||||
|
${B}s*, set <volume>${N} |
||||||
|
EOF |
||||||
|
} |
||||||
|
|
||||||
|
case "$1" in |
||||||
|
u*) brightnessctl -q s +"$NUM"% ; $RELOAD ;; |
||||||
|
d*) brightnessctl -q s "$NUM"%- ; $RELOAD ;; |
||||||
|
s*) brightnessctl -q s "$NUM"% ; $RELOAD ;; |
||||||
|
*) help ;; |
||||||
|
esac |
Loading…
Reference in new issue