You are not logged in.
Since passmenu lacked a bit in versatility for my usage, I wrote my own wrapper in python.
There are two packages in the AUR: passdmenu-git and passdmenu
The source can be found on github.com/klaasb/passdmenu.
In particular I wanted the option to also extract the username (second whitespace-separated field on second line, or the only field on the second line) from the password file and and either copy it or automatically type it.
There are some more convenience options:
usage: passdmenu [-h] [-t] [-r] [-u] [-P] [-s STORE] [-B PASS_BIN]
[-D DMENU_BIN]
A dmenu frontend to pass. All passed arguments not listed below, are passed to
dmenu. Requires xclip in default mode.
optional arguments:
-h, --help show this help message and exit
-t, --type Use xdotool to type the username and/or password into
the currently active window.
-r, --return Presses "Return" after typing. Forces --type.
-u, --user Copy/type the username.
-P, --pw Copy/type the password. Default, use -u -P to copy
both username and password.
-s STORE, --store STORE
The path to the pass password store. Defaults to
~/.password-store
-B PASS_BIN, --pass PASS_BIN
The path to the pass binary. Defaults to /usr/bin/pass
-D DMENU_BIN, --dmenu DMENU_BIN
The path to the dmenu binary. Defaults to
/usr/bin/dmenu
Please let me know if this is useful for you and what improvements you can think of.
Last edited by kagebe (2014-11-10 18:09:53)
Offline
Thank you very much for this tool! It's exactly what I was searching. I have
tested it, but I have a problem. I use sxhkd to define my shortcuts. In sxhkd I have
defined the shortcut:
mod4 + w; l
passdmenu -uPt
When the active window is my browser (for example firefox or dwb) and I want to connect
to my webmail, I use the shortcut "mod4 + w; l" and the following is copied in the box of my
login:
user@gmx.netkey--clearmodifiersTabtype--clearmodifierspassword
I think the tab key isn't simulated with xdotool. Do I something wrong or there is a problem ?
Offline
Thanks for the post. Just before reading it, I noticed that as well. Fix will be up later.
Edit: Fix is up as release v1.0.3.
Last edited by kagebe (2014-11-24 15:52:11)
Offline
Thank you for the fix, it works now! I can login in my webmail without problem. Unfortunately it
doesn't work with all webmail. I have an account archlinux.info. I have to login here:
https://webmail.archlinux.info/
To connect, first I click the box "Username". Then I use my shortcut to execute
passdmenu -uPt
Then nothing is written under "Username", only some text is written in the box "Password".
If I do exactly the same for another webmail, it works. Do you have any idea
what happens here ?
Offline
Does the layout in your password file for archlinux.info differ somehow from the others?
You could just paste it here (password obscured of course).
Maybe the script does not get the username from the second line correctly. It should either parse "something<whitespace>username(<whitespace>)*whatever*" (e.g. "User: myusername") or just "username".
Offline
I have done the following:
pass insert -m Email/mykolab.com
Enter contents of Email/mykolab.com and press Ctrl+D when finished:
password
Username: user
If I try to connect on my webmail (Mykolab.com is another webmail, but the problem is the same
as for archlinux.info), I have the same problem. If I try for the same password here:
There is no problem. Do you think I should put everthing on one line ? I tried without success.
Last edited by Tristelune (2014-11-26 05:00:17)
Offline
Sorry, busy week.
It seems to me like you inserted a newline first into the password file.
Normally there is only a single empty line after 'Enter contents...'.
The script currently only looks at the first line and takes that as the password and gets the username like I describe above from the second line. If you shift those lines, it currently won't work as expected.
You can look at the generated file with 'pass edit Email/mykolab.com' and compare it with the file for gmx.ch.
If there's an empty line first, just delete it and save the file.
Offline
Thank you for your hint, but it still doesn't work. I had a look with 'pass edit Email/mykolab.com'
at the file, but there is no newline at the beginning. If I use the password stored in Email/mykolab.com
on the following website:
there is no problem, passdmenu works as expected. I first click in the box and there I use the shortcut.
But on
https://webmail.archlinux.info/
It doesn't work. I do the same: I click in the first box and then execute the shortcut. Could
try with one of your password and tell me if you have the same problem ?
Offline
Roundcube (the webmail software on archlinux.info) seems to handle a "key release" event of the return key by switching to the next input field (the password).
For some reason, when you press return to select the pass entry in dmenu, a "key release" event from the key press is "left over" and you browser handles it. Which leads to the problematic behaviour.
This also happens when pressing Return in the GPG-Passphrase dialog.
I'm not sure why these Key Release events are left over. I tried capturing it inside the python script, but I couldn't get it to work and am not sure whether I can fix it there.
Offline
Ok, I have also tried on the website and I see the difference between roundcube and
gmx. For me it would be an option to define another shortcut for roundcube (I mean
to call another tool or something like that). But if
I understand right, the problem comes from dmenu. When I will have time, I'll search if
I can find a way to suppresse a key event like the "key release".
Tell me if you find a fix and thank you for your explanation!
Offline
fix: Use rofi. with rofi you can use actions on return codes. if return code is =! 0 it will not affect the roundcube input field.
update: seems rofi will fix this with next release. so even enter would work
Last edited by Rasi (2015-05-20 17:46:25)
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline