Added support to pass on custom progress bar values.

This commit is contained in:
Tibo De Peuter 2022-06-09 14:52:59 +02:00
parent 92fb2eff9e
commit cd8c9fe3af

View file

@ -1,17 +1,17 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Show system status in notification, or your own message # Show system status in notification, or your own message
# Syntaxis: notify [-vb] [-t <timeout>] [<title> <message>] # Syntaxis: notify [-vb] [-t <timeout>] [-p <value>] [<title> <message>]
# Requirements: # Requirements:
# - brightnessctl # - brightnessctl
panic () { panic () {
>&2 echo "Syntaxis: notify [-vb] [<title> [<message>]]" >&2 echo "Syntaxis: notify [-vb] [-t <timeout>] [-p <value>] [<title> <message>]"
exit 1 exit 1
} }
# Get options # Get options
while getopts ":bvt:" options; do while getopts ":bvt:p:" options; do
case "${options}" in case "${options}" in
b) b)
value=$( brightnessctl | grep -o "[0-9]*%" | tr -d '%' ) value=$( brightnessctl | grep -o "[0-9]*%" | tr -d '%' )
@ -35,6 +35,9 @@ while getopts ":bvt:" options; do
;; ;;
t) t)
timeout="${OPTARG}" timeout="${OPTARG}"
;;
p)
value="${OPTARG}"
;; ;;
*) *)
panic panic