diff options
author | Suleyman Farajli <suleyman@farajli.net> | 2024-07-26 01:27:49 +0400 |
---|---|---|
committer | Suleyman Farajli <suleyman@farajli.net> | 2024-07-26 01:27:49 +0400 |
commit | 1747c1a2e981d2ce308d0be677758d9ee8ff4859 (patch) | |
tree | 126c21112927205e730645aa9d51798a390bcfc6 | |
parent | dec1997ab3e6b1584f8f5cff567a6475152d819e (diff) |
slight: bug fix
-rwxr-xr-x | scripts/slight | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/slight b/scripts/slight index 50f4a54..c690e69 100755 --- a/scripts/slight +++ b/scripts/slight @@ -21,7 +21,7 @@ err() { } run() { - if ! $(${1} > /dev/null 2>&1); then + if ! ${1} > /dev/null 2>&1; then err "%s""${2}" fi } @@ -40,14 +40,17 @@ while getopts "i:d:s:ph" option; do i) run "brightnessctl set +${OPTARG}%" \ "${0}: Failed to increase brightness" + exit 0 ;; d) run "brightnessctl set ${OPTARG}-%" \ "${0}: Failed to decrease brightness" + exit 0 ;; s) run "brightnessctl set ${OPTARG}%" \ "${0}: Failed to set brightness" + exit 0 ;; p) if ! brightnessctl 2>/dev/null; then @@ -60,3 +63,5 @@ while getopts "i:d:s:ph" option; do esac done + +err "${0}: Invalid usage\nTry '$0 -h' for help." |