Reply to topic

Spectacle - Save a screenshot to clipboard without the GUI

yu3ib7TgK9i
Registered Member
Posts
7
Karma
0
Hi,

I would like to be able to take a screenshot and save it to clipboard, similarly as in Windows, without a GUI window appearing. Additionally, it seems that if I do click "copy to clipboard" in the GUI, closing or discarding (maybe only discarding) will also discard the clipboard image contents. However, I would rather the GUI not show at all.

Is this a possible setting?

Thank you.
lueck
Mentor
Posts
225
Karma
2
yu3ib7TgK9i
Registered Member
Posts
7
Karma
0
lueck wrote:https://docs.kde.org/trunk5/en/kdegraphics/spectacle/starting.html


Sorry, but I've already tried all of Spectacle's options. I cannot set the default 'save location' to the clipboard - only a folder, without spectacle's GUI.

I want to save the image to clipboard, not the file location.
shalak
Registered Member
Posts
2
Karma
0
OS
yu3ib7TgK9i wrote:
lueck wrote:https://docs.kde.org/trunk5/en/kdegraphics/spectacle/starting.html


Sorry, but I've already tried all of Spectacle's options. I cannot set the default 'save location' to the clipboard - only a folder, without spectacle's GUI.

I want to save the image to clipboard, not the file location.


Huh, ever since I found out that FB messanger allows to paste raw image into conversation I started to look for some solution.

I worked around the lack of this option in the following way:

0. sudo apt-get install xclip
1. Configure spectacle to use Rectangular Selection, default save to /some/path/Screenshot_%Y%M%D_%H%m%S
2. Configure PrintScreen for rectangular selection via custom shortcuts
3. Try it - once you select the area and hit enter it should show the pop-up notification about saved file.
4. On this notification select the settings button
5. In the notification settings enable "Run command" and set it as /usr/bin/xclip -selection clipboard -target image/png -i $(ls -1tr /some/path/Screenshot_*.png | tail -n 1)

You could set the screenshot paths to use /tmp, so it's cleared regularly.

Enjoy :)
GeorgeM
Registered Member
Posts
3
Karma
0
shalak wrote:
5. In the notification settings enable "Run command" and set it as /usr/bin/xclip -selection clipboard -target image/png -i $(ls -1tr /some/path/Screenshot_*.png | tail -n 1)

You could set the screenshot paths to use /tmp, so it's cleared regularly.



You must do this every time when you make a screenshot?
I'm joining the question about screenshoting to clipboard without popup window of Spectacle, by default, without any question ....
gnome-screenshot can do it perfectly, but only in GNOME session. In KDE it doesn't work too.
Shai
Registered Member
Posts
2
Karma
0
OS
I'm also interested in a solution for this.
lueck
Mentor
Posts
225
Karma
2
since 19.04.0 Spectacle has a new commandline option:

-c, --clipboard In background mode, copy screenshot to clipboard

see https://cgit.kde.org/spectacle.git/comm ... d47ed70b28

spectacle -bcn will capture the entire desktop and copy the screenshot without gui and notification to the clipboard

use the options f, m, a, u, r to specify what to capture
lpryszcz
Registered Member
Posts
1
Karma
0
Building on previous answers, you could:
- enter Settings > Shortcuts > Custom Shortcuts
- create new custom group ie "Spectacle": Edit > New Group
- and create new custom shortcut(s): Edit > New > Global Shortcut > Command/URL
- fill the name ie "PrintScreen Clipboard Rectangular"
- Trigger: Ctrl+Shift+Print
- Command/URL: spectacle -bcr
- Apply

Now pressing Ctrl+Shift+Print will trigger rectangular printscreen that will be saved directly to clipboard after pressing Enter. You can see all spectacle commands using `spactacle --help`.
Note, in order to copy print-screens to clipboard in the background, you should use `-bc`.

This will allow you to create Gnome-like print-screen behaviour in KDE5 :)
Hope someone will find it useful!
Param35h
Registered Member
Posts
1
Karma
0
Wow, fantastic @lpryszcz, worked perfectly, thank you!
visone
Registered Member
Posts
32
Karma
0
OS
Hi!
You can set a shortcut for that from settings/shorcuts/spectacle

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Gregstrq, magkoc, martinknopp, mirass, mrvldmr, mutterhunt, orcuan, Sogou [Bot], Yahoo [Bot]