Lubuntu 18.04 uses scrot
, not gnome-screenshot
, as its default.
If you haven't added gnome-screenshot
yourself, apt policy scrot
and apt policy gnome-screenshot
will make things clear.
Use something like:
scrot -u /path/to/desired/folder/"$(date +%Y%m%d%H%M%S)".png
for an immediate screenshot of the active window
or
scrot -d10 /path/to/desired/folder/"$(date +%Y%m%d%H%M%S)".png
for a screenshot with a delay of 10s
of the fullscreen; this option is useful for capturing drop-down menus
or
scrot -s /path/to/desired/folder/"$(date +%Y%m%d%H%M%S)".png
for selecting an area of the screen to be captured.
$(date +%Y%m%d%H%M%S)".png
is the filename I use to "timestamp" the screenshots and to save in .png
format.
Read man scrot
for more on scrot
and man date
for naming files with timestamps.
In case you want to use keyboard shortcuts to launch the commands given above ...
Open PcManFM, the default file manager in Lubuntu.
Press Ctrl+H to enable viewing of hidden files and folders.
Open the .config
folder and then, within that, the openbox
folder.
In the openbox
folder, you'll see lubuntu-rc.xml
. Make a backup of this file somewhere convenient and rename it to ORIGINAL-lubuntu-rc.xml
. This is important in case bad things happen.
Open the lubuntu-rc.xml
file which is in ~/.config/openbox
using Leafpad
. Don't double-click on it. It will cause the file to open in a web browser which isn't what we want.
Scroll down till you see the following content:
<!--
Take a screenshot of the current window with scrot when Alt+Print are pressed
-->
<keybind key="Print">
<action name="Execute">
<command>lxsession-default screenshot</command>
</action>
</keybind>
<keybind key="A-Print">
<action name="Execute">
<command>lxsession-default screenshot window</command>
</action>
</keybind>
Very, very carefully, replace that entire content with:
<keybind key="Print"> # Immediate scrot of active window
<action name="Execute"><command>sh -c 'scrot -u /home/VistaRefugee/Pictures/"$(date +%Y%m%d%H%M%S)".png'</command></action>
</keybind>
<keybind key="W-Print"> # Delayed scrot of full screen
<action name="Execute"><command>sh -c 'scrot -d10 /home/VistaRefugee/Pictures/"$(date +%Y%m%d%H%M%S)".png'</command></action>
</keybind>
<keybind key="S-Print"> # Interactive scrot
<action name="Execute"><command>sh -c 'scrot -s /home/VistaRefugee/Pictures/"$(date +%Y%m%d%H%M%S)".png'</command></action>
</keybind>
Change VistaRefugee/Pictures
to whatever you desire.
Save lubuntu-rc.xml
.
Open lxterminal
and run openbox --reconfigure
. You should get back the terminal prompt. The purpose of openbox --reconfigure
is to make the system aware of the changes you made. It also parses the content to ensure there aren't any syntax errors. If anything else happens, restore lubuntu-rc.xml
from your back-up and give up or try again carefully.
Note that what goes into lubuntu-rc.xml
is different than what you can run from a terminal because of how Openbox deals with certain characters.
Now, you can use
If you're planning to stay with Lubuntu 18.04 for a while, you may want to know more about Openbox, keeping in mind that lubuntu-rc.xml
is just Lubuntu's name for what is also known as lxde-rc.xml
or rc.xml
in systems other than Lubuntu or where Openbox isn't used in the LXDE environment: