Modify the file /etc/gdm/Init/Default
, by adding the following line
(sleep 10; gnome-screenshot) &
just before the last exit 0
line. Then logout and wait 10 seconds for the interactive screenshot dialog to appear.
It propose the /tmp
directory to save the image, in any case take attention to where you save the file, to found it later, after login.
Remember to remove the line inserted in the file /etc/gdm/Init/Default
to remove this annoying screenshot dialog every time you login :)
Step1:
Make /tmp/shot.sh using this command:
echo 'sleep 20; DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/$DISPLAY xwd -root' > /tmp/shot.sh
You may change the seconds of sleep
suitably.
Step2:
Login to the text mode by pressing Ctrl+Alt+F1.
Step3:
Execute this command;
sudo bash /tmp/shot.sh >/tmp/shot.xwd
Step4:
Return to the GUI mode by pressing Ctrl+Alt+F7.
Step5:
Logout by normal way. While you can see login screen, wait for some seconds.
Step6:
Login by normal way. And execute this command in terminal;
convert /tmp/shot.xwd /tmp/shot.png
(you need to install imagemagick
, if you don't have installed it yet)
So, you can check the picture using this command;
eog /tmp/shot.png
Reference: http://ptspts.blogspot.jp/2010/02/how-to-create-screen-shot-of-gdm-login.html
In 12.04, it differs in using lightdm.
Best Answer
This blog might be helpful: http://ptspts.blogspot.com/2010/02/how-to-create-screen-shot-of-gdm-login.html
Install ImageMagick for the image file format conversion below:
Create a helper script:
Make sure your login screen is active (log out or reboot the machine, and wait until you see the login screen). Log in in text mode (by pressing Ctrl-Alt-F1), or using SSH. Create the screen shot by running
You can log in now (by pressing Ctrl-AltF7 first to get back to the GDM login screen). Convert the screen shot to JPEG and/or PNG:
View the screen shot in your favourite image viewer.