Bug 356831 - cannot send image to clipboard in background mode
Summary: cannot send image to clipboard in background mode
Status: RESOLVED INTENTIONAL
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
: 356952 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-17 13:09 UTC by dantmnf
Modified: 2016-05-01 18:31 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dantmnf 2015-12-17 13:09:18 UTC
When I launch Spectacle with "--background --clipboard", it won't send the captured image to clipboard, but save it to disk and send a notification.

Reproducible: Always

Steps to Reproduce:
1. open a terminal
2. launch `spectacle --background --clipboard --fullscreen`
3. check clipboard and default save directory of Spectacle

Actual Results:  
$ spectacle --background --clipboard --fullscreen
"Copied image to clipboard"
------
Desktop notification: A new screenshot was captured and saved to /blah/blah
------
Nothing happens to clipboard.

Expected Results:  
The captured image should be in clipboard.
Related notifications or nothing should be shown.
Comment 1 Boudhayan Gupta 2015-12-17 21:03:42 UTC
It turns out the clipboard loses its content if the application closes down, making this feature impossible in background mode. I must have forgotten to remove the clipboard option from the final release - I'll do that in the next point release.
Comment 2 dantmnf 2015-12-19 08:03:32 UTC
It's a bad news :-(
Can you add a "instant copy" option to GUI mode?
Comment 3 Boudhayan Gupta 2015-12-19 09:39:37 UTC
You can just press the "Copy to Clipboard" button or Ctrl+C on the keyboard. Adding a "Copy to clipboard on Spectacle start" will unintentionally destroy clipboard contents and confuse users who were expecting to paste something, so that won't happen without careful thought and consideration.
Comment 4 Boudhayan Gupta 2015-12-21 07:03:29 UTC
*** Bug 356952 has been marked as a duplicate of this bug. ***
Comment 5 wicker 2015-12-21 20:21:45 UTC
This so sad actually! I managed to get this perfect way of using spectacle (spectacle -b -c -r, for me) working by installing the clipboard manager clipit, which keeps the clipboard after an application has closed. Is there no way to work around it? It just makes spectacle exactly the way I like it!
Comment 6 Boudhayan Gupta 2015-12-21 20:25:51 UTC
I would suggest save the file with a known filename and then use some other utility to copy the image data to the clipboard. Keeping this feature in Spectacle would just confuse users because unless you have a clipboard manager installed it won't work at all.
Comment 7 wicker 2015-12-21 20:27:32 UTC
I guess I'll just keep my copy of this working version for me, since it does exactly what I want it to do. It also works perfectly with KDE's own klipper (which is part of pretty much any normal kde installation anyway). Thanks for answering!
Comment 8 Melvin Vermeeren 2015-12-22 18:13:23 UTC
Hiding the option in the GUI for regular users makes sense, but why not allow the command-line flag for advanced users? It looks like quite a big amount of users would like that feature and I don' t see a valid reason to not add it as a command-line flag.

You could print something like "This option requires a clipboard manager to function!"  in the --help. Besides, Plasma 5 ships with the clipboard applet enabled.

Alternatively, spectacle could have some sort of daemon mode in which case the daemon process keeps running so a clipboard manager isn't needed at all. I would prefer adding just the flag though.

Please reconsider this hidden feature, it would make a lot of people happy.
Comment 9 Mike H 2016-03-23 22:34:28 UTC
This doesn't even require a clipboard manager...

The semantics of X11 PRIMARY and CLIPBOARD selections are:
the app must stay running -UNTIL THE DATA IS TRANSFERRED OUT INTO THE PROGRAM THAT PASTES.

So..by extension, just keep a hidden copy of the program in the background, _UNTIL THE RECIPIENT PROGRAM ASKS FOR ITS CLIPBOARD_ and then exit. 

Or, if the CLIPBOARD changes and Spectacle is no longer the holder of the CLIPBOARD selection, then just quit the program and send a notification "another program has usurped the clipboard"

Really guys, this seems so easy to me?
Comment 10 Pastafarianist 2016-04-23 12:41:51 UTC
I'm joining those who vote for adding this feature in some way to spectacle. A command line flag with an explanation in "--help" of its prerequisites would probably do just fine.
Comment 11 wicker 2016-04-23 19:36:50 UTC
I simply went to keep spectacle from upgrading and saving a package of it for later installs. I have the arch x64 package if you'd like to have it.
Comment 12 GreggJS 2016-04-30 18:36:26 UTC
I'm a long time MS Windows user that switched over to OpenSuse over 8 months ago. I refuse to go back to MS Windows and there has been a learning curve. But not having this feature is still such a drag. I hate having to save to files and then copy/paste it into emails, etc.. I want to just paste it somewhere from the clipboard. I went so far as to try the oldest version of spectacle available in Yast. But that just gives the broken --clipboard option (where it sends it to disk and notifies). 

Please add this feature.
Comment 13 Boudhayan Gupta 2016-04-30 18:42:20 UTC
This feature will always be broken, I'm afraid. There's nothing I can do about this - this is a limitation of X11. Maybe we'll revisit this in the Wayland era.

You do know you can just drag the image preview to your e-mail client / browser, right?
Comment 14 Pastafarianist 2016-04-30 18:53:26 UTC
If you wish to have this option, Shutter is a good alternative. It sits in background (there is a tray icon) and thus works around the issue Boudhayan Gupta has described.
Comment 15 GreggJS 2016-05-01 18:30:54 UTC
(In reply to Boudhayan Gupta from comment #13)
> This feature will always be broken, I'm afraid. There's nothing I can do
> about this - this is a limitation of X11. Maybe we'll revisit this in the
> Wayland era.
> 
> You do know you can just drag the image preview to your e-mail client /
> browser, right?

I did notice that before posting my comment. But that requires me to go back through the files to preview or view to figure out what's what before dragging and dropping instead of just taking the screenshot and pasting it where I want it. One extra step for each screenshot (which I have to take lots of) just adds up to inefficient way of doing things. I'm trying to adjust the way I do things and maybe put all similar like files into subfolders - this way I can at least do as you say with a clean pictures folder. Anyhow, still like the tool (thanks!), love linux, and appreciate your comment. 

Cheers,
Gregg
Comment 16 GreggJS 2016-05-01 18:31:42 UTC
(In reply to Pastafarianist from comment #14)
> If you wish to have this option, Shutter is a good alternative. It sits in
> background (there is a tray icon) and thus works around the issue Boudhayan
> Gupta has described.

Thanks for the suggestion. I'll have a look.

Cheers,
Gregg