Added timeout option

This commit is contained in:
Tibo De Peuter 2022-06-05 20:20:05 +02:00
parent cce12cea78
commit 3cc0b1a300

View file

@ -1,6 +1,6 @@
#!/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] [<title> <message>] # Syntaxis: notify [-vb] [-t <timeout>] [<title> <message>]
# Requirements: # Requirements:
# - brightnessctl # - brightnessctl
@ -12,7 +12,7 @@ panic () {
} }
# Get options # Get options
while getopts ":bv" options; do while getopts ":bvt:" options; do
case "${options}" in case "${options}" in
b) b)
value=$( brightnessctl | grep -o "[0-9]*%" ) value=$( brightnessctl | grep -o "[0-9]*%" )
@ -34,6 +34,9 @@ while getopts ":bv" options; do
timeout=2000 timeout=2000
category='sysinfo' category='sysinfo'
;; ;;
t)
timeout="${OPTARG}"
;;
*) *)
panic panic
;; ;;