chvt 7 ; sleep 2 ; DISPLAY=:0.0 import -window root screenshot.png

Take a screenshot of a login screen

when using Gnome or KDE, you will have a hard time getting a screenshot of something like a login screen, or any other screen that occurs before the desktop environment is up and monitoring the printscreen key. (this probably applies for other DEs as well, but I haven't used them) What this command is meant to do is take a screenshot of an X window using a command you can run from your virtual terminals (actual text terminals, not just an emulator) To do this: Press CTRL+ALT+F1 to go to a virtual (text) terminal once your login window comes up Login to the virtual terminal and enter the command (you'll have to type it in) You should now have a file called screenshot.png in your home directory with your screenshot in it. For those of you who are new to the virtual terminal thing, you can use CTRL+ALT+F7 to get back to your regular GUI From http://www.gnome.org

3
2010-08-20 17:28:49

These Might Interest You

  • This keeps the user logged in but shows the login screen. Very useful when connecting remotely to an OSX-Server via VNC


    0
    /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
    zagdul · 2013-04-23 14:27:10 0
  • Take screen shot using Tizen SDK cd ~ # go to you home directory fn=$(date "+ screen-%H-%M-%S") # create variable for file name in bash sdb shell xwd -root -out /tmp/"$fn".xwd # open shell and run command to save screenshot sdb pull /tmp/"$fn".xwd ~/ # copy created file into your home directory convert "$fn".xwd "$fn".png # converting xwd to png in your home


    0
    cd ~; fn=$(date "+ screen-%H-%M-%S"); sdb shell xwd -root -out /tmp/"$fn".xwd; sdb pull /tmp/"$fn".xwd ~/; convert "$fn".xwd "$fn".png
    MobileDeveloper · 2014-11-24 19:50:35 0
  • But if you use a screen saver, you must first disable your screen saver kill $(ps ax | grep screensaver | grep -v grep | awk '{ print $1 }')


    0
    DISPLAY=":0.0" import -window root screenshot.png
    0disse0 · 2012-02-05 11:52:33 0
  • scrot, curl, egrep, sed, xsel, libnotify-bin must be installed. P.S. Sorry for so long command Show Sample Output


    0
    scrot $1 /tmp/screenshot.png && curl -s -F file1=@/tmp/screenshot.png -F submit="OMPLOAD\!" http://ompldr.org/upload | egrep '(View file: <a href="v([A-Za-z0-9+\/]+)">)' | sed 's/^.*\(http:\/\/.*\)<.*$/\1/' | xsel -b -i ? (full in a sample output)
    artleg · 2011-01-15 11:33:43 0
  • When connected to a box via ssh you can do a quick screenshot of that box using this command. After that you can rscp it over to your box and look at it. Show Sample Output


    5
    xwd -root -display :0.0| xwdtopnm | pnmtopng > Screenshot.png
    B4ckBOne · 2010-10-28 07:44:25 0
  • Works with *rooted* Android devices. 400x800 are the screen dimensions of a typical handheld smartphone.


    8
    adb pull /dev/graphics/fb0 /dev/stdout | ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 480x800 -i pipe:0 -f image2 -vcodec png screenshot.png
    mhs · 2012-12-26 13:21:18 1

What Others Think

Doesnt work. I get error: import: unable to open x server I guess I need to set XAUTHORITY but all my efforts have failed. I am using linux mint 13 kde . any suggestions ?
gmc · 119 weeks and 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: