parent
337ff1edb5
commit
c45a9eac73
@ -40,7 +40,7 @@ in dunst.
|
|||||||
Check if dunst is currently running or paused. If dunst is paused notifications
|
Check if dunst is currently running or paused. If dunst is paused notifications
|
||||||
will be kept but not shown until it is unpaused.
|
will be kept but not shown until it is unpaused.
|
||||||
|
|
||||||
=item B<set-running> true/false
|
=item B<set-running> true/false/toggle
|
||||||
|
|
||||||
Set the paused status of dunst. If true, dunst is running normally, if false,
|
Set the paused status of dunst. If true, dunst is running normally, if false,
|
||||||
dunst is paused. See the running command and the dunst man page for more
|
dunst is paused. See the running command and the dunst man page for more
|
||||||
|
39
dunstctl
39
dunstctl
@ -14,17 +14,17 @@ 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
|
||||||
running Check if dunst is running or paused
|
running Check if dunst is running or paused
|
||||||
set-running [true|false] Set the pause status
|
set-running [true|false|toggle] Set the pause status
|
||||||
debug Print debugging information
|
debug Print debugging information
|
||||||
help Show this help
|
help Show this help
|
||||||
EOH
|
EOH
|
||||||
}
|
}
|
||||||
dbus_send_checked() {
|
dbus_send_checked() {
|
||||||
@ -69,10 +69,19 @@ case "${1:-}" in
|
|||||||
;;
|
;;
|
||||||
"set-running")
|
"set-running")
|
||||||
[ "${2:-}" ] \
|
[ "${2:-}" ] \
|
||||||
|| die "No status parameter specified. Please give either 'true' or 'false' as running parameter."
|
|| die "No status parameter specified. Please give either 'true', 'false' or 'toggle' as running parameter."
|
||||||
[ "${2}" = "true" ] || [ "${2}" = "false" ] \
|
[ "${2}" = "true" ] || [ "${2}" = "false" ] || [ "${2}" = "toggle" ] \
|
||||||
|| die "Please give either 'true' or 'false' as running parameter."
|
|| die "Please give either 'true', 'false' or 'toggle' as running parameter."
|
||||||
property_set running variant:boolean:"${2}"
|
if [ "${2}" = "toggle" ]; then
|
||||||
|
paused=$(property_get running | ( read -r _ _ paused; printf "%s\n" "${paused}"; ))
|
||||||
|
if [ "${paused}" = "true" ]; then
|
||||||
|
property_set running variant:boolean:false
|
||||||
|
else
|
||||||
|
property_set running variant:boolean:true
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
property_set running variant:boolean:"${2}"
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
"help"|"--help"|"-h")
|
"help"|"--help"|"-h")
|
||||||
show_help
|
show_help
|
||||||
|
Loading…
x
Reference in New Issue
Block a user