Skip to content

Invoke default action when swaync-client --action is called without an index#712

Open
bakhtiyarneyman wants to merge 3 commits intoErikReider:mainfrom
bakhtiyarneyman:bn-default-action
Open

Invoke default action when swaync-client --action is called without an index#712
bakhtiyarneyman wants to merge 3 commits intoErikReider:mainfrom
bakhtiyarneyman:bn-default-action

Conversation

@bakhtiyarneyman
Copy link
Copy Markdown

Previously, --action without an index would call click_alt_action(0), which silently did nothing if the alt actions box wasn't visible. Now it invokes the notification's default action instead, matching user expectations. When an index is provided, the existing alt action behavior is preserved. Please note, that this is a breaking change: users might need to change their scripts.

bakhtiyarneyman and others added 2 commits March 12, 2026 03:32
… an index

Previously, `--action` without an index would call `click_alt_action(0)`,
which silently did nothing if the alt actions box wasn't visible. Now it
invokes the notification's default action instead, matching user expectations.
When an index is provided, the existing alt action behavior is preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…vior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ritiek added a commit to ritiek/dotfiles that referenced this pull request Apr 4, 2026
Comment thread src/client.vala Outdated
Comment on lines +82 to +83
print (" -a, \t --action [ACTION_INDEX]\t " +
"Invokes the action [ACTION_INDEX] of the latest notification\n");
"Invokes the default action, or action [ACTION_INDEX], of the latest notification\n");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better if an --action-default (or something similar) command was added instead. This wouldn't break existing configs.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, please take another look.

Per reviewer feedback, keep --action's original behavior (default to
action index 0) and add a separate --action-default / -ad command to
invoke the default action of the latest notification.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants