Screenshots of LightdmΒΆ

There are plenty of great tools to taking screenshots after signing into / starting your xorg session. However, how to deal with taking a picture of lightdm itself?

First, ensure you have these:

sudo apt-get -qy install x11-apps imagemagick

Then create /tmp/capture.sh filling it with:

#!/bin/bash
export DISPLAY=:0
export XAUTHORITY=/var/run/lightdm/root/${DISPLAY}
export DTSTAMP=$(date "+%Y-%m-%d-%H-%M-%S")

sleep 5
xwd -root > /tmp/lightdm.xwd
convert /tmp/lightdm.xwd /tmp/lightdm-${DTSTAMP}.jpg

Then, logout and once you are at the Lightdm login screen, then hit Ctrl + Alt + F2. This will bring you to a console login-screen. Login, then execute:

sudo /tmp/capture.sh

Then hit Alt + F7 to get back to the Light login screen. Wait 5 seconds, then login. Look in /tmp for files named lightdm-*.jpg