Closed PhilT closed 4 months ago
I was just playing with this a little more (of course after I merged it) and discovered that I can't seem to add an entry. Tofi doesn't seem to accept the 'Enter' key after typing in the 'Title', for example. Are you able to verify this behavior?
I was just playing with this a little more (of course after I merged it) and discovered that I can't seem to add an entry. Tofi doesn't seem to accept the 'Enter' key after typing in the 'Title', for example. Are you able to verify this behavior?
I've been using this locally and it's been working fine for me. Are you using it with ydotool
? I had some problems with pynput
.
It's a data-entry problem, not a typing problem. Pynput vs ydotool shouldn't affect this issue. It occurs when hitting enter after editing or adding an item in an entry. Tofi just sits there without registering the keypress. The selecting and typing of entries works fine. It's only with Tofi...bemenu, wofi, etc. work fine.
It's a data-entry problem, not a typing problem. Pynput vs ydotool shouldn't affect this issue. It occurs when hitting enter after editing or adding an item in an entry. Tofi just sits there without registering the keypress. The selecting and typing of entries works fine. It's only with Tofi...bemenu, wofi, etc. work fine.
Ah we might need to add --require-match=false
somewhere in that case. The default is to not accept the input unless there is at least one match. Possibly adding that to the dmenu_command
would fix it but maybe we need to add it cmdline in the code.
Same thing happens with password entry. Obviously it won't match any menu item so it's needed there which I added already.
I moved --require-match to the main command instead of just the password command. Can you please test the 'develop' branch and make sure it works for you?
I did some testing and for the most part seems to work okay. However, when editing a title, for example, if you enter text that matches the previous title it'll select that instead of the text you entered (which is understandable). I'm not sure if this is existing behavior or Tofi specific but perhaps it shouldn't pass in the original text in (if that's what keepmenu is doing).
I couldn't see any options in Tofi to ignore the input but I guess a workaround could be to edit it to something completely different then change it to what you want. However, typos being a standard scenario, this might be an edge case that would be worth fixing.
Personally I use a separate GUI to edit entries when I need to so I've not used this feature (until now). One problem I've always had is that I don't know if there is a way to get back to the main entry list when viewing/editing an entry. Pressing ESC just exits.
I feel like it might be a Tofi specific issue as I've used the variety of launchers to successfully edit entries before. If we can't figure out how to make it work, we probably should add a note to the README.
Yes, it's not a true GUI with the way you have to re-launch to get back to the main menu after hitting ESC. Prob something I could work on...at the risk of changing muscle memory for people who might have used it for awhile.
I'm actually wondering if this is the current default behavior for all menu tools.
For example, suppose I have an entry with the Title of: Google
.
If I edit the title and type Goo
it'll match the single entry of Google
and won't change. This is at least what happens in Tofi and Rofi (although the UI is a bit messed up on my Wayland setup for Rofi so it was a little tricky to confirm).
One option would be to pass inp="\n"
to dmenu_select
. This causes the UI to not display any menu items and the input is accepted as is.
Let me if know if this makes or not and I can add some screenshots. Maybe we can move this discussion to an issue as well.
On a side note: I'm wondering why the edit=
assignment is not in the penultimate conditional down at line 168 as this seems to be the only place it's used.
Further note: Other than the edge case of say a typo where you maybe added characters by mistake (or want to shorten the title or url for example, as detailed 2 posts above) it seems to work fine on the develop branch with the --require-match
change.
Tofi launcher support:
Styling is supplied via config file to
dmenu_command
. Being able to supply separate styling for password window and menu window would be handy but this works fine.