How to capture a screenshot of the LightDM greeter screen
October 6, 2016 1 Comment
- If they are not already installed, install the packages
x11-apps/xwd
andmedia-gfx/imagemagick
.
- Create the Bash script
~/lightdm-greeter-capture.sh
containing 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:
user $ chmod +x lightdm-greeter-capture.sh
- 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):
user $ sudo /home/fitzcarraldo/lightdm-greeter-capture.sh
- As soon as you have pressed
Enter
for 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.png
containing 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.
Very nice. Thanks you