Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions dunstctl
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ show_help() {
context Open context menu
count [displayed|history|waiting] Show the number of notifications
history Display notification history (in JSON)
history-clear Delete all notifications from history
history-clear Delete all notifications from history
history-pop [ID] Pop the latest notification from
history or optionally the
notification with given ID.
history-rm [ID] Remove the notification from
history with given ID.
is-paused Check if pause level is > 0
set-paused [true|false|toggle] Set the pause status
set-paused [true|false|toggle] Set the pause status
get-pause-level Get the current pause level
set-pause-level [level] Set the pause level
rule name [enable|disable|toggle] Enable or disable a rule by its name
Expand Down Expand Up @@ -123,7 +123,7 @@ case "${1:-}" in
property_set paused variant:boolean:"$2"
fi
;;
"rule")
"rule")
[ "${2:-}" ] \
|| die "No rule name parameter specified. Please give the rule name"
state=nope
Expand All @@ -140,21 +140,14 @@ case "${1:-}" in
"set-pause-level")
[ "${2:-}" ] \
|| die "No status parameter specified. Please give a number as paused parameter."
[ "$2" ] && [ -z "${2//[0-9]}" ] \
|| die "Please give a number as paused level parameter."
case "$2" in
(*[!0123456789]*)
die "Please give a number as paused level parameter." ;;
('')
die "Please give a number as paused level parameter." ;;
esac
property_set pauseLevel variant:uint32:"$2"
;;
"rule")
[ "${2:-}" ] \
|| die "No rule name parameter specified. Please give the rule name"
state=nope
[ "${3}" = "disable" ] && state=0
[ "${3}" = "enable" ] && state=1
[ "${3}" = "toggle" ] && state=2
[ "${state}" = "nope" ] \
&& die "No valid rule state parameter specified. Please give either 'enable', 'disable' or 'toggle'"
method_call "${DBUS_IFAC_DUNST}.RuleEnable" "string:${2:-1}" "int32:${state}" >/dev/null
;;
"help"|"--help"|"-h")
show_help
;;
Expand Down