Quick Lock Desktop – Mac
One of my small peeves with a Mac is the lack of a quick utility or short-cut to lock
your computer. So, I took it upon myself to make one out of the apps they already give us.
First off set your Mac to require a password when waking from the screen saver and disable automatic logins. Apple –> System Preferences –> Security –> ‘Require password to wake this computer from sleep or screen saver’ & ‘Disable automatic login’.
You can download the one I created that ‘should’ work automatically after installing. If not or you want to get creative and make your own with your own icon or what have you, the instructions are below on what I did. You can also set a keyboard shortcut to the app for a keyboard style lock.
Pre-made Screen Saver/Lock App:
Download: MacDLock (MacDLock.tar – 280KB)
Installation:
$> tar xvf MacDLock.tar
$> mv MacDLock.app /Applications
That’s it! Now if you open your Applications folder you should be able to click the Lock icon for MacDLock and it will launch your screensaver. Upon wake, you will be prompted for you username and password that you set up to do earlier. I put a launch icon on the launch bar and setup a shortcut to the application to make for quick screen locking while I’m away. Enjoy!
Custom Screen Saver/Lock:
$> cp -r /System/Library/Frameworks/ScreenSaver.framework/Versions/A/\
Resources/ScreenSaverEngine.app /Applications/MacDLock.app
This will give you the standard ScreenSaver but located in your /Applications directory. You can also do it with a soft link such as this:
$> ln -s
/System/Library/Frameworks/ScreenSaver.framework/Versions/A/\
Resources/ScreenSaverEngine.app /Applications/MacDLock.app
I did the first because I wanted to change out the icon to something more ‘cool’ or ‘secure’ looking (like a lock) without changing the actual ScreenSaverEngine.app.
Changing out the Icon:
- Find the icon you’d like to use in either .png, .gif, .jpg format.
- I used this site to convert my image to an icon: iConvert
- Download your new .icns file.
- Copy your .icns file to the application directory.
$> cp ~/[Icon_FileName].icns /Applications/MacDLock.app/\
Contents/Resources/ScreenSaverEngine.icns
And there you go! You have your custom Screen Saver/Desktop Lock. If you notice any kind of bug in my above code please let me know. I took many other steps while originally doing this so hope they are in the right order and I’m not missing anything.
One of my projects when I have some free time is to setup a Python script or something that embeds an icon into the Menu Bar for quick locking. If this is already available or you feel I’ve recreated the wheel please let me know of the other apps that are out there that may already do this. Always interested in seeing what other have done. Thanks! And hope you enjoy!