Different return value for "custom" entry? #2020
Replies: 2 comments
-
If I understand your problem, I think you can use the same language you are using to call rofi (bash?) to verify if the value returned by rofi is an element of the set of values you used to call rofi. You don't need rofi to tell you that. Example (no particular programming language..)
|
Beta Was this translation helpful? Give feedback.
-
This seems to be a bug. I'm not a rofi dev/expert but I'm using this feature heavily. Example using
Edit: After reading again your comment and thinking more about it, I think you are not understanding From the docs:
So yes, it always returns 0 if you accept your entry with |
Beta Was this translation helpful? Give feedback.
-
For a script I am writing I need to know if a user has entered a "custom" value (i.e. one not in the list). Is is possible to do this?
I know there is
-no-custom
, but that completely disables custom entries, which isn't the behaviour I want. I need to detect custom entries that and entered using the normalEnter
key.I find info about the variable
ROFI_RETV
, but it doesn't seem to work. Running this for example:cat file.txt | rofi -i -p "Launcher" -dmenu
, and thenecho $ROFI_RETV
, it's blankThe return value
$?
is 0 regardless of if it's a custom entry or notIs there a way to detect custom entries via return value, or in some other way? I could use
-format i
and then-1
means a custom entry, but that complicates my scriptEdit:
The current best idea I have is to use
-format "i - s"
, and then read the first two chracters, if they are-1
, it's a custom entry. Then delete the index and hyphen.Beta Was this translation helpful? Give feedback.
All reactions