{"id":13861314,"url":"https://github.com/tjluoma/lockscreen","last_synced_at":"2026-03-19T15:47:31.031Z","repository":{"id":9420716,"uuid":"11291387","full_name":"tjluoma/lockscreen","owner":"tjluoma","description":"How to lock your Mac with a keyboard shortcut ","archived":false,"fork":false,"pushed_at":"2013-07-09T20:02:45.000Z","size":348,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-17T04:24:22.794Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tjluoma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-09T19:08:45.000Z","updated_at":"2022-07-09T18:56:56.000Z","dependencies_parsed_at":"2022-09-16T14:02:04.630Z","dependency_job_id":null,"html_url":"https://github.com/tjluoma/lockscreen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tjluoma/lockscreen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjluoma%2Flockscreen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjluoma%2Flockscreen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjluoma%2Flockscreen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjluoma%2Flockscreen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tjluoma","download_url":"https://codeload.github.com/tjluoma/lockscreen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjluoma%2Flockscreen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30206070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"online","status_checked_at":"2026-03-07T02:00:06.765Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-05T06:01:17.123Z","updated_at":"2026-03-07T02:34:02.511Z","avatar_url":"https://github.com/tjluoma.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"lockscreen\n==========\n\nWindows users who switch to the Mac often want an equivalent command to \"Windows Key + L\" which will automatically \"lock\" the screen of a Windows-based computer.\n\nThis can be easily replicated on a Mac *without* resorting to \"hot corners\" or anything like that.\n\nAll it takes is two things:\n\n1. [FastScripts] which is free for up to 10 keyboard shortcuts\n2. An AppleScript called [LockScreen.scpt]\n\nThe AppleScript executes one line:\n\n\t\tdo shell script \"/System/Library/CoreServices/Menu\\\\ Extras/User.menu/Contents/Resources/CGSession -suspend\"\n\nNote the *two* backslashes and the quotation marks.\n\n\n## Installation ##\n\n1) In Finder, click on the \"Go\" menu ***while holding down the Option/Alt key*** in order to reveal the otherwise-hidden \"Library\" option:\n\n![](Finder-Go-Library.jpg)\n\nThen choose \"Library\"\n\n2) Create a folder named \"Scripts\" in the Library folder.\n\n3) Download [LockScreen.scpt] and put it into the \"~/Library/Scripts/LockScreen.scpt\" folder (Note: \"~\" is your home directory, sometimes referred to as \"$HOME\").\n\n4) Download and install [FastScripts].\n\n5) Launch FastScripts, open the Preferences (*hint:* FastScripts will appear in your menu bar at the top-right of your screen).\n\n6) In FastScript preferences, select \"Script Shortcuts\" as shown here:\n\n![](FastScripts-LockScreen-no-shortcut.jpg)\n\nDouble-click where it says \"(none)\" and you press whatever keyboard combination you want, as long as:\n\n* It includes the command key \u003ckbd\u003e⌘\u003c/kbd\u003e and at least one other key\n* The combination is not in use by any other keyboard shortcut\n\nFor example, if you wanted to trigger the lock screen by \u003ckbd\u003e⌘\u003c/kbd\u003e + \u003ckbd\u003e⌥\u003c/kbd\u003e + \u003ckbd\u003eL\u003c/kbd\u003e it should look like this\n\n![](FastScripts-LockScreen.jpg)\n\n*Note:* I would recommend using \u003ckbd\u003e⌘\u003c/kbd\u003e + \u003ckbd\u003e⌥\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eL\u003c/kbd\u003e  since that is less likely to conflict with existing keyboard shortcuts, but it's up to you.\n\n### \"But I don't want to install a 3rd-party app to do this!\" ###\n\nWell, tough.\n\nYeah, I know Windows can do this without a 3rd-party app. How nice.\n\nSupposedly you can do this with [Keychain Access] but I've never been able to get it to work, and ***at best*** it requires two different keystrokes.\n\nComputers are no longer delicate little memory-starved quirkflowers which have to be coddled. \tIf your computer can't handle FastScripts running in the background, it's time to shoot it and put it out of its misery.\n\n### \"But I want to turn the screen off ***and*** lock it!\" ###\n\n\nDownload \u003chttp://tobiastom.github.io/Sleep-Display/\u003e. Unzip it, and move \"Sleep Display.app\" to /Applications/.\n\nThen use [SleepAndLockScreen.scpt](SleepAndLockScreen.scpt) which does this:\n\n\t\tignoring application responses\n\t\t\tdo shell script \"/System/Library/CoreServices/Menu\\\\ Extras/User.menu/Contents/Resources/CGSession -suspend\"\n\t\t\ttell application \"Sleep Display\" to activate\n\t\tend ignoring\n\n\n\n\n[Keychain Access]: http://www.macworld.com/article/1049080/lockscreen.html\n\n[FastScripts]: http://www.red-sweater.com/fastscripts/\n\n[LockScreen.scpt]: LockScreen.scpt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjluoma%2Flockscreen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftjluoma%2Flockscreen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjluoma%2Flockscreen/lists"}