rickyrockrat / parcellite

GNU General Public License v3.0
224 stars 29 forks source link

Command line option for storing to clipboard #5

Closed MMR-Burhan closed 7 years ago

MMR-Burhan commented 7 years ago

Man page cli example is echo "copied to clipboard" | parcellite -c , First run parcellite with parcellite &. (1)Now when I try this I get following with no clipboard history

echo "copy" | parcellite -c
Looking in '/etc/xdg/parcellite/parcelliterc'

(2)And this with hello being the only thing in clipboard history

echo "copy" | parcellite -c
Looking in '/etc/xdg/parcellite/parcelliterc'

hello

In the first case "copy" is nowhere in the clipboard history and in second case "copy" is the second item in history not the first . Is this expected behaviour.

MMR-Burhan commented 7 years ago

I think I still have to use xsel for cmd

rickyrockrat commented 7 years ago

What version are you using? Apparently this has been a bug for some time. It should be dumping things out stderr. I will fix this in the next release. -c should print the clipboard.

rickyrockrat commented 7 years ago

After testing, try this: parcellite -c >clp.txt

It does print to both stderr & stdout.

MMR-Burhan commented 7 years ago

Check this.

parcellite --version
Flag 0x0001, status 0, EXIT 1 STAT 0
Parcellite 1.2.1, GTK 2.24.31
rickyrockrat commented 7 years ago

I like your font - what is it? Anyway, I believe your stdout is correct. Try this: parcellite -c 2>/dev/null or this: parcellite -c >clp.txt && cat clp.txt. I believe these do what they are supposed to.

MMR-Burhan commented 7 years ago

FantasqueSansMono

Yes, they do as they are supposed to do . It's just that copied item with command do not get pasted immediately with ctrl+v , I have to go history and explicitly select then paste it .

097115 commented 2 years ago

@rickyrockrat

Sorry for necrobumping, just wanted to clarify, if this is indeed is an intended behaviour:

  1. I run parcellite foo bar
  2. foo bar gets added to the clipboard
  3. ...but not as the active item: the active (current) item stays the same as it was before executing parcellite foo bar, and foo bar gets inserted in the history as the second item, just below the active (current) one.

Why asking? I'm trying to add some "Favourites" to Actions, and the obvious way would be just to enter something like parcellite This is my snippet No. 1 in the command field (as described here, for example). But then in order to insert a favourite, I'd have a) to select an action from the Actions menu, b) then to select (to activate) the added snippet from the History menu and c) then to press <C-v> to actually paste it. We can't skip b), right?

(Sure, I can ad an action as printf "foo bar" | xclip -sel clip, but if parcellite itself can add things to clipboard, then may be it can "activate" them, too?)

Again, sorry for coming back to such an old issue :)

I'm on Ubuntu 21.10, Parcellite 1.2.1 installed via apt-get.

rickyrockrat commented 2 years ago

I don't use this, but it truly sounds like a PITA. I'll add a feature to set this as an option in the rc.