Show the number of notifications via dunstctl
This commit is contained in:
parent
313731f0f2
commit
137361a95d
34
dunstctl
34
dunstctl
@ -14,17 +14,18 @@ show_help() {
|
|||||||
cat <<-EOH
|
cat <<-EOH
|
||||||
Usage: dunstctl <command> [parameters]"
|
Usage: dunstctl <command> [parameters]"
|
||||||
Commands:
|
Commands:
|
||||||
action Perform the default action, or open the
|
action Perform the default action, or open the
|
||||||
context menu of the notification at the
|
context menu of the notification at the
|
||||||
given position
|
given position
|
||||||
close Close the last notification
|
close Close the last notification
|
||||||
close-all Close the all notifications
|
close-all Close the all notifications
|
||||||
context Open context menu
|
context Open context menu
|
||||||
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
|
||||||
debug Print debugging information
|
status [displayed|history|waiting] Show the number of notifications
|
||||||
help Show this help
|
debug Print debugging information
|
||||||
|
help Show this help
|
||||||
EOH
|
EOH
|
||||||
}
|
}
|
||||||
dbus_send_checked() {
|
dbus_send_checked() {
|
||||||
@ -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