Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Can someone suggest a freeware app, or maybe even a script, that will monitor my system and hide all open applications if it's been idle for more than a certain amount of time? I mean Finder and everything. Essentially showdesktop (http://www.everydaysoftware.net/showdesktop/) but with an idle option.

share|improve this question
    
Do you use software that would make taspeotis's answer useless, e.g. Stattoo from panic.com? –  Daniel Beck Oct 10 '10 at 15:40
add comment

4 Answers

Can someone suggest a freeware app, or maybe even a script, that will monitor my system and hide all open applications if it's been idle for more than a certain amount of time?

System Preferences > Desktop & Screen Saver > Screen Saver

share|improve this answer
    
I'm not sure I follow your suggestion. Do I have to download a screensaver that will do this, or is there some option I'm missing? I don't want a screensaver to start playing, I want to show my desktop. I have my monitor set to turn off after one hour, but until then I want to see my desktop after about 2 minutes of idling. –  floyd Oct 10 '10 at 20:21
add comment

I'm looking for this too, and the other poster's suggestion is not complete - but one thing you can do (it isn't the solution exactly, but it might be nice for you) is to set one of your "hot corners" to show the desktop - I use the upper left. This is done through the Screen Savers system preference panel.

Another solution: using something like Keyboard Maestro, you can assign a macro shortcut to the action Hide all Applications or, if your macro program doesn't have that, you could simulate it by having it click the desktop and then type the key Command-Option-H (which is a Mac OS standard shortcut for hide all apps but the foreground one).

Something I'm planning on trying is SpiritedAway, which claims to hide applications after a certain idle time. Not the whole solution, but perhaps, over time, will achieve the same result.

I'll report back here if I find the EXACT use case solver.

share|improve this answer
    
Quick report back: SpiritedAway works a treat after about 15 minutes of use. It hides all but the active app, though, so it only gets you part way there. If you click the desktop, though, after the timeout, you get what you want. Still Digging. –  Rob West Aug 23 '12 at 18:22
add comment

Looks like Sleepwatcher is what you're looking for. I just found it, and am trying it out. Find it at http://www.bernhard-baehr.de/ .

share|improve this answer
add comment

I've been trying to do this/sort of doing it for a couple years now. For most of that time I have been using Spirited Away, which has the annoying inability to auto-hide the active window. Because of this, to hide all windows you need to make sure there is no active window, most easily accomplished by clicking on the desktop. Still, this requires specific action, which is easy to forget, and requires "training" anyone who might come along and use the computer.

I noticed ericjay's answer when it was posted, and thought I might finally have a solution. Unfortunately, it wasn't a straightforward process, so I thought I'd share my eventual solution here.

  • First of all, you need spaces enabled. (Exposé leaves an annoying dark border around the desktop, and the Mac OS provides no convenient way of hiding the active window and all inactive windows at the same time).

    On Mac OS 10.6, go to to the "Exposé and Spaces" pane in System preferences, and check the "enable spaces" box. Once spaces is enabled (of if it already was), ensure that you have an unused space you can dedicate to remaining empty. From here on out, I'll assume this is space number 2.

    Also, make sure that, at the bottom of the pane, you have something bound to "To switch directly to a space". From here on out, I'll assume this is control (^ Number keys).

    On Mac OS 10.7, spaces are part of Mission Control. Activate Mission Control, move the mouse to the top right of the screen, and click the "+" button which appears. This will open a new desktop space (which I am similarly going to assume is number 2, going forward), which should be kept empty of windows.

    Also, once you've created a desktop space you can dedicate to remaining empty, go to the "Keyboard" pane of System Preferences, go to the "Keyboard Shortcuts" tab, select Mission Control from the list, and then expand the "Mission Control" sub-list item. Make sure that something is bound to "Switch to desktop 2", where "2" is the number of the desktop space you created. Going forward, I'll assume this is control.

  • Next, you'll need to install sleepwatcher. Basically, you need to create the directory /usr/local/sbin (sudo mkdir -p /usr/local/sbin), and move the sleepwatcher binary executable (sleepwatcher_2.2/sleepwatcher) into this directory. If you want the manpage, the Readme details its installation. Don't worry about installing any of the plist files.

  • Four short scripts will be needed, with execute permissions. You can put these in your home folder or somewhere like /etc, but I'll use the home folder:

    touch ~/.{loginhook,logouthook,idle,idleresume}
    chmod +x ~/.{loginhook,logouthook,idle,idleresume}
    
  • Now, because sleepwatcher idle commands don't seem to work using launchctl (why we didn't install the launchctl plists), we need to create a loginhook to run a sleepwatcher whenever a user logs in, and a logouthook to kill it when the user logs out (change "your_username" accordingly):

    sudo defaults write com.apple.loginwindow LoginHook /Users/your_username/.loginhook
    sudo defaults write com.apple.loginwindow LogoutHook /Users/your_username/.logouthook
    

    Put the following lines in the ~/.loginhook script:

    #!/bin/sh
    /usr/local/sbin/sleepwatcher -d -t 150 -i /Users/your_username/.idle -R /Users/your_username/.idleresume
    

    Change 150 to whatever delay you want, in tenths of a second (so 150 = 15 seconds).

    And put the following lines in the ~/.logouthook script:

    #!/bin/sh
    kill -9 `ps ax | grep sleepwatcher | cut -d ' ' -f 3`
    
  • Write short command-line AppleScripts to change to the dedicated empty space upon idle, and back when the user resumes input. Assuming that the space is number 2, and that you used control as the key to go directly to a space,

    In the ~/.idle script, add the following lines:

      #!/bin/sh
      osascript -e 'tell application "System Events" to keystroke "2" using control down'
    

    Similarly, in the ~/.idleresume script, add the following lines

      #!/bin/sh
      osascript -e 'tell application "System Events" to keystroke "1" using control down'
    
  • Finally, logout, and log back in. Done!

share|improve this answer
    
Added the logouthook part. –  marshaul Jan 21 '13 at 12:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.