From 1827f0d9744868e6f81a695f53aeeaac031a50de Mon Sep 17 00:00:00 2001 From: Moritz Luedecke Date: Fri, 25 Dec 2020 15:03:50 +0100 Subject: [PATCH] Suffix "Length" to the dbus variables for the number of notifications --- dunstctl | 8 ++++---- src/dbus.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dunstctl b/dunstctl index c166fd8..50b63d0 100755 --- a/dunstctl +++ b/dunstctl @@ -66,11 +66,11 @@ case "${1:-}" in [ $# -eq 1 ] || [ "${2}" = "displayed" ] || [ "${2}" = "history" ] || [ "${2}" = "waiting" ] \ || die "Please give either 'displayed', 'history', 'waiting' or none as count 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}") + property_get waitingLength | ( read -r _ _ waiting; printf " Waiting: %s\n" "${waiting}" ) + property_get displayedLength | ( read -r _ _ displayed; printf " Currently displayed: %s\n" "${displayed}" ) + property_get historyLength | ( read -r _ _ history; printf " History: %s\n" "${history}") else - property_get ${2} | ( read -r _ _ notifications; printf "%s\n" "${notifications}"; ) + property_get ${2}Length | ( read -r _ _ notifications; printf "%s\n" "${notifications}"; ) fi ;; "history-pop") diff --git a/src/dbus.c b/src/dbus.c index 9c05111..f19fdcf 100644 --- a/src/dbus.c +++ b/src/dbus.c @@ -85,9 +85,9 @@ static const char *introspection_xml = " " " " - " " - " " - " " + " " + " " + " " " " ""; @@ -601,13 +601,13 @@ GVariant *dbus_cb_dunst_Properties_Get(GDBusConnection *connection, if (STR_EQ(property_name, "paused")) { return g_variant_new_boolean(!status.running); - } else if (STR_EQ(property_name, "displayed")) { + } else if (STR_EQ(property_name, "displayedLength")) { unsigned int displayed = queues_length_displayed(); return g_variant_new_uint32(displayed); - } else if (STR_EQ(property_name, "history")) { + } else if (STR_EQ(property_name, "historyLength")) { unsigned int history = queues_length_history(); return g_variant_new_uint32(history); - } else if (STR_EQ(property_name, "waiting")) { + } else if (STR_EQ(property_name, "waitingLength")) { unsigned int waiting = queues_length_waiting(); return g_variant_new_uint32(waiting); } else {