Bug 390415 - Feature request - Spectacle - Save to file and clipboard
Summary: Feature request - Spectacle - Save to file and clipboard
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 18.12.2
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
: 393933 406083 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-14 00:44 UTC by Joel Teixeira
Modified: 2019-08-26 14:15 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.12.0


Attachments
attachment-9549-0.html (1.52 KB, text/html)
2019-08-16 22:12 UTC, Nicolas Girard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Teixeira 2018-02-14 00:44:28 UTC
Please add a feature/option to save to file and clipboard at the same time. Not sure if it's relevant but just to mention one app that offer this feature on another platform is Greenshot. Would love to have it on spectacle as well. 

Thank you, 
Joel Teixeira
Comment 1 null 2018-02-14 16:55:10 UTC
I'm very skeptical about that. "Ctrl + C", "Ctrl + S" is already a very quick way to achieve this (and even easier than some Emacs shortcuts ;). Also, you have a setting to copy the path of the saved screenshot to the clipboard automatically, which allows pasting of the screenshot in most places.

What if someone wants "Export to Imgur, save to clipboard and print" as a new combination? We cannot add infinite config options.

Please let us know what's the actual root cause / use case you are trying to solve here, maybe there is a better way to achieve it.
Comment 2 Joel Teixeira 2018-02-14 19:46:41 UTC
Hi Henrik, thanks for your input. 

About "Ctrl + C", "Ctrl+S" being quick:
I use screenshot mostly for region screenshots (not fullscreen) to paste on other programs like CherryTree, telegram. Following this recommendation I would probably need to take the screenshot (region), open the file on a image viewer, control+c, alternate to destination program (telegram, email, libreoffice writer...) and control+V. Maybe I'm there's  short path for this, in this case please let me know. 

Doesn't seem quick to me but being relative, let's say, would it still be quick considering 50 screenshots? See, the alterante method, I press the printscreen key, select region, and it's already there, saved on my disk and ready to paste wherever I need. 

We have free (lightscreen) and comercial (greenshot on mac) tools already providing this feature. But I, particularly, don't want to use those. I would like to use Spectacle for that. 

About "What if someone wants "Export to Imgur, save to clipboard and print" as a new combination?" I'd say, it would make Spectacle even better. Both tools mentioned above already offers auto save+clipboard+imgurl out of the box. But then again, I would love to see this feature on Spectacle not on them. Doesn't need to be a default option, but on the user side is just a checkbox. 

My particular use case:
Like I said, I use it mostly for regions and paste direct on CherryTree (sometimes telegram, whastapp...). Opening the saved file just add unnecessery steps on my workflow. The path on clipboard doesn't seem to help in anyway as well.

Looking for a workaround for this, I found tons of posts on forums, articles and et cetera. So doesn't seem to be a particular scenario but needed by many people out there. If you need evidence of demand, to justify the need, I can provide N sources to you.


My dirty workaround, saved as sstime.sh and linked to Printscreen key. 
#!/bin/bash
export sstime="/home/username/Pictures/screenshots/`date '+%Y-%m-%d %H_%M_%S'`.png"; spectacle -nbr -o "$sstime" && xclip -sel clip -t image/png "$sstime" && notify-send "Screenshot saved in ~/Pictures/screenshots"
Comment 3 Nate Graham 2018-02-14 20:00:37 UTC
I heavily use the workflow you mention in macOS:

Hit Command-Shift-4 to invoke a rectangular region screenshot from anywhere, then hold down control while you drag your box, and boom, I have a screenshot in the clipboard, suitable for pasting into a chat window or wherever else I'd like. This workflow is tracked by Bug 375382, with a patch undergoing review patch: https://phabricator.kde.org/D9117

But for this workflow, of what use is it to *also* save the screenshot to disk somewhere? The whole point here is to quickly get a screenshot into your clipboard. It seems like also saving it to disk would just lead to a lot of clutter, no? What's the use case?
Comment 4 Joel Teixeira 2018-02-14 20:24:35 UTC
(In reply to Nate Graham from comment #3)
> I heavily use the workflow you mention in macOS:
> 
> Hit Command-Shift-4 to invoke a rectangular region screenshot from anywhere,
> then hold down control while you drag your box, and boom, I have a
> screenshot in the clipboard, suitable for pasting into a chat window or
> wherever else I'd like. This workflow is tracked by Bug 375382, with a patch
> undergoing review patch: https://phabricator.kde.org/D9117
> 
> But for this workflow, of what use is it to *also* save the screenshot to
> disk somewhere? The whole point here is to quickly get a screenshot into
> your clipboard. It seems like also saving it to disk would just lead to a
> lot of clutter, no? What's the use case?

Hi Nate, unfortunatelly I'm not familiar with MacOS but is good to know it offers similar function. You understood right, my goal is to quickly have that region I crop on my hard drive and at the same time on clipboard for a miscelaneous usage cases. 

I don't see as a clutter at all since, just for instance, many programs apply compression on the pictures after paste. Eg, whatsapp messenger. CherryTree when resizing after paste and so on. Having a centralized, full quality, date organized of all the screenshots I took seems like a very good practice and still uses so little of nowadays storages devices.
Comment 5 null 2018-02-14 20:58:17 UTC
Thanks Joel, that's interesting: I'm using Spectacle by starting it, choosing options and then taking a screenshot. After this, I can just press the shortcuts I mentioned, right inside Spectacle.

To me it sounds like you are using the hotkeys only, you get the "Screenshot taken" notification without starting the application window first. That was the essential information missing from your bug report ;)

From the notification, you should be able to just drag the image to wherever you want. For a keyboard-only workflow, D9117 will bring improvements, and we have other bugs open to expose the shortcuts more prominently to the user.

I could imagine having a more flexible saving/copying/exporting pipeline would be useful, but this would probably involve a more thorough change in Spectacle. I'm also hesitant to allow uploading a screenshot to the internet after a single keypress, we'd need at least some sort of confirmation dialog.

--------

Another way to look at this would be to question how the current "Copy save location to clipboard" works. Maybe we want the pixmap copy here instead? This needs more thinking about use cases and some testing what works where (keeping in mind that Klipper by default does not save image data until we patch it).

I'll leave the bug open for now, but don't hold your breath for quick progress. This needs more design work.

Perhaps this is the way to go:
- Fix Klipper.
- Figure out why anyone would need "Copy filename" after that.
- Perhaps remove it from the settings to avoid confusion.
- Add "Copy to clipboard" to the main UI under "Options", check by default.
- Remove "Copy to clipboard" button.
- Ensure the hotkeys use the options as set in the main UI.

Nate: With this ↑ we wouldn't need D9117 anymore, cluttering up the shortcuts. Thoughts?
Comment 6 null 2018-02-14 21:00:35 UTC
> we wouldn't need D9117 anymore
Ah, scratch that, I missed "without saving the screenshot locally". Or add another option!?
Comment 7 Joel Teixeira 2018-02-14 21:26:12 UTC
(In reply to Henrik Fehlauer from comment #5)
> Thanks Joel, that's interesting: I'm using Spectacle by starting it,
> choosing options and then taking a screenshot. After this, I can just press
> the shortcuts I mentioned, right inside Spectacle.
> 
> To me it sounds like you are using the hotkeys only, you get the "Screenshot
> taken" notification without starting the application window first. That was
> the essential information missing from your bug report ;)

Sorry, my mistake. Should have mentioned. Indeed I use it most of the time with just Printscreen key to "region+save output file" with that script at the moment. I use Ctrl+Printscreen to call the Gui when I want something different. 

> From the notification, you should be able to just drag the image to wherever
> you want. For a keyboard-only workflow, D9117 will bring improvements, and
> we have other bugs open to expose the shortcuts more prominently to the user.

Yes, in case I can make it stay longer before it hides it should be a workaround as well. Thanks for the tip. 

> I could imagine having a more flexible saving/copying/exporting pipeline
> would be useful, but this would probably involve a more thorough change in
> Spectacle. I'm also hesitant to allow uploading a screenshot to the internet
> after a single keypress, we'd need at least some sort of confirmation dialog.

I don't upload images, I just gave an example of tools that allow it. And yes, I totally agree with you. Upload everything automatically would light many red lights on privacy side. 
 
> I'll leave the bug open for now, but don't hold your breath for quick
> progress. This needs more design work.

Thank you, I really appreciate it. I'm not a programmer my self but I do have an idea how much hard work must be done before a feature like this be designed, implemented, tested... so on. My dirty workaround is serving me well for my needs.
Comment 8 Nate Graham 2018-02-14 21:27:32 UTC
I think your proposal makes perfect sense, Henrik. I have to imagine that copying the actual image instead of the path is the desired outcome 99% of the time. I'm not sure what copying the path really accomplishes for anyone, in fact. I wonder if anyone uses it, and if so, for what?
Comment 9 null 2018-02-14 21:43:13 UTC
> in case I can make it stay longer before it hides
In Plasma (5.12+?) there is a notification history, including recent screenshots.

> I wonder if anyone uses it
When I copy a couple of files in Dolphin and then paste in Kate, I get those as text (quite useful sometimes), and pasting in Dolphin will paste the files. However, copying the URL from Kate and pasting in Dolphin will offer to create a text file (a killer feature I use often). Maybe someone thought that simply copying the URL to the clipboard would be enough, but it isn't? Hmh, this needs investigation.

Anyway, I'll earmark the bug. Need to finish too much other things for the time being.
Comment 10 null 2018-05-07 08:44:33 UTC
*** Bug 393933 has been marked as a duplicate of this bug. ***
Comment 11 null 2018-06-18 22:19:59 UTC
Just for reference, https://phabricator.kde.org/D13493 has more comments on the topic, still inconclusive, though.
Comment 12 tuxflo 2018-06-26 13:36:38 UTC
I'm not sure if I should create a new Bug for this, but I'm also interested in copying a screenshot directly to clipboard.

My usecase is similar: I want to be able to take a screenshot of a rectangular region with a shortcut (like Ctrl+Alt+PrintScr) and then paste it directly in a messenger like telegram.

Currently my workaround looks like this:
spectacle -br -n -o /tmp/copyshot.png && xclip -sel clip -t image/png /tmp/copyshot.png && rm /tmp/copyshot.png

But I don't really understand why this isn't implemented in spectacle itself... a simple commandline switch like -c for "save to clipboard" similar to the -o flag would be fine for me.
Comment 13 Nate Graham 2018-06-26 14:00:03 UTC
(In reply to tuxflo from comment #12)
> I'm not sure if I should create a new Bug for this, but I'm also interested
> in copying a screenshot directly to clipboard.
> 
> My usecase is similar: I want to be able to take a screenshot of a
> rectangular region with a shortcut (like Ctrl+Alt+PrintScr) and then paste
> it directly in a messenger like telegram.
> 
> Currently my workaround looks like this:
> spectacle -br -n -o /tmp/copyshot.png && xclip -sel clip -t image/png
> /tmp/copyshot.png && rm /tmp/copyshot.png
> 
> But I don't really understand why this isn't implemented in spectacle
> itself... a simple commandline switch like -c for "save to clipboard"
> similar to the -o flag would be fine for me.

The bug you're looking for is Bug 375382. And there's an open patch for it: https://phabricator.kde.org/D9117

It's not yet implemented because we still haven't reached consensus regarding how to solve the issue of keeping an image in a global clipboard after Spectacle quits. Right now the KDE clipboard manager Klipper explicitly ignores images in order to avoid using too much memory (which is especially relevant since the clipboard contents are saved across reboots, so this could potentially increase startup memory usage by quite a bit--up to 70MB with a clipboard full of high resolution images).

It's on our radar screens, don't worry.
Comment 14 Sudhir Khanger 2018-08-30 12:47:04 UTC
Just to add my two cents. This is a highly desirable feature. It would be great to have "Save", "Save as", and "Save and copy to clipboard" in the saving option. This will greatly enhance the user experience where I can trigger the region screenshot with Meta+Shift+PrtScr then press enter and the screenshot would be both saved in the disk and be copied in the clipboard.

Not every image would be used immediately and I wonder if we could display a blurred placeholder image which would show the original on selection via arrow key or mouse pointer hover.
Comment 15 Nicolas Girard 2019-07-27 22:05:02 UTC
This is also the workflow I've been using heavily with Shutter.

I'm missing this in Spectacle.
Comment 16 Antonio Prcela 2019-08-15 08:35:04 UTC
Isn't this almost the same as the feature requested in this:
https://bugs.kde.org/show_bug.cgi?id=406083
Working on it here: https://phabricator.kde.org/D23162

If so, and the above mentioned gets accepted. I could add a option to automatically save a image to disk.

So if one has both options enabled ('auto save to clipboard' & 'auto save to disk'), this one would be solved?
Comment 17 Nicolas Girard 2019-08-15 08:39:02 UTC
(In reply to Antonio from comment #16)

> So if one has both options enabled ('auto save to clipboard' & 'auto save to
> disk'), this one would be solved?

Yes, it would !
Comment 18 Nate Graham 2019-08-15 13:15:36 UTC
*** Bug 406083 has been marked as a duplicate of this bug. ***
Comment 19 Antonio Prcela 2019-08-16 21:56:23 UTC
Small update:
if these two get accepted, you will have the desired capability:

https://phabricator.kde.org/D23210
https://phabricator.kde.org/D23162

Stay tuned! :)
Comment 20 Nicolas Girard 2019-08-16 22:12:00 UTC
Created attachment 122189 [details]
attachment-9549-0.html

Great, thanks for your efforts !

> FIXED-IN: 19.12.0

Jeez... that's a long time to wait !


Le ven. 16 août 2019 à 23:56, Antonio <bugzilla_noreply@kde.org> a écrit :

> https://bugs.kde.org/show_bug.cgi?id=390415
>
> --- Comment #19 from Antonio <antonio.prcela@gmail.com> ---
> Small update:
> if these two get accepted, you will have the desired capability:
>
> https://phabricator.kde.org/D23210
> https://phabricator.kde.org/D23162
>
> Stay tuned! :)
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
Comment 21 Nate Graham 2019-08-21 16:20:07 UTC
Git commit 172e40bd983554140537cb3d8d746482cba8b3da by Nate Graham, on behalf of Antonio Prcela.
Committed on 21/08/2019 at 16:19.
Pushed by ngraham into branch 'master'.

Add option to additionally save screenshot to clipboard

Summary:
FIXED-IN: 19.12.0

Add an option to save the screenshot to the clipboard after it has been taken.

Test Plan: {F7248196}

Reviewers: #spectacle, #vdg, davidre, ngraham

Reviewed By: #spectacle, #vdg, davidre, ngraham

Subscribers: jborrero, muvori, davidre, ngraham, #spectacle

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D23162

M  +10   -9    src/Gui/KSMainWindow.h
M  +15   -0    src/Gui/SettingsDialog/GeneralOptionsPage.cpp
M  +4    -3    src/Gui/SettingsDialog/GeneralOptionsPage.h
M  +0    -1    src/Gui/SettingsDialog/SaveOptionsPage.cpp
M  +14   -0    src/SpectacleConfig.cpp
M  +10   -2    src/SpectacleConfig.h
M  +20   -4    src/SpectacleCore.cpp
M  +2    -1    src/SpectacleCore.h

https://commits.kde.org/spectacle/172e40bd983554140537cb3d8d746482cba8b3da
Comment 22 Nate Graham 2019-08-26 14:15:31 UTC
Git commit 7f809fc94e9b300cc244ec1d3799b591cdee400c by Nate Graham, on behalf of Antonio Prcela.
Committed on 26/08/2019 at 14:15.
Pushed by ngraham into branch 'master'.

Add autosave feature

Summary:
Add an option to automatically save the screenshot immediately after it has been taken

Test Plan:
{F7252033}

  # Enable the option //Autosave the image to 'Save location' with 'Filename'//
  # Take a screenshot
  # Image gets saved ASAP

If you launch Spectacle with a hotkey (for example: PrtSc), it takes the screenshot and saves the image immediately.

Reviewers: #vdg, #spectacle, davidre, ngraham

Reviewed By: #vdg, #spectacle, davidre, ngraham

Subscribers: davidre, ngraham, #spectacle

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D23210

M  +18   -0    src/ExportManager.cpp
M  +2    -0    src/ExportManager.h
M  +16   -4    src/Gui/KSMainWindow.cpp
M  +2    -0    src/Gui/KSMainWindow.h
M  +2    -2    src/Gui/KSWidget.cpp
M  +16   -13   src/Gui/SettingsDialog/GeneralOptionsPage.cpp
M  +2    -1    src/Gui/SettingsDialog/GeneralOptionsPage.h
M  +14   -5    src/SpectacleConfig.cpp
M  +5    -7    src/SpectacleConfig.h
M  +12   -14   src/SpectacleCore.cpp

https://commits.kde.org/spectacle/7f809fc94e9b300cc244ec1d3799b591cdee400c