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

Add feature to copy the username #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ckotte
Copy link

@ckotte ckotte commented Aug 29, 2018

Sometimes it's needed to copy the username before the password.

If you press and hold the alt key, the username is copied instead of the password.

Sometimes it's needed to copy the username before the password.

If you press and hold the alt key, the username is copied instead of the password.
@CGenie
Copy link
Owner

CGenie commented Aug 30, 2018

Hello, thank you for that contribution, it's very useful!
However, it requires special format of the pass file, I guess I'd add that info to the README as well.
Moreover, I think that in case login: is missing in the pass file, you could copy the last part of the pass path, i.e. suppose you have github pass stored in

store/github.com/ckotte

Then, if login: is not in that pass file, I'd copy ckotte. What do you think?

@ckotte
Copy link
Author

ckotte commented Aug 30, 2018

Hi,

Sometimes I need to copy the login and password or just the password into the terminal or in a remote SSH/RDP session. Most of the time, I needed to open QtPass all the time to verify the account I need to use. Then I copied the password via alfred-pass. That's why I thought it would be nice to be able to copy the username via alfred-pass as well.

I also use browserpass on macOS and Linux which requires login: or user: in every pass file to work. On Linux there's also rofi-pass which can only use user: per default.

With browserpass, the structure also needs to include the URL to find the matching credentials automatically. E.g. store/github.com, or store/github.com/ckotte and store/github.com/test if you need two separate accounts.

Currently, login-show.sh will copy an empty string to the clipboard if login: or user: can't be found. I should add a check that oascript will be triggered only if the string isn't empty.

I assume you don't have user: or login: in your pass files and you don't use any of the tools I mentioned, right?

I can add the pass file format to the README. I can also add the code to copy the last part of the query if login: or user: can't be found. It would just copy the URL or the name if the format is store/github.com or store/GitHub.

@CGenie
Copy link
Owner

CGenie commented Aug 30, 2018

Yes, or just add the command description with pass file format to the README, that is fine as well I guess. Or preferably also copy the path to the pass file, just leaving out that initial store I think, pass requires it but no login uses it I think.

@ckotte
Copy link
Author

ckotte commented Aug 30, 2018

The query contains only github.com/ckotte if the path is .password-store/github.com/ckotte. You just need to extract the text after the last \ if there's no login: or user:.

Could you explain? I don't understand what you mean.

preferably also copy the path to the pass file

@rbuzatu90
Copy link

This looks usefull. Any Updates ? :)

@ckotte
Copy link
Author

ckotte commented Oct 29, 2018

This looks usefull. Any Updates ? :)

I didn't got any answer to my question

@CGenie
Copy link
Owner

CGenie commented Feb 4, 2019

Sorry for not being active in this project for long...

The query contains only github.com/ckotte if the path is .password-store/github.com/ckotte. You just need to extract the text after the last \ if there's no login: or user:.

Could you explain? I don't understand what you mean.

preferably also copy the path to the pass file

Yes, the format I use for pass is simple: store/<hostname>/<username> so for me it would be best to first check if login: or user: is in the pass file and if not, just use the last path part of the pass file.
About that comment of copying the path to the pass file: I guess I overengineered this, last path part would be enough imho :)

@CGenie
Copy link
Owner

CGenie commented Feb 5, 2019

Ah one more thing, you add the login-show.sh script which is based on pass-show.sh. That file was greatly improved in #14, you should take a look :)

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

Successfully merging this pull request may close these issues.

3 participants