Suffix "Length" to the dbus variables for the number of notifications
This commit is contained in:
		
							parent
							
								
									4d74c7b46e
								
							
						
					
					
						commit
						1827f0d974
					
				
							
								
								
									
										8
									
								
								dunstctl
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								dunstctl
									
									
									
									
									
								
							@ -66,11 +66,11 @@ case "${1:-}" in
 | 
				
			|||||||
		[ $# -eq 1 ] || [ "${2}" = "displayed" ] || [ "${2}" = "history" ] || [ "${2}" = "waiting" ] \
 | 
							[ $# -eq 1 ] || [ "${2}" = "displayed" ] || [ "${2}" = "history" ] || [ "${2}" = "waiting" ] \
 | 
				
			||||||
			|| die "Please give either 'displayed', 'history', 'waiting' or none as count parameter."
 | 
								|| die "Please give either 'displayed', 'history', 'waiting' or none as count parameter."
 | 
				
			||||||
		if [ $# -eq 1 ]; then
 | 
							if [ $# -eq 1 ]; then
 | 
				
			||||||
			property_get waiting   | ( read -r _ _ waiting;   printf "              Waiting: %s\n" "${waiting}" )
 | 
								property_get waitingLength   | ( read -r _ _ waiting;   printf "              Waiting: %s\n" "${waiting}" )
 | 
				
			||||||
			property_get displayed | ( read -r _ _ displayed; printf "  Currently displayed: %s\n" "${displayed}" )
 | 
								property_get displayedLength | ( read -r _ _ displayed; printf "  Currently displayed: %s\n" "${displayed}" )
 | 
				
			||||||
			property_get history   | ( read -r _ _ history;   printf "              History: %s\n" "${history}")
 | 
								property_get historyLength   | ( read -r _ _ history;   printf "              History: %s\n" "${history}")
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			property_get ${2} | ( read -r _ _ notifications; printf "%s\n" "${notifications}"; )
 | 
								property_get ${2}Length | ( read -r _ _ notifications; printf "%s\n" "${notifications}"; )
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
		;;
 | 
							;;
 | 
				
			||||||
	"history-pop")
 | 
						"history-pop")
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										12
									
								
								src/dbus.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/dbus.c
									
									
									
									
									
								
							@ -85,9 +85,9 @@ static const char *introspection_xml =
 | 
				
			|||||||
    "            <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"true\"/>"
 | 
					    "            <annotation name=\"org.freedesktop.DBus.Property.EmitsChangedSignal\" value=\"true\"/>"
 | 
				
			||||||
    "        </property>"
 | 
					    "        </property>"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "        <property name=\"displayed\" type=\"u\" access=\"read\" />"
 | 
					    "        <property name=\"displayedLength\" type=\"u\" access=\"read\" />"
 | 
				
			||||||
    "        <property name=\"history\" type=\"u\" access=\"read\" />"
 | 
					    "        <property name=\"historyLength\" type=\"u\" access=\"read\" />"
 | 
				
			||||||
    "        <property name=\"waiting\" type=\"u\" access=\"read\" />"
 | 
					    "        <property name=\"waitingLength\" type=\"u\" access=\"read\" />"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    "    </interface>"
 | 
					    "    </interface>"
 | 
				
			||||||
    "</node>";
 | 
					    "</node>";
 | 
				
			||||||
@ -601,13 +601,13 @@ GVariant *dbus_cb_dunst_Properties_Get(GDBusConnection *connection,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (STR_EQ(property_name, "paused")) {
 | 
					        if (STR_EQ(property_name, "paused")) {
 | 
				
			||||||
                return g_variant_new_boolean(!status.running);
 | 
					                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();
 | 
					                unsigned int displayed = queues_length_displayed();
 | 
				
			||||||
                return g_variant_new_uint32(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();
 | 
					                unsigned int history =  queues_length_history();
 | 
				
			||||||
                return g_variant_new_uint32(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();
 | 
					                unsigned int waiting =  queues_length_waiting();
 | 
				
			||||||
                return g_variant_new_uint32(waiting);
 | 
					                return g_variant_new_uint32(waiting);
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user