Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error in binding {kb-mode-previous,kb-mode-next,select}: cannot have an empty modifier #242

Closed
lonkaars opened this issue Feb 27, 2024 · 1 comment

Comments

@lonkaars
Copy link

lonkaars commented Feb 27, 2024

Rofi 1.7.5 seems to not correctly parse empty keybindings on the command-line:

$ rofi -version
Version: 1.7.5
$ echo "" | rofi -no-config -dmenu -kb-mode-previous '' -kb-mode-next '' -p '>'

This command should open rofi without errors, but gives the following errors:
image

rofi-pass uses empty keysims to clear the shortcuts, but these currently cause issues with rofi. A workaround I found is to use a single comma (normally used to specify lists, see man rofi-keys(5)) instead of an empty string, which appears to fix the issue. After this fix rofi-pass works normally.

This does seem to be an issue with rofi itself, so I am unsure if this change should be implemented here. I'll open up an issue over there ASAP edit: davatorium/rofi#1950.

Patch:

diff --git a/rofi-pass b/rofi-pass
index 5dba345..ca16ac2 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -454,8 +454,8 @@ mainMenu () {
 			-kb-custom-18 "${insert_pass}"
 			-kb-custom-19 "${qrcode}"
 		)
-		args+=( -kb-mode-previous ""    # These keyboard shortcut options are needed, because
-		-kb-mode-next ""            # Shift+<Left|Right> are otherwise taken by rofi.
+		args+=( -kb-mode-previous ","    # These keyboard shortcut options are needed, because
+		-kb-mode-next ","            # Shift+<Left|Right> are otherwise taken by rofi.
 		-select "$entry"
 		-p "> "	)
@lonkaars
Copy link
Author

This issue was caused by a custom wrapper that did not properly forward arguments, not rofi-pass or rofi.

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

No branches or pull requests

1 participant