How to capture a screenshot of the LightDM greeter screen
October 6, 2016 Leave a comment
- If they are not already installed, install the packages
- Create the Bash script
~/lightdm-greeter-capture.shcontaining the following:
#!/bin/bash sleep 30 DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/$DISPLAY xwd -root > /tmp/greeter.xwd convert /tmp/greeter.xwd /home/fitzcarraldo/greeter.png
Make sure you make it executable:
- Log out of the Desktop Environment so that the LightDM greeter screen is displayed.
- Press Ctrl+Alt+F2 to switch to VT2.
- Log in to you user account and enter the following command (do not wait for it to complete):
- As soon as you have pressed
Enterfor the above command, press Ctrl+Alt+F7 to switch back to VT7.
- Wait for at least 30 seconds to be sure the Bash script has made a snapshot of the LightDM greeter screen, then log in.
- You should now find the file
~/greeter.pngcontaining a snapshot of your LightDM greeter screen.
If you install
media-libs/netpbm instead of (or as well as)
media-gfx/imagemagick then you can use a different command to convert in the Bash script:
#!/bin/bash sleep 30 DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/$DISPLAY xwd -root | xwdtopnm | pnmtopng > /home/fitzcarraldo/greeter.png
The resulting PNG image looks equally good to my eyes.