Skip to content

Instantly share code, notes, and snippets.

@VMuliadi
Last active September 12, 2020 19:26
Show Gist options
  • Select an option

  • Save VMuliadi/8b5949dc3ab529376f6472e9867835e1 to your computer and use it in GitHub Desktop.

Select an option

Save VMuliadi/8b5949dc3ab529376f6472e9867835e1 to your computer and use it in GitHub Desktop.
My personal tips and trick for KDE. Mostly a workaround to make KDE works like GNOME (previously I'm using GNOME and recently `Sep 10, 2020` moved to KDE since it has less memory footprint than GNOME. Also I want to master both worlds (both KDE and GNOME), so ...

Spectacle Screenshot to Clipboard

Please install xclip on your computer first. This script is dependent to xclip package

  • Open System Settings > Notifications > Application: Configure
  • Spectacle > Configure Events
  • Tick a checkbox on Run command
  • Put /usr/bin/xclip -selection clipboard -t image/png -i ~/Pictures/$(ls ~/Pictures/ -c | head -n1); rm ~/Pictures/$(ls ~/Pictures/ -c | head -n1) as value
  • Click Apply and OK
  • Click Apply button

The screenshot will put into clipboard and will not written as a file. If you want to save it, just remove rm ~/Pictures/$(ls ~/Pictures/ -c | head -n1) from the script. I put it because most of the case I want to send it to chat rather than save it into my disk. If I want to save it as a file, I open the File Manager, paste it, give it a name, and then save it.


Note

I know the script is little bit silly since I executed the command two times to get the latest image. At first I want the image path as a file as the variable and than called it. But I've an issue (KDE issue more likely) where the my HOME_DIR appended at the beginning of my script and break it. I dedided to use this workaround. Let me know if you have better solution for this. Thank you

@VMuliadi

VMuliadi commented Sep 12, 2020

Copy link
Copy Markdown
Author

Depends on your personal preference, but for me, I love to untick the "Show a message in a popup"
upload

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