Conversation
|
Ah I just realised that it doesn't put special fields (e.g. otp token, pass) into the clipboard. I'll update the PR in a bit. |
|
Example: |
moviuro
left a comment
There was a problem hiding this comment.
That was fast 👍 Some slight changes to do though.
| esac | ||
| if [[ ! -z "$wordToPrint" ]]; then | ||
| if [[ ${inclip} == "true" ]]; then | ||
| clipcontent=$(printf '%s%s ' "$clipcontent" "$wordToPrint") |
There was a problem hiding this comment.
What is the '%s%s ' supposed to be? Why is there a whitespace at the end?
There was a problem hiding this comment.
'%s%s ' basically requires two string arguments. (in that case clipcontent wordToPrint).
I don't know if the whitespace is required but lets look at an example:
If we have:
:clip user pass
without the whitespace the clipboard content after the auto fill would look like: userpass. Which is probably not the expected behaviour, therefore there's a whitespace after it so it turns to user pass.
There was a problem hiding this comment.
Certainly you mean '%s %s' instead of '%s%s '?
There was a problem hiding this comment.
Let's say we have this auto pass field: :clip user otp url
Then the content of the clipcontent looks like this (loop iteration -> result):
Look at the whitespaces here:
- clipcontent=""
clipcontent=$(printf '%s%s ' "" "<user>")->result: clipcontent="<user> "clipcontent=$(printf '%s%s ' "<user> " "<otp>")->result: clipcontent="<user> <otp> "clipcontent=$(printf '%s%s ' "<user> <otp> " "<url>")->result: clipcontent="<user> <otp> <url> "
There was a problem hiding this comment.
Does the whitespace at the end of the string not pose any issue?
| if [[ ${inclip} == "true" ]]; then | ||
| clipcontent=$(printf '%s%s ' "$clipcontent" "$wordToPrint") | ||
| else | ||
| printf '%s' "$wordToPrint" | xdotool type --clearmodifiers --file - |
There was a problem hiding this comment.
We should probably exile xdotool type --clearmodifiers --file - into a function of its own. Certainly for another PR, though.
rofi-pass
Outdated
| autopass () { | ||
| x_repeat_enabled=$(xset q | awk '/auto repeat:/ {print $3}') | ||
| inclip='false' | ||
| clipcontent="" |
There was a problem hiding this comment.
You should put both inclip and clipcontent as local variables.
README.md
Outdated
| respectively. | ||
| `:otp` will generate an OTP, either `pass-otp(1)` style, or according to the | ||
| `otp_method:`, if it is defined. | ||
| `:clip` puts every field after it into the clipboard. |
|
Alright, I'll update the PR on sunday or monday once I'm at home from vacation again! |
|
What exactly is the use case for this, by the way? |
|
It's to copy specific stuff into the clipboard. E.g. some websites /
programs are really weird with otp tokens and sometimes take longer or
slower to load.
Therefore I'd need to set a really long delay for those cases when the
prompt doesn't want to load. But waiting for that delay when the prompt is
already displayed is rather suboptimal.
So I just like to autofill username + password and copy paste the otp token
into the clipboard.
…On 8 March 2018 23:46:04 Rasmus Steinke ***@***.***> wrote:
What exactly is the use case for this, by the way?
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#117 (comment)
|
|
I see. Makes sense. |
|
Happy side-effect is that we don't even need to wipe the clipboard since it only contains a Time-based OTP. |
README.md
Outdated
| user: foo | ||
| url: http://example.com | ||
| oauth://[...] | ||
| autotype: user pass :clip :otp |
There was a problem hiding this comment.
Shouldn't that be user :tab pass :clip :otp?
implemented suggestion from #116