How To Take Screenshot On Ubuntu 18.04 Login Screen? - Fosslicious

Monday, May 7, 2018

How To Take Screenshot On Ubuntu 18.04 Login Screen?

Take a screenshot of a desktop computer, usually done some people who are making a Computer tutorials. And also become a more detailed description of the problems that exist in a computer system. In ubuntu or other operating systems, this screenshot feature is generally available, but usually only in the user display after login.

Question: How, if we want to explain the problems that exist on the login screen menu in ubuntu? 
The solution is: take a screenshot to clarify the existing problems. But the problem is, in the login screen on ubuntu there is no feature for shooting like when after login.

So, how to take a screenshot while in the ubuntu Login menu? Some steps below is a way to take a screenshot in Ubuntu login screen!

First, we need an app called imagemagick, to install please type the following command:
sudo apt-get install imagemagick

Secondly, please create a file in the home directory named screenshot.sh. And open that's file.

Copy this command in the "screenshot.sh" 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

Save, and type the following command to change the permissions of the screenshot.sh file:
sudo chmod +x screenshot.sh
Next, please logout from your computer until the login menu appears as usual. And go into CLI mode with the keyboard shortcut ctrl + alt + f1 (go to tty1).

Please login into the cli mode, and make sure that you are in the directory of the file screenshot.sh (I suggested on the home because the default of the terminal or cli is in this directory).

to ensure that the file screenshot.sh is in that directory, please type ls and enter. With this command, you can see the list of files and folders in a directory.
To take a screenshot, please type the following command:
sudo ./screenshot.sh

Enter a password and wait a moment. In my experience when executing commands in the screenshot.sh file, the screen will display return to GUI mode (tty7).

But, if not, you can restore to GUI mode with the keyboard shortcut ctrl + alt + f7. And login into the GUI mode. search the screenshot in the directory where you execute the screenshot.sh file. In this case, the result of my screenshot taking is in the home/user directory. As follows:

How To Take Screenshot On Ubuntu 18.04 Login Screen?




May be useful.