Show the number of notifications via dunstctl
This commit is contained in:
parent
313731f0f2
commit
137361a95d
12
dunstctl
12
dunstctl
@ -23,6 +23,7 @@ show_help() {
|
|||||||
history-pop Pop one notification from history
|
history-pop Pop one notification from history
|
||||||
is-paused Check if dunst is running or paused
|
is-paused Check if dunst is running or paused
|
||||||
set-paused [true|false|toggle] Set the pause status
|
set-paused [true|false|toggle] Set the pause status
|
||||||
|
status [displayed|history|waiting] Show the number of notifications
|
||||||
debug Print debugging information
|
debug Print debugging information
|
||||||
help Show this help
|
help Show this help
|
||||||
EOH
|
EOH
|
||||||
@ -83,6 +84,17 @@ case "${1:-}" in
|
|||||||
property_set paused variant:boolean:"$2"
|
property_set paused variant:boolean:"$2"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
"status")
|
||||||
|
[ $# -eq 1 ] || [ "${2}" = "displayed" ] || [ "${2}" = "history" ] || [ "${2}" = "waiting" ] \
|
||||||
|
|| die "Please give either 'displayed', 'history', 'waiting' or none as status parameter."
|
||||||
|
if [ $# -eq 1 ]; then
|
||||||
|
property_get waiting | ( read -r _ _ waiting; printf " Waiting: %s\n" "${waiting}" )
|
||||||
|
property_get displayed | ( read -r _ _ displayed; printf " Currently displayed: %s\n" "${displayed}" )
|
||||||
|
property_get history | ( read -r _ _ history; printf " History: %s\n" "${history}")
|
||||||
|
else
|
||||||
|
property_get ${2} | ( read -r _ _ notifications; printf "%s\n" "${notifications}"; )
|
||||||
|
fi
|
||||||
|
;;
|
||||||
"help"|"--help"|"-h")
|
"help"|"--help"|"-h")
|
||||||
show_help
|
show_help
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user