<div dir="ltr"><div>Something like this could work:</div><div><div><br></div><div><span style="font-family:monospace,monospace">windowid="$(xdotool search --name "site name")"</span><br></div><div><font face="monospace, monospace">if [[ "$(echo "$windowid" | wc -w)" -eq 1 ]]; then</font></div><div><font face="monospace, monospace">    echo -n "$pass" | xdotool windowactivate --sync "$windowid" type --file -</font></div><div><font face="monospace, monospace">fi</font></div><div><br></div></div><div>Many variants are possible.</div><div><br></div><div>Of course if the wrong window matches, you password will be typed into that window, which is bad. I don't know if this whole thing is a good idea but you are free to implement it.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 8 February 2016 at 15:09, Anas Syed <span dir="ltr"><<a href="mailto:anas27@gmail.com" target="_blank">anas27@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The problem with piping it to xdotool is it's tricky to add a delay that works in all scenarios. If gpg-agent is running, meaning you don't need to type out your password to decrypt your private key, then a simple sleep chained to xdotool works fine. But if you have to type out your password, then the "sleep" time is consumed while you type out the password, so you don't get the same delay. Also it's a lot of extra typing, as opposed to adding a single flag.<div><br></div><div>With regards to the choosing the window, I haven't looked into doing anything like that, but it sounds possible (but tricky to get right across all browsers and what not). Perhaps one could store extra information in the password file about the title of the site, so that the appropriate window is found (like a regex which matches on the site title). But this sounds messy and platform dependent.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 8 February 2016 at 14:55, Dashamir Hoxha <span dir="ltr"><<a href="mailto:dashohoxha@gmail.com" target="_blank">dashohoxha@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Mon, Feb 8, 2016 at 3:45 PM, Anas Syed <span dir="ltr"><<a href="mailto:anas27@gmail.com" target="_blank">anas27@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Whoops, forgot to hit reply all.<div><br></div><div>I focus the cursor in the browser before going to the terminal. Then I open up the terminal and use pass. A single Alt-Tab after typing out the command is all that's needed.</div><div><br></div><div>It works well for me, but of course other people may not like the idea.</div></div></blockquote><div><br></div></span><div>If you could tell `xdotool` which window (maybe based on title or url) and which fields to fill (username, password, etc.), then it would be a great tool. Otherwise, just piping the output of pass to xdotool could be OK. Have you tried it with piping? </div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>