Skip to content

Instantly share code, notes, and snippets.

@Xarkam
Last active June 1, 2022 08:38
Show Gist options
  • Save Xarkam/26d40e98dbad314423c11a27e35aab47 to your computer and use it in GitHub Desktop.
Save Xarkam/26d40e98dbad314423c11a27e35aab47 to your computer and use it in GitHub Desktop.
KDE Spectacle copy screenshot to clipboard
  • sudo apt-get install xclip
  • Configure spectacle to use Rectangular Selection, default save to /some/path/Screenshot_%Y%M%D_%H%m%S
  • Configure PrintScreen for rectangular selection via custom shortcuts
  • Try it - once you select the area and hit enter it should show the pop-up notification about saved file.
  • On this notification select the settings button
  • 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)
@Steffo99
Copy link

@igoro00 It works!

@Xarkam
Copy link
Author

Xarkam commented Jul 22, 2020

I consider flameshot to be unmaintained. It has been 10 months since there were any more commits in the code and 51 pull requests are still pending.

Spectacle goes ahead, but it lacks that awesome option of being able to annotate an image before copying or saving it.

@RealFakeAccount
Copy link

If you are using Wayland, you can't use xclip. You can choose to install wl-copy instead and set the command as
/usr/bin/wl-copy < $(ls -1tr /home/rfaccount/Pictures/Screenshot_*.png | tail -n 1)

@Xarkam
Copy link
Author

Xarkam commented Jul 21, 2021

I don't use wayland.
Flameshot is very active again but in the meantime I have found ksnip which I find very good for the KDE environment.
ksnip supports partially wayland.

@lukehmcc
Copy link

lukehmcc commented Mar 9, 2022

If you are using Wayland, you can't use xclip. You can choose to install wl-copy instead and set the command as /usr/bin/wl-copy < $(ls -1tr /home/rfaccount/Pictures/Screenshot_*.png | tail -n 1)

This is super helpful! KDE doesn't seem to have a way to copy to clipboard under wayland that I've found in any screenshot apps. So this is a great workaround in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment