diff options
author | Markus Gräb <markus.graeb@gmail.com> | 2021-06-15 14:43:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-15 14:43:30 +0200 |
commit | 4fd4fb89af7e1a73427edb46035f640cf267fdc7 (patch) | |
tree | 0122a2cc3f498717338e0a1ef2e22e901164d467 | |
parent | 44140ac5b43a62805a03d1ab7bd9c7e23955e75d (diff) |
New keybinding Ctrl-Shift-Enter (#874)
This function combines accept-custom with the functionality to start
the command in terminal
Co-authored-by: Markus Gräb <m_graeb11@cs.uni-kl.de>
Co-authored-by: Dave Davenport <DaveDavenport@users.noreply.github.com>
-rw-r--r-- | doc/rofi.1.markdown | 1 | ||||
-rw-r--r-- | include/keyb.h | 1 | ||||
-rw-r--r-- | source/keyb.c | 1 | ||||
-rw-r--r-- | source/view.c | 7 |
4 files changed, 10 insertions, 0 deletions
diff --git a/doc/rofi.1.markdown b/doc/rofi.1.markdown index 716167eb..8ee28f52 100644 --- a/doc/rofi.1.markdown +++ b/doc/rofi.1.markdown @@ -789,6 +789,7 @@ Please see **rofi-theme(5)** manpage for more information on theming. * `Ctrl-Page Down`: Go to next column * `Ctrl-Enter`: Use entered text as a command (in `ssh/run modi`) * `Shift-Enter`: Launch the application in a terminal (in run mode) + * `Ctrl-Shift-Enter`: As Ctrl-Enter and run the command in terminal (in run mode) * `Shift-Enter`: Return the selected entry and move to the next item while keeping **rofi** open. (in dmenu) * `Shift-Right`: Switch to the next mode. The list can be customized with the `-switchers` argument. * `Shift-Left`: Switch to the previous mode. The list can be customized with the `-switchers` argument. diff --git a/include/keyb.h b/include/keyb.h index 04e7067a..67c49432 100644 --- a/include/keyb.h +++ b/include/keyb.h @@ -91,6 +91,7 @@ typedef enum ACCEPT_ENTRY, ACCEPT_ALT, ACCEPT_CUSTOM, + ACCEPT_CUSTOM_ALT, MODE_NEXT, MODE_COMPLETE, MODE_PREVIOUS, diff --git a/source/keyb.c b/source/keyb.c index ff71f193..edda3b75 100644 --- a/source/keyb.c +++ b/source/keyb.c @@ -62,6 +62,7 @@ ActionBindingEntry rofi_bindings[] = { .id = REMOVE_TO_SOL, .name = "kb-remove-to-sol", .binding = "Control+u", .comment = "Delete till the start of line" }, { .id = ACCEPT_ENTRY, .name = "kb-accept-entry", .binding = "Control+j,Control+m,Return,KP_Enter", .comment = "Accept entry" }, { .id = ACCEPT_CUSTOM, .name = "kb-accept-custom", .binding = "Control+Return", .comment = "Use entered text as command (in ssh/run modi)" }, + { .id = ACCEPT_CUSTOM_ALT, .name = "kb-accept-custom-alt", .binding = "Control+Shift+Return", .comment = "Use entered text as command (in ssh/run modi)" }, { .id = ACCEPT_ALT, .name = "kb-accept-alt", .binding = "Shift+Return", .comment = "Use alternate accept command." }, { .id = DELETE_ENTRY, .name = "kb-delete-entry", .binding = "Shift+Delete", .comment = "Delete entry from history" }, { .id = MODE_NEXT, .name = "kb-mode-next", .binding = "Shift+Right,Control+Tab", .comment = "Switch to the next mode." }, diff --git a/source/view.c b/source/view.c index f9aa21f9..e419b000 100644 --- a/source/view.c +++ b/source/view.c @@ -1436,6 +1436,13 @@ static void rofi_view_trigger_global_action ( KeyBindingAction action ) state->quit = TRUE; break; } + case ACCEPT_CUSTOM_ALT: + { + state->selected_line = UINT32_MAX; + state->retv = MENU_CUSTOM_INPUT | MENU_CUSTOM_ACTION; + state->quit = TRUE; + break; + } case ACCEPT_ENTRY: { // If a valid item is selected, return that.. |