diff --git a/README.md b/README.md index de80065dd..2b71402ef 100644 --- a/README.md +++ b/README.md @@ -146,12 +146,6 @@ you do want it removed as well. ## Troubleshooting -### Shortcuts stopped working - -Shortcut support and `[shortcuts]` section in config have been removed for -simplicity. Use your window manager/desktop environment and `dunstctl` to -replace it. - ### Cannot set settings via command line This functionality was removed during the refactor. It might be re-added later diff --git a/docs/dunst.5.pod b/docs/dunst.5.pod index 5dce49dcf..b3e65d23d 100644 --- a/docs/dunst.5.pod +++ b/docs/dunst.5.pod @@ -558,6 +558,37 @@ the notification sent before the user defined timeout. =back +=head2 Keyboard shortcuts (X11 only) + +Keyboard shortcuts are defined in the following format: "Modifier+key" where the +modifier is one of ctrl,mod1,mod2,mod3,mod4 and key is any keyboard key. + +Note that the keyboard shortcuts have been moved to the B section of the +config for consistency with other settings. + +Alternatively you can also define shortcuts inside your window manager and bind +them to dunstctl(1) commands. + +=over 4 + +=item B + +Specifies the keyboard shortcut for closing a notification. + +=item B + +Specifies the keyboard shortcut for closing all currently displayed notifications. + +=item B + +Specifies the keyboard shortcut for recalling a single notification from history. + +=item B + +Specifies the keyboard shortcut that opens the context menu. + +=back + =head2 Urgency sections The urgency sections work in a similar way to rules and can be used to specify @@ -1111,12 +1142,6 @@ Time units understood by dunst are "ms", "s", "m", "h" and "d". Example time: "1000ms" "10m" -=head1 MISCELLANEOUS - -Dunst used to provide shortcuts to act on notifications via key-bindings, but it -has now been moved to its own utility. For more information, see the manual for -dunstctl(1). - =head1 AUTHORS Written by Sascha Kruse diff --git a/src/settings_data.h b/src/settings_data.h index 6b83b6135..35e1a09c5 100644 --- a/src/settings_data.h +++ b/src/settings_data.h @@ -1412,6 +1412,47 @@ static const struct setting allowed_settings[] = { .parser_data = NULL, }, + // Keyboard shortcuts (still in global section) + { + .name = "close", + .section = "global", + .description = "Shortcut for closing one notification", + .type = TYPE_STRING, + .default_value = "none", + .value = &settings.close_ks.str, + .parser = NULL, + .parser_data = NULL, + }, + { + .name = "close_all", + .section = "global", + .description = "Shortcut for closing all notifications", + .type = TYPE_STRING, + .default_value = "none", + .value = &settings.close_all_ks.str, + .parser = NULL, + .parser_data = NULL, + }, + { + .name = "history", + .section = "global", + .description = "Shortcut to pop the last notification from history", + .type = TYPE_STRING, + .default_value = "none", + .value = &settings.history_ks.str, + .parser = NULL, + .parser_data = NULL, + }, + { + .name = "context", + .section = "global", + .description = "Shortcut for context menu", + .type = TYPE_STRING, + .default_value = "none", + .value = &settings.context_ks.str, + .parser = NULL, + .parser_data = NULL, + }, }; #endif /* vim: set ft=c tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/utils.c b/src/utils.c index 07ca9189b..862c9903d 100644 --- a/src/utils.c +++ b/src/utils.c @@ -361,7 +361,7 @@ static const char* deprecated_sections[] = { static const char* deprecated_sections_message[] = { "The settings from the frame section have been moved to the global section.", // frame - "Acting on notifications has been moved to its own utility. For more information, see the manual for dunstctl.", // shortcuts + "Settings in the shortcuts sections have been moved to the global section.\nAlternatively you can bind shortcuts in you window manager to dunstctl commands. For that, see the manual for dunstctl.", // shortcuts }; /* see utils.h */