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
# 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:
# - 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