At times I need to take screenshot of login screen. For example if I am writing about how to install Cinnamon in Ubuntu 14.04, a screenshot of login screen would be helpful to beginners. Whatever may be your reason, if you are wondering how to take screenshot of the login screen in Ubuntu 14.04 or Linux Mint 17, let me show you how to do that.
Take screenshot of login screen in Ubuntu and Linux Mint
The idea here is to create a script that you can run from command line interface. Don’t be scared of “the script”. It is really very simple to use it.
Step 1: Get ImageMagic
Open a terminal and use the following command to install ImageMagic.
sudo apt-get install imagemagick
Step 2: Prepare the script
Create a new file, preferably in your Home directory. Name it screenshot.sh or anything you like. Add the following lines in this file:
chvt 7; sleep 5s; DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 xwd -root -out ~/screenshot.xwd; convert ~/screenshot.xwd ~/screenshot.png; rm ~/screenshot.xwd
In the above, chvt 7 is the number of the virtual console. It will take a screenshot 5 seconds afer you have run this script. You can change it to any number you want. You’ll find the screenshot saved as screenshot.png in your home directory.
Step 3: Give executable permission to the script
You must give the script execution rights:
sudo chmod +x screenshot.sh
Step 4: Taking screenshot
Now when everything is ready, log out of the system. Press Ctrl+Alt+F1 at the login screen to go console mode. Login with your user credential. Run the screenshot script like this:
sudo ./screenshot.sh
Once the script is run, it will take you back to login screen graphical interface (chvt 7) and after five seconds it will take and save the screenshot in your home directory with a file name screenshot.png.
You can modify the screenshot script as per your need. I hope this tip helped you to take screenshot of the login screen in Ubuntu, Linux Mint or any other Linux distribution. Any questions or suggestions are always welcomed.



“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.
[…] In case you are wondering, I used this trick to take screenshot of login screen in Ubuntu. […]
[…] In case you are wondering, here is how to take screenshot of login screen in Linux. […]