Bug 416106

Summary: Save a screenshot to clipboard without the screenshot GUI
Product: [Applications] Spectacle Reporter: CTimmerman <ctimmerman2+kde>
Component: GeneralAssignee: Boudhayan Gupta <me>
Status: RESOLVED DUPLICATE    
Severity: normal CC: c.timmerman2+kde, daniel-other+kdebug, kde, nate
Priority: NOR    
Version: 19.04.3   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description CTimmerman 2020-01-11 02:31:29 UTC
SUMMARY

I'd like to save a screenshot to clipboard without the GUI, but can't according to https://forum.kde.org/viewtopic.php?f=19&t=140137 because gnome-screenshot -c only outputs newlines to KDE's clipboard.

STEPS TO REPRODUCE
1. Press printscreen key.

OBSERVED RESULT
Screenshot GUI appears instead of an image on the clipboard.

EXPECTED RESULT
Copy the screen like Windows 10 and Gnome 3.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 19.10
(available in About System)
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.4

ADDITIONAL INFORMATION
Kernel version: 4.15.0-1065-oem
OS-type: 64-bit
Comment 1 Daniel 2020-01-30 17:44:15 UTC
you can reassign a newcommand to the printscreen key in the settings.

For example,

spectacle -b 

which saves it, without displayinging the GUI
Comment 2 Cees Timmerman 2020-01-30 18:18:46 UTC
cees@cees-XPS-13-9380:~$ spectacle -b
org.kde.knotifications: Could not notify  "newScreenshotSaved" by taskbar, notification has no associated widget

^C
cees@cees-XPS-13-9380:~$ spectacle -b
org.kde.knotifications: Could not notify  "newScreenshotSaved" by taskbar, notification has no associated widget
Comment 3 Cees Timmerman 2020-01-30 18:31:07 UTC
(In reply to Cees Timmerman from comment #2)
> cees@cees-XPS-13-9380:~$ spectacle -b
> org.kde.knotifications: Could not notify  "newScreenshotSaved" by taskbar,
> notification has no associated widget
> 
> ^C

spectacle -b & sleep 1; killall spectacle
Comment 4 Cees Timmerman 2020-01-30 18:34:15 UTC
Also that saves a file but does NOT place it on the clipboard.
Comment 5 Daniel 2020-01-30 19:16:36 UTC
You can use

spectacle -b -c to save it to the clipboard (in theory, however the -c isn't working for me)


> org.kde.knotifications: Could not notify  "newScreenshotSaved" by taskbar,
> notification has no associated widget
This should be just a warning that the notificatoin couldn't be displayed.
Comment 6 Daniel 2020-01-30 21:54:54 UTC
You can do so by adding a short key to the printscreen in you system's setting which executes

spectacle -b -c

or, if you wish to have no notification:
spectacle -b -c -n (but this doesn't work with old versions, see #411263)
Comment 7 Cees Timmerman 2020-02-01 19:11:28 UTC
Fixed on Kubuntu 19.10 by:

sudo add-apt-repository ppa:kubuntu-ppa/backports
sudo apt update
sudo apt upgrade

System Settings, Shortcuts, Custom Shortcuts, rightclick tree, New, Global Shortcut, Command/URL, "Desktop to clipboard", Trigger, "Ctrl+Print", Action, "spectacle -bc".

I couldn't manage to set Alt+Print by pressing Alt+Fn+PrtScr, but that's a different issue.
Comment 8 Nate Graham 2020-04-22 03:37:27 UTC

*** This bug has been marked as a duplicate of bug 375382 ***