Comments (19)
You can already customize the actions a bit, but Enter
and delays are currently not supported. It's an interesting idea, but at the same time, it might be too complex for what rofi-rbw
is trying to do...
No promises, but I'll think about it. If you want to write a PR, I'd definitely look at it 🙂
from rofi-rbw.
Hey @f0rdprefect!
It took a while, but I've just pushed the first draft for this feature on the branch feature/low-level-typing-actions
. You can for example add delay
to the targets in --keybindings
, like --keybindings "Alt+1:type:username:enter:delay:password"
Could you please test it and report back?
from rofi-rbw.
Hey @fdw,
tried to see what happens when I follow your example.
I do not know how to make it work. I tried delay in seconds and milliseconds (5 or 5000) and also changed the position betwwen enter
and delay
no difference.
rofi-rbw --keybindings "Alt+1:type:username:enter:10000:password"
gives me <username>None<password>
No delay, no newline. Btw I use 'dotool' in a Wayland session...
I used poetry to enter a shell to call rofi-rbw and double checked that I am on the right branch:
git status
On branch feature/low-level-typing-actions
Your branch is up to date with 'origin/feature/low-level-typing-actions'.
which rofi-rbw
/home/matt/.cache/pypoetry/virtualenvs/rofi-rbw-Xcs6rh1C-py3.11/bin/rofi-rbw
from rofi-rbw.
Sorry for the misunderstanding; delay
is meant as this exact word - it's hardcoded for five seconds.
Does it work then?
from rofi-rbw.
I see.
The delay works. enter does not. I am starting rofi with a terminal in focus, so I would expect some commands not found error messages.
from rofi-rbw.
Yep, my approach was a bit too naive. Can you try again please?
from rofi-rbw.
Hmm, not looking good:
poetry run rofi-rbw --keybindings "Alt+1:type:username:enter:delay:password"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/matt/src/rofi-rbw/src/rofi_rbw/__main__.py", line 5, in main
RofiRbw().main()
^^^^^^^^^
File "/home/matt/src/rofi-rbw/src/rofi_rbw/rofi_rbw.py", line 19, in __init__
self.typer = Typer.best_option(self.args.typer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/matt/src/rofi-rbw/src/rofi_rbw/typer/typer.py", line 17, in best_option
return next(typer for typer in available_typers if typer.name() == name)()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Can't instantiate abstract class DotoolTyper with abstract method press_key
Btw dotool is version 1.3...
from rofi-rbw.
Sorry, I forgot dotool
. Can you please try again? I'm quite confident now 😉
from rofi-rbw.
Well:
poetry run rofi-rbw --keybindings "Alt+1:type:username:enter:delay:password"
dotool: WARNING: invalid delay: typedelay 0 type [email protected]
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/matt/src/rofi-rbw/src/rofi_rbw/__main__.py", line 5, in main
RofiRbw().main()
File "/home/matt/src/rofi-rbw/src/rofi_rbw/rofi_rbw.py", line 73, in main
self.__execute_action(credential)
File "/home/matt/src/rofi-rbw/src/rofi_rbw/rofi_rbw.py", line 90, in __execute_action
self.__type_targets(cred)
File "/home/matt/src/rofi-rbw/src/rofi_rbw/rofi_rbw.py", line 104, in __type_targets
self.typer.press_key(Key.ENTER)
File "/home/matt/src/rofi-rbw/src/rofi_rbw/typer/dotool.py", line 30, in press_key
run(["dotool"], input=f"key {key_name}")
File "/nix/store/w4fvvhkzb0ssv0fw5j34pw09f0qw84w8-python3-3.11.7/lib/python3.11/subprocess.py", line 550, in run
stdout, stderr = process.communicate(input, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/w4fvvhkzb0ssv0fw5j34pw09f0qw84w8-python3-3.11.7/lib/python3.11/subprocess.py", line 1194, in communicate
self._stdin_write(input)
File "/nix/store/w4fvvhkzb0ssv0fw5j34pw09f0qw84w8-python3-3.11.7/lib/python3.11/subprocess.py", line 1143, in _stdin_write
self.stdin.write(input)
TypeError: a bytes-like object is required, not 'str
from rofi-rbw.
Sorry for this, but I don't have dotool
working currently (in fact, I'm still mostly on X), so I can't really test it. Hopefully it's better now.
from rofi-rbw.
It is better. But dotool is still unhappy:
poetry run rofi-rbw --keybindings "Alt+1:type:username:enter:delay:password"
dotool: WARNING: invalid delay: typedelay 0 type [email protected]
dotool: WARNING: invalid delay: typedelay 0 type super-secret-password
There is a 5 seconds delay between the 2 dotool warnings.
Also there is no text output on the command line (because of the warning maybe).
from rofi-rbw.
The delay sounds good. But I can only guess what dotool
's problem is 😕
Can you please try again?
from rofi-rbw.
It works!!!
No more warnings. Behavior as described:
<username><enter>
<delay><password><enter>
Now of course it would be nice to configure the delay or even better come up with a convention similar to pass
Turns out that this is a pass plugin: https://github.com/wosc/pass-autotype
They way this is used could be really add benefit to rofi-rbw in my opinion. If you would parse the notes field for a autotype line and act accordingly!
from rofi-rbw.
It works!!!
🎉
Now of course it would be nice to configure the delay
I was hoping to avoid that complexity, especially for the syntax. Do you think it's important to have it configurable?
Turns out that this is a pass plugin: https://github.com/wosc/pass-autotype
They way this is used could be really add benefit to rofi-rbw in my opinion. If you would parse the notes field for a autotype line and act accordingly!
I've also thought about reading it from an entry's field, but I wanted to make the simple case work first 😉
There doesn't yet seem to be a common field name for it, and I wouldn't want to come into conflict with other apps, so I'm thinking of _rofi_rbw_autotype
. What do you think?
from rofi-rbw.
They delay flexibility is already fixed. One can call multiple delays. Now set it to 1s as default and this should be good,
Regarding the field name: I do not like leading underscores for names but I can see that coming from "private" variables in python. That is personal taste of course.
However it will be a save choice. I believe it would be rather strange if it was used for anything else than rofi-rbw
from rofi-rbw.
They delay flexibility is already fixed. One can call multiple delays.
I've reduced the delay, but if it's a common problem that one second is too short, I'd rather revisit the topic than to force everyone to use multiple delay
s.
Regarding the field name: I do not like leading underscores for names but I can see that coming from "private" variables in python. That is personal taste of course.
I think I wanted to additionally represent that this is not a "user-facing" field, but something that is only used programmatically. But maybe rofi_rbw_*
is already enough? I'm really not sure.
from rofi-rbw.
I've just added support for reading from a field called _autotype
. Could you please try it?
from rofi-rbw.
It Works!
Entered the data shown in the screenshot. Started with a terminal focused it will execute the two commands with a delay between them. Note the second enter...
from rofi-rbw.
Perfect, thank you!
from rofi-rbw.
Related Issues (20)
- Wofi shows formatting tags in entry list HOT 21
- wofi vs rofi HOT 5
- Wrong executable name HOT 1
- Keybinds not changing output HOT 4
- Unable to launch rofi-rbw from i3. HOT 10
- switch to yaml config file HOT 2
- Filter's out number `3` from password if using `Alt+3` to type password directly HOT 7
- New release with dotool support HOT 2
- I still see the issue where you cannot copy/type data from a custom field named 'password', even though it is visible. HOT 15
- show username/url HOT 4
- rofi history HOT 2
- pinentry uses X11 HOT 2
- xdotool type wrong passwords most of the time. HOT 16
- Change theme HOT 1
- rofi-rbw hangs when action is copy and the output is assigned to a bash variable HOT 3
- If no `--typing-key-delay` option is provided ` wtype` fails to type HOT 5
- Can't open rofi-rbw outside terminal HOT 3
- Wtype doesn't work with the default typing-key-delay HOT 3
- Issue with entry incorrectly formatted HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rofi-rbw.