From cd8c9fe3afbf150e0b051fc0d171f59dab1923d6 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Thu, 9 Jun 2022 14:52:59 +0200 Subject: [PATCH] Added support to pass on custom progress bar values. --- scripts/notify.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/notify.sh b/scripts/notify.sh index 84ece8b..faa63de 100755 --- a/scripts/notify.sh +++ b/scripts/notify.sh @@ -1,17 +1,17 @@ #!/usr/bin/env bash # Show system status in notification, or your own message -# Syntaxis: notify [-vb] [-t ] [ <message>] +# Syntaxis: notify [-vb] [-t <timeout>] [-p <value>] [<title> <message>] # Requirements: # - brightnessctl panic () { - >&2 echo "Syntaxis: notify [-vb] [<title> [<message>]]" + >&2 echo "Syntaxis: notify [-vb] [-t <timeout>] [-p <value>] [<title> <message>]" exit 1 } # Get options -while getopts ":bvt:" options; do +while getopts ":bvt:p:" options; do case "${options}" in b) value=$( brightnessctl | grep -o "[0-9]*%" | tr -d '%' ) @@ -35,6 +35,9 @@ while getopts ":bvt:" options; do ;; t) timeout="${OPTARG}" + ;; + p) + value="${OPTARG}" ;; *) panic