How to take screenshot of Ubuntu Login Screen in Ubuntu 16.10, Ubuntu 16.04, Ubuntu 14.04 and other Ubuntu Derivatives. To take screenshot of Ubuntu login screen, you will need ImageMagick. If you do not have ImageMagick installed, run the following command in terminal to install ImageMagick.
sudo apt-get update
sudo apt-get install imagemagick
Once installed, it’s time to create the script to take screenshot. Create a new text file, name it screenshot.sh. Create the screenshot text file in your Home directory and add the following lines in the 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
Once you have created the screenshot scrip, run the following command to give executable permission to the script.
sudo chmod +x screenshot.sh
Once everything is OK, here’s how to take the screenshot.
- Log out of the system.
- Press Ctrl+Alt+F1 at the login screen to go to console mode.
- Login to the console mode, enter your username and password.
- Run the command to run the screenshot.sh script:
sudo ./screenshot.sh
- Once you run the script, you will be returned back to the graphical interface login screen. Wait gere for 5 seconds (remember sleep 5s in the screenshot script code) and after five seconds it will take and save the screenshot in your home directory.
Once the script is run, it will take the screenshot. After the screenshot is taken, you will be returned back to the graphical interface login screen. The screenshot is saved as screenshot.png in the home directory.