summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/wobload15
1 files changed, 7 insertions, 8 deletions
diff --git a/.local/bin/wobload b/.local/bin/wobload
index ff3a2b1..0d8b121 100755
--- a/.local/bin/wobload
+++ b/.local/bin/wobload
@@ -18,7 +18,7 @@ err()
{
: "${1:?}"
- printf "\033[31;1merr: %b\033[0m\n" "$1"
+ printf "\033[31;1merr: %b\033[0m\n" "$1" 1>&2
command -v notify-send > /dev/null &&
notify-send " wob loader" "$1"
}
@@ -32,10 +32,13 @@ render()
main()
{
- exe="$1" && [ -z "$exe" ] &&
- usage && exit
+ exe="$1"
+ shift
- if [ ! -p "$wobpipe" ]; then
+ if [ -z "$exe" ]; then
+ usage
+ exit
+ elif [ ! -p "$wobpipe" ]; then
err "$wobpipe: named pipe does not exist"
exit 1
elif ! command -v "$exe" > /dev/null; then
@@ -43,7 +46,6 @@ main()
exit 127
fi
- shift
case "$exe" in
"wpctl")
wpctl "$@"
@@ -57,9 +59,6 @@ main()
data="$(brightnessctl info | grep -o '[0-9]*%')"
render "${data%\%}"
;;
- "")
- usage
- ;;
*)
err "${exe}: not implemented"
"$exe" "$@"