Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Capture remote screenshots behind a screensaver Desktop
The following comes in handy when you ssh into your machine. Its a one-line command that will kill the screen saver, and do a screen capture. You can then copy the file to your local machine and view it. At the command line type:
 % sh -c "kill `ps -caxwwopid,command | grep ScreenSaverEngin 
| cut -b 1-6`;/usr/sbin/screencapture ~/Desktop/capture.pdf"
Notice the back tick before ps and after 1-6. This command is all on one line (though it's been shown here on two to narrow display width; remove the line break when entering the command).

The screen saver will automatically start back up again.
  • Currently 3.00 / 5
  You rated: 4 / 5 (4 votes cast)

Capture remote screenshots behind a screensaver | 8 comments | Create New Account
Click here to return to the 'Capture remote screenshots behind a screensaver' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Doesn't work
Authored by: Iceberg on Feb 06, '03 10:58:26AM

Maybe I'm doing something wrong, but when I run screencapture remotely, all I get is a blank .pdf file, wether the screensaver is running or not.

I think that the screencapture program takes a snapshot of the screen that's attached to the current shell. Doing this remotely won't do a thing since you don't have a display attached to your shell.

If I'm wrong, please correct me!

[ Reply to This | # ]
Doesn't work
Authored by: patpro on Feb 07, '03 07:07:26AM

same problem for me, it produces a blank PDF.

[ Reply to This | # ]
Blank PDF
Authored by: network23 on Feb 07, '03 04:18:18PM

Same here. I got nothing! This sounded really cool too!

[ Reply to This | # ]
Blank PDF
Authored by: network23 on Feb 07, '03 04:21:04PM

Say, what method are you using to get the file from your remote system to your local machine? I used scp, but didn't like that I had to disconnect my ssh just to connect via scp to copy the pdf to look at it. Is there a better/faster way I can transfer the file while still in my ssh session?

[ Reply to This | # ]
Try this...
Authored by: Wind on Feb 07, '03 07:45:28PM

Sounds stupid, but instead of creating the file on your desktop, try creating it in your home directory, or somewhere else. I've got it working with the command line looking like:

sh -c "kill `ps -caxwwopid,command | grep ScreenSaverEngin | cut -b 1-6`;/usr/sbin/screencapture /Library/WebServer/Documents/screen.pdf"

again... all one line

[ Reply to This | # ]
Try this...
Authored by: Iceberg on Feb 07, '03 08:14:08PM

It just won't work if done remotely. No way. And actually, I think this is a security feature.

Regardless, forget about this tip. It will only work from the LOCAL command-line.

[ Reply to This | # ]
Foiled by energy settings
Authored by: adashiel on Feb 08, '03 11:06:11AM

I don't use Screen Effects, but I do use Energy Saver on some of my machines to sleep the screen (and just the screen) after a set period. If you shell in and take a screen shot while the display is asleep, you'll get a blank pdf. Fortunately, I only use the command line to take pictures of the screen of my router, a B&W G3 with its own display permanently turned off and energy settings set never to sleep.

I suppose it might be possible to wake up the display from the command line. Probably something worthwhile to investigate anyway. ;)

[ Reply to This | # ]
Solution: Undim screen before taking screenshot
Authored by: mithras on Mar 09, '03 03:16:40PM

As others noted above, the problem that some encounter is that screen bitmaps can't be captured when the monitor is dimmed.

The solution is to undim the monitor briefly, before taking the screenshot.

I wrote a tiny program called undim that makes the one-line call to IOKit to undim the screen. It uses a snippet from the OSXvnc server.

You can download undim from me at


my free OS X applications and scripts

[ Reply to This | # ]