You are not logged in.

#1 2009-02-20 20:47:54

BoppreH
Member
Registered: 2009-02-04
Posts: 47

[SOLVED] "Copy to Clipboard" console command - Parcellite

I'm trying to make a python script that will take a screenshot using scrot, upload it to imageshack.us and then copy the image link to the clipboard (parcellite).

The problem lies in the "copy to the clipboard" part. The documentation states that the command "parcellite string" will copy "string" to the clipboard, but it does not happend.

$parcellite string
$parcellite -o
last thing copied, not "string"

Also, a bunch of

Xlib:  extension "Generic Event Extension" missing on display ":0.0".

warnings hit me each time parcellite is called, but I think they are harmless.


[SOLUTION]
Using "echo string | xsel -i -b" instead of "parcellite string".

Last edited by BoppreH (2009-02-21 00:57:24)

Offline

#2 2009-02-20 21:24:07

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED] "Copy to Clipboard" console command - Parcellite

maybe try parcellite "string" or echo "string" | parcellite? i don't know i've never used it.

as for the Xlib errors, they are indeed harmless but they mess up some scripts i have that expect output but use the error instead, adding 2>/dev/null to the offending command fixes this.

Offline

#3 2009-02-20 21:46:38

BoppreH
Member
Registered: 2009-02-04
Posts: 47

Re: [SOLVED] "Copy to Clipboard" console command - Parcellite

brisbin33 wrote:

maybe try parcellite "string" or echo "string" | parcellite? i don't know i've never used it.

as for the Xlib errors, they are indeed harmless but they mess up some scripts i have that expect output but use the error instead, adding 2>/dev/null to the offending command fixes this.

Those two were the first thing I tried, since it's in the man. But they don't work.

Offline

#4 2009-02-20 22:00:51

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED] "Copy to Clipboard" console command - Parcellite

Is there a parcellite process after you use the command? (or the daemon?)

Offline

#5 2009-02-20 23:27:07

BoppreH
Member
Registered: 2009-02-04
Posts: 47

Re: [SOLVED] "Copy to Clipboard" console command - Parcellite

Procyon wrote:

Is there a parcellite process after you use the command? (or the daemon?)

It is already open, starting by default (openbox autostart).

But when it's not, the command just executes and quits silently. No process is left.

Offline

#6 2009-02-20 23:46:45

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED] "Copy to Clipboard" console command - Parcellite

I mean any result from pgrep parcel?

X11 needs the it to be alive or the clipboard is erased. In xsel e.g.
$ echo test | xsel -i -b
$ xsel -o -b
test
$ pgrep xsel
4567
$ pkill xsel
$ xsel -o -b
(nothing)

Although it seems nothing was ever copied in your case, because the previous contents are still there

Offline

#7 2009-02-21 00:56:08

BoppreH
Member
Registered: 2009-02-04
Posts: 47

Re: [SOLVED] "Copy to Clipboard" console command - Parcellite

Procyon wrote:

I mean any result from pgrep parcel?

X11 needs the it to be alive or the clipboard is erased. In xsel e.g.
$ echo test | xsel -i -b
$ xsel -o -b
test
$ pgrep xsel
4567
$ pkill xsel
$ xsel -o -b
(nothing)

Although it seems nothing was ever copied in your case, because the previous contents are still there

I looked for "pgrep parcel" in google and this page was the first result. *facepalm*
But no, no results.

I don't have xsel installed, so those tests are not valid. But after installing it, the output is exactly the same.

But "echo string |  xsel -i -b" does the trick, without parcellite. Thank you.

Last edited by BoppreH (2009-02-21 00:56:35)

Offline

#8 2010-07-18 08:37:35

maonx
Member
Registered: 2010-04-05
Posts: 9

Re: [SOLVED] "Copy to Clipboard" console command - Parcellite

Using "echo string | xsel -i -b" instead of "parcellite string".

Thanks,it works well

Offline

#9 2010-07-18 08:38:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] "Copy to Clipboard" console command - Parcellite

This thread is rather old ...

Offline

#10 2010-07-18 12:56:57

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: [SOLVED] "Copy to Clipboard" console command - Parcellite

@maonx, I'm glad you found the content of this thread helpful, but we discourage necrobumping old threads as well as empty posts.

http://wiki.archlinux.org/index.php/For … Bumping.27
http://wiki.archlinux.org/index.php/For … mpty_Posts

Closing.

Offline

Board footer

Powered by FluxBB