There are many Apps in AppStore that allows screen locking, however, if you are interested you can even write your own custom shell script to lock the screen when you are away.
Open TextEdit, and type the following code,
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
Save it as "lock.sh" in a location easily accessible for you. Open terminal and give it execute permission using the following command,
chmod 777 lock.sh
Right click the file and change the default application to open as terminal.
From next time onwards, a simple double click on the file, will open terminal and lock the screen.
References
http://osxdaily.com/2012/03/30/lock-mac-desktop-command-line/
Open TextEdit, and type the following code,
/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
Save it as "lock.sh" in a location easily accessible for you. Open terminal and give it execute permission using the following command,
chmod 777 lock.sh
Right click the file and change the default application to open as terminal.
From next time onwards, a simple double click on the file, will open terminal and lock the screen.
References
http://osxdaily.com/2012/03/30/lock-mac-desktop-command-line/
No comments:
Post a Comment