Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created April 21, 2011 17:13
Show Gist options
  • Save cowboy/935014 to your computer and use it in GitHub Desktop.
Save cowboy/935014 to your computer and use it in GitHub Desktop.
OS X: Start screensaver + lock screen (bind to a hotkey with a utility, or run via Launchbar / QuickSilver)
#!/bin/bash
sleep 0.5 && open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app
@mathiasbynens
Copy link

Or just use a hot screen corner™ :) Srsly though, this is neat.

@keeganwatkins
Copy link

@mathiasbynens +1 for the hot screen corner, although i think there are some cases where this is faster, especially if you're already in a terminal and have it aliased. nice work, cowboy!

@dbergey
Copy link

dbergey commented Apr 21, 2011

Control-Shift-Eject does that too.

@cowboy
Copy link
Author

cowboy commented Apr 21, 2011

For me, Control-Shift-Eject goes to sleep, while my script starts the screensaver, which is awesome because of my screensaver :P

@dbergey
Copy link

dbergey commented Apr 21, 2011

True. Was just thinking of locking the screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment