ayushnix / tessen

an interactive menu to autotype and copy pass and gopass data
GNU General Public License v2.0
77 stars 12 forks source link

add support for shortcut key bindings #30

Closed pengux closed 1 year ago

pengux commented 2 years ago

requesting support for key bindings similar to the ones in rofi-pass:

# Custom Keybindings
autotype="Alt+1"
type_user="Alt+2"
type_pass="Alt+3"
open_url="Alt+4"
copy_name="Alt+u"
copy_url="Alt+l"
copy_pass="Alt+p"
show="Alt+o"
copy_entry="Alt+2"
type_entry="Alt+1"
copy_menu="Alt+c"
action_menu="Alt+a"
type_menu="Alt+t"
help="Alt+h"
switch="Alt+x"
insert_pass="Alt+n"
ayushnix commented 2 years ago

Hi @pengux

Unfortunately, I don't think I'll work on this feature at this moment because

I'd be willing to work on this feature if rofi ever gets upstream native wayland support. It doesn't look like this is going to happen anytime soon.

pengux commented 2 years ago

@ayushnix thanks for the reply. Currently, as I understand it, rofi does work with Wayland as I was using it with Sway. And the fork which supports Wayland natively fixes some issues such as clipboard access for me and it seems to be up-to-date with upstream. But even if Wayland support is missing, there are some keybindings that can still be implemented such as copy_name and copy_pass for example as it doesn't require xdotool or ydotool. I've also noticed that tools such as rofi-rbw is using wtype to accomplish autotype in wayland so perhaps that is an option?

ayushnix commented 2 years ago

rofi does work with Wayland as I was using it with Sway. And the fork which supports Wayland

That's what I meant, the upstream rofi software doesn't support wayland, a fork made by lbonn does.

I've also noticed that tools such as rofi-rbw is using wtype to accomplish autotype in wayland so perhaps that is an option?

tessen uses wtype to perform autotype operations on sway.

I noticed that wofi also supports custom keybindings. Considering wofi is a wayland native dmenu program, I'm now inclined to support custom keybindings in tessen.

Thanks, I'll try to implement this feature. Meanwhile, if you want to submit a pull request, that'd be welcome as well. Please see the CONTRIBUTING.md if you're interested.

pengux commented 2 years ago

Thanks, I'll try to implement this feature. Meanwhile, if you want to submit a pull request, that'd be welcome as well. Please see the CONTRIBUTING.md if you're interested.

That's great! My knowledge of shell scripts is not good enough for a PR but I'll help test things out if you need it.

ayushnix commented 1 year ago

Hi, I've implemented this feature in a branch called custom-keybinds. I'll use this feature for a few days before making a release. Meanwhile, anyone wants to test it, please do and report errors/bugs if any.

fbergroth commented 1 year ago

Hi, I've implemented this feature in a branch called custom-keybinds.

Interesting, can you give an example of how you are using it? It would be nice to have OTP actions mapped too.

ayushnix commented 1 year ago

Interesting, can you give an example of how you are using it?

I should've documented the feature. 😅

I've mapped exit codes starting from 10 in the following order

You can use dmenu programs like fuzzel, bemenu, and rofi to map these exit codes to whatever shortcuts you like.

It would be nice to have OTP actions mapped too.

Thanks for the suggestion, I'll map this action to exit code 17.

fbergroth commented 1 year ago

Thanks, I was using tofi, and wasn't aware that the others had that functionality.

ayushnix commented 1 year ago

The next stable release will promote fuzzel as the default dmenu backend for tessen.

ayushnix commented 1 year ago

I've mapped autotyping and copying OTP to custom exit codes as well. The v2.2.0 release should probably be out tomorrow.

ayushnix commented 1 year ago

This feature has now been added in version 2.2.0. Let me know if anyone has any questions or issues using it.