Mittwoch, 27. Januar 2016

Take a screenshot with no pop-ups

I like taking screenshots of my Linux desktop, but I find it disturbing when a program pops up.

What I want is to press the "Print Screen" key, and get the screenshot saved in a sortable file named like
snapshot-2016-01-19_18-33-44.jpg


Here is how I do it.

For KDE

First I open a console and call the command systemsettings. Now select "Shortcuts and Gestures" -> "Custom Shortcuts" -> "Edit" -> "New" -> "Global Shortcut" -> "Command/URL" -> enter "PrintScreen"


Click on Trigger -> "None". Type the PrintScreen key. Click on "Reassign" -> "Action". Enter as "Command/URL":
import -window root snapshot-$(date +%Y-%m-%d_%H-%M-%S).jpg

Done :) Every time when I type the PrintScreen key, I now find a file in my home directory with a screenshot :)

TroubleShooting

If you follow my instructions, nothing can possibly go wrung. Well, except:

  • you do not have the "import" command installed. In this case install the "graphviz" software package.
  • you do not have KDE as Desktop Environment. In this case you may find sensible ways how to accomplish this with your respective Desktop Environment; you can still use the "import" command as outlined above.

For Ubuntu 19.10

For Ubuntu 19.10, by default, you can just type ALT_Print and you will find your screenshot in your home directory under Pictures. But there is much more you can do:

Key CombinationResult
PrintComplete screen content will be saved to a file ~/Pictures/Screenshot from <timestamp>
SHIFT_PrintYou will be asked to select a screen area. Result will be saved to a file ~/Pictures/Screenshot from <timestamp>
Alt_PrintSave current Window to a file ~/Pictures/Screenshot from <timestamp>
CTRL_PrintCopy complete screen to clipboard
CTRL_SHIFT_PrintYou will be asked to select a screen area. Result will be copied to clipboard.
CTRL_Alt_PrintCopy current Window to clipboard

Raspberry Pi, test my internet connection

Since start of Corona times, I use my internet at home also for work. So its reliability and performance has become crucial. Performance see...