carnager/rofi-pass

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

Closed this issue · 1 comments

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 "> "	)

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