tessen icon indicating copy to clipboard operation
tessen copied to clipboard

add support for shortcut key bindings

Open pengux opened this issue 3 years ago • 4 comments

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"

pengux avatar Jun 30 '22 13:06 pengux

Hi @pengux

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

  • native wayland support for rofi hasn't been merged upstream
  • only rofi supports customizable keyboard shortcuts, no other wayland native dmenu program does this at the moment

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.

ayushnix avatar Jun 30 '22 13:06 ayushnix

@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?

pengux avatar Jun 30 '22 20:06 pengux

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.

ayushnix avatar Jul 01 '22 02:07 ayushnix

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.

pengux avatar Jul 01 '22 06:07 pengux

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.

ayushnix avatar Mar 01 '23 18:03 ayushnix

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.

fbergroth avatar Mar 12 '23 09:03 fbergroth

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

  • 10 is mapped to the default auto type action which is usually username + password
  • 11 is mapped to auto typing the username
  • 12 is mapped to auto typing the password
  • 13 is mapped to opening the default URL
  • 14 is mapped to copying the username
  • 15 is mapped to copying the password
  • 16 is mapped to copying the URL

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.

ayushnix avatar Mar 12 '23 16:03 ayushnix

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

fbergroth avatar Mar 12 '23 16:03 fbergroth

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

ayushnix avatar Mar 12 '23 17:03 ayushnix

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

ayushnix avatar Mar 21 '23 22:03 ayushnix

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

ayushnix avatar Mar 22 '23 23:03 ayushnix