Re: [CopyQ] passmenu and copyq

28 views
Skip to first unread message

Lukáš Holeček

unread,
Jul 13, 2022, 8:45:13 AM7/13/22
to sklorpion, CopyQ
To run the script from command line (bash) use:

    cat script.js | copyq eval -

(notice the additional hyphen at the end)


There is now ItemSelection object that supports a better item manipulation:

    // Find all items containing "abc" and remove them.
    ItemSelection().select(/abc/).removeAll();


Lukas

On Tue, Jul 12, 2022 at 9:32 PM sklorpion <siu...@gmail.com> wrote:
Hello and thank you for great tool!

I'm trying to make it work with pass command or passmenu for storing passwords.
I read a lot but and cant figure it out, finally I decided i need to find XYZ string in copyq and remove it after 45 sek. I dont know how can i search item from command line and then remove it.
/Pass application just  echos password to clipbboard/

i tryed to disable copyq, run pass command and then enable copyq again, and other crazy solutions but with no results.

I dont know why scripts doesnt work ex:

i have this file as scrip.js:
var match = "abc;
var i = 0;
while (i < size() && str(read(i)).indexOf(match) === -1)
  ++i;
select(i);

then i cat script.js | copyq eval
but i does not select appropriate stirnng in clipboard.

Can you please help me - how to search string in copyq and then remove it from command line (bash)?

--
You received this message because you are subscribed to the Google Groups "CopyQ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to copyq+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/copyq/b4a35f6a-634d-494d-9ace-1c5b52800da2n%40googlegroups.com.

sklorpion

unread,
Jul 13, 2022, 2:07:17 PM7/13/22
to CopyQ
Thank you Lukas, i manage to make script like this  called tmp.sh, it is removes password after 45 sek. :

#!/bin/bash
passmenu > /dev/null 2>&1
sleep .1
password=`xclip -o`
sleep 45

echo var match = \"$password\"";"
echo "var i = 0;"
echo "while (i < size() && str(read(i)).indexOf(match) === -1)  ++i; "
echo "select(i);"
echo "remove(0);"
echo "remove(1);"

then i run:  sh tmp.sh | copyq eval -

i'll now work  with   -  Find all items containing "abc" and remove them.
Reply all
Reply to author
Forward
0 new messages