Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rofimoji insists on having a typer, even with -a copy or -a print #158

Closed
vain opened this issue Sep 3, 2023 · 4 comments
Closed

rofimoji insists on having a typer, even with -a copy or -a print #158

vain opened this issue Sep 3, 2023 · 4 comments

Comments

@vain
Copy link

vain commented Sep 3, 2023

With my current experimental Wayland setup, I don't have a typer available. I noticed that rofimoji doesn't like this situation, even when it doesn't actually require a typer.

For example:

$ rofimoji -a print
Traceback (most recent call last):
  File "/usr/bin/rofimoji", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/picker/__main__.py", line 9, in main
    StandaloneRofimoji().standalone()
    ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/picker/standalone.py", line 22, in __init__
    self.active_window = self.typer.get_active_window()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/picker/typer/typer.py", line 26, in get_active_window
    raise NoTyperFoundException()
picker.typer.typer.NoTyperFoundException: Could not find a valid way to type characters.
Please check the required dependencies.

Explicitly specifying a typer, even though it's not installed and never used, can be used as a workaround:

$ command -v wtype
$ rofimoji --typer wtype -a print
👍

Bug or working as intended? :)

Thanks!

@fdw
Copy link
Owner

fdw commented Sep 3, 2023

wtype is a good choice for this, as it doesn't do anything in the early call (however, it's required for xtype).

I hadn't imagined someone using rofimoji purely for copying (or for typing, at that). Maybe it should use a NoneTyper as a fallback that will only error out when actually used? Is that reasonable?

@vain
Copy link
Author

vain commented Sep 3, 2023

I hadn't imagined someone using rofimoji purely for copying

I found -a copy to be the most reliable way (at least on X11, not sure about Wayland yet). Anything else had subtle bugs. (I hardly remember what they were. Here are my most recent notes on that matter. Maybe long fixed. At the end of the day, -a copy is very explicit and simple, and I know that the clipboard gets overwritten, so I can act accordingly.)

Maybe it should use a NoneTyper as a fallback that will only error out when actually used? Is that reasonable?

Sounds good to me. 👍

Thanks!

fdw added a commit that referenced this issue Sep 9, 2023
If the user doesn't want to type anything, but only to copy, then
rofimoji should allow this. It can die horribly when they actually try
to type without a typer.

Issue: #158
@fdw
Copy link
Owner

fdw commented Sep 9, 2023

I've found a much nicer fix. Feel free to try it out 🙂

@fdw fdw closed this as completed Sep 9, 2023
@vain
Copy link
Author

vain commented Sep 10, 2023

Works just as well. 👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants