Skip to content

UbuntuHandbook

News, Tutorials, Howtos for Ubuntu Linux

Capture Your LightDM Login Screen in Ubuntu 14.04

capture lightdm log-in screen

This quick tutorial is going to show you how to capture LightDM Unity Greeter, the log in screen, in Ubuntu 14.04 LTS.

Besides installing Ubuntu as a guest OS via Virtualbox or VMware Player, there’s no graphical screenshot tool to capture the log-in screen.

However, you can use the LightDM test mode to preview your login screen and take a screenshot:

METHOD 1: (Thanks to Vladimir)

1. Press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to install required package:

sudo apt-get install xserver-xephyr

2. If you’ve changed Unity Greeter appearances: remove the white dots or set login background different to user’s desktop wallpaper, switch to user lightdm by running below commands one by one:

sudo -i

xhost +SI:localuser:lightdm

su lightdm -s /bin/bash

3. Run below command to preview your Login screen and take a screenshot:

lightdm --test-mode

Method 2: Capture Login Screen via a simple script:

1. Press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to create the script:

echo 'sleep 30; DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/$DISPLAY xwd -root' > /tmp/shot.sh

This will create a script shot.sh under /tmp/ directory. It will capture your display with 30 seconds delay.

2. Now switch to command console by pressing Ctrl+Alt+F2, log in with your username and password.

3. When you’re in, run the script via:

sudo bash /tmp/shot.sh >/tmp/shot.xwd

4. Press Ctrl+Alt+F7 to switch back to graphical session and log out by normal way. While you can see login screen, wait for some seconds.

5. Login by normal way. And install imagemagick and convert your screenshot:

sudo apt-get install imagemagick

convert /tmp/shot.xwd loginscreen.png

Finally open “loginscreen.png” with your favorite image viewer and see the magic!

Share this:

Published May 10, 2014
Categorized as Howtos Tagged capture login screen, Ubuntu 14.04

By Ji m

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via ubuntuhandbook1@gmail.com Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

View all of Ji m's posts.

3 comments

  1. Vladimir says:
    May 10, 2014 at 6:41 pm

    Why write scripts when there is a simple solution for picture windows logon screen?

    sudo apt-get install xserver-xephyr

    lightdm – test-mode

    1. Ji m says:
      May 11, 2014 at 3:52 am

      Thanks for you tip. But you need to first switch to user lightdm in terminal if you’ve changed the LightDM appearances.

  2. Marwad says:
    January 16, 2017 at 11:24 pm

    You can try this:

    gnome-screenshot -d 10

    you don’t need to install any thing just enter the command and lock the screen, the screen will be shot within 10 seconds after the command is executed.

Comments are closed.

Post navigation

Previous post

Install Python 3.3.5 or 3.4 via PPA in Ubuntu 14.04 / 12.04

Next post

Install Miro 6 in Ubuntu 14.04 via PPA

  • About
UbuntuHandbook
Proudly powered by WordPress.
Exit mobile version