Skip to content

Commit

Permalink
Update completions
Browse files Browse the repository at this point in the history
  • Loading branch information
bynect committed May 3, 2024
1 parent 9e5aaf0 commit 14ecba5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
16 changes: 8 additions & 8 deletions completions/_dunstctl.zshcomp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#compdef _dunstctl dunstctl

# ZSH arguments completion script for the dunstctl commnd
# ZSH arguments completion script for the dunstctl command
# Depends on: gAWK (rule), jq (history-pop)

local curcontext="$curcontext" ret=1
Expand All @@ -17,20 +17,20 @@ case $state in
local -a commands
commands=(
'action:Perform the default action, or open the context menu of the notification at the given position'
'close:Close the last notification'
'close-all:Close the all notifications'
'close:Close the last notification or optionally the notification with given ID'
'close-all:Close all the notifications'
'context:Open context menu'
'count:Show the number of notifications'
'history:Display notification history (in JSON)'
'history-pop:Pop the latest notification from history or optionally the notification with given ID.'
'is-paused:Check if dunst is running or paused'
'history-pop:Pop the latest notification from history or optionally the notification with given ID'
'is-paused:Check if pause level is greater than 0'
'set-paused:Set the pause status'
'get-pause-level:Get current dunst's pause level'
'set-pause-level:Set current dunst's pause level'
'get-pause-level:Get the current pause level'
'set-pause-level:Set the pause level'
'rule:Enable or disable a rule by its name'
'rules:Displays configured rules'
'debug:Print debugging information'
'help:Show this help'
'help:Show help'
)
_describe commands commands && ret=0
;;
Expand Down
2 changes: 1 addition & 1 deletion completions/dunstctl.bashcomp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ _dunstctl() {
local opts cur prev
_get_comp_words_by_ref cur prev
COMPREPLY=()
opts='action close close-all context count debug help history history-clear history-pop history-rm is-paused rule rules set-paused'
opts='action close close-all context count debug help history history-clear history-pop history-rm is-paused rule rules set-paused get-pause-level set-pause-level'

case "$prev" in
count) COMPREPLY=( $( compgen -W 'displayed history waiting' -- "$cur" ) )
Expand Down
12 changes: 7 additions & 5 deletions completions/dunstctl.fishcomp
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,25 @@ end

# commands
complete -c dunstctl -f -n __fish_use_subcommand -a action -d 'Perform the default action, or open the context menu of the notification at the given position'
complete -c dunstctl -f -n __fish_use_subcommand -a close -d 'Close the last notification'
complete -c dunstctl -f -n __fish_use_subcommand -a close-all -d 'Close the all notifications'
complete -c dunstctl -f -n __fish_use_subcommand -a close -d 'Close the last notification or optionally the notification with given ID'
complete -c dunstctl -f -n __fish_use_subcommand -a close-all -d 'Close all the notifications'
complete -c dunstctl -f -n __fish_use_subcommand -a context -d 'Open context menu'
complete -c dunstctl -f -n __fish_use_subcommand -a count -d 'Show the number of notifications'
complete -c dunstctl -f -n __fish_use_subcommand -a history -d 'Display notification history (in JSON)'
complete -c dunstctl -f -n __fish_use_subcommand -a history-clear -d 'Delete all notifications from history'
complete -c dunstctl -f -n __fish_use_subcommand -a history-pop -d 'Pop the latest notification from history or optionally the notification with given ID'
complete -c dunstctl -f -n __fish_use_subcommand -a history-rm -d 'Remove the notification from history with given ID'
complete -c dunstctl -f -n __fish_use_subcommand -a is-paused -d 'Check if dunst is running or paused'
complete -c dunstctl -f -n __fish_use_subcommand -a is-paused -d 'Check if pause level is greater than 0'
complete -c dunstctl -f -n __fish_use_subcommand -a set-paused -d 'Set the pause status'
complete -c dunstctl -f -n __fish_use_subcommand -a get-pause-level -d 'Get the current pause level'
complete -c dunstctl -f -n __fish_use_subcommand -a set-pause-level -d 'Set the pause level'
complete -c dunstctl -f -n __fish_use_subcommand -a rules -d 'Displays configured rules (optionally in JSON)'
complete -c dunstctl -f -n __fish_use_subcommand -a rule -d 'Enable or disable a rule by its name'
complete -c dunstctl -f -n __fish_use_subcommand -a debug -d 'Print debugging information'
complete -c dunstctl -f -n __fish_use_subcommand -a help -d 'Show this help'
complete -c dunstctl -f -n __fish_use_subcommand -a help -d 'Show help'

# command specific arguments
complete -c dunstctl -x -n '__fish_seen_subcommand_from action close close-all context history history-clear is-paused debug help'
complete -c dunstctl -x -n '__fish_seen_subcommand_from action close close-all context history history-clear is-paused get-pause-level set-pause-level debug help'
complete -c dunstctl -x -n '__fish_seen_subcommand_from count' -a 'displayed history waiting'
complete -c dunstctl -x -n '__fish_seen_subcommand_from history-pop history-rm' -a '(__fish_dunstctl_info history id appname)'
complete -c dunstctl -x -n '__fish_seen_subcommand_from set-paused' -a 'true false toggle'
Expand Down
2 changes: 1 addition & 1 deletion docs/dunstctl.pod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You can optionally pass an ID to close the matching notification (if present).

=item B<close-all>

Close all notifications currently being displayed
Close all notifications currently being displayed.

=item B<context>

Expand Down
8 changes: 4 additions & 4 deletions dunstctl
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ show_help() {
given position
close [ID] Close the last notification or the
notification with given ID.
close-all Close the all notifications
close-all Close all the notifications
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-pop [ID] Pop the latest notification from
history or optionally the
notification with given ID.
notification with given ID
history-rm ID Remove the notification from
history with given ID.
is-paused Check if pause level is > 0
is-paused Check if pause level is greater than 0
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
rules [--json] Displays configured rules (optionally
in JSON)
debug Print debugging information
help Show this help
help Show help
EOH
}
dbus_send_checked() {
Expand Down

0 comments on commit 14ecba5

Please sign in to comment.