{"id":20735743,"url":"https://github.com/iamfaizankhalid/lock","last_synced_at":"2025-10-04T07:53:31.198Z","repository":{"id":176099808,"uuid":"654969055","full_name":"IamFaizanKhalid/lock","owner":"IamFaizanKhalid","description":"A simple Golang package to get notified when the screen gets locked.","archived":false,"fork":false,"pushed_at":"2023-06-19T06:20:48.000Z","size":40,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-17T16:34:38.852Z","etag":null,"topics":["golang","os","screenlock","sleep"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IamFaizanKhalid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-17T13:36:02.000Z","updated_at":"2025-06-11T17:00:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"14420344-d31e-404b-9239-98c7aaf8521b","html_url":"https://github.com/IamFaizanKhalid/lock","commit_stats":null,"previous_names":["iamfaizankhalid/lock"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/IamFaizanKhalid/lock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamFaizanKhalid%2Flock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamFaizanKhalid%2Flock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamFaizanKhalid%2Flock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamFaizanKhalid%2Flock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IamFaizanKhalid","download_url":"https://codeload.github.com/IamFaizanKhalid/lock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamFaizanKhalid%2Flock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273196643,"owners_count":25062227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"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":["golang","os","screenlock","sleep"],"created_at":"2024-11-17T05:39:26.378Z","updated_at":"2025-10-04T07:53:26.150Z","avatar_url":"https://github.com/IamFaizanKhalid.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lock\n[![Go Report Card](https://goreportcard.com/badge/github.com/IamFaizanKhalid/lock)](https://goreportcard.com/report/github.com/IamFaizanKhalid/lock) [![Release](https://img.shields.io/github/v/release/IamFaizanKhalid/lock.svg?style=flat-square)](https://github.com/IamFaizanKhalid/lock/releases) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\n\u003cimg align=\"right\" width=\"100\" src=\"./_lock.png\" alt=\"Nishan Pakistan\"\u003e\n\nA simple Golang package to get notified when the screen gets locked.\n\n⚠️ **Warnings:**\n1. This was developed as an experiment and may not always work.\n2. It currently supports only macOS, Windows and Linux.\n3. Not tested on all linux desktops\n\n## Installation\n\n```console\ngo get -u github.com/IamFaizanKhalid/lock\n```\n\n## Usage Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/IamFaizanKhalid/lock\"\n)\n\nfunc main() {\n\tif lock.IsScreenLocked() {\n\t\tfmt.Println(\"Screen is locked...\")\n\t} else {\n\t\tfmt.Println(\"Screen is not locked...\")\n\t}\n\n\tlock.HandleEvents(lockEventHandler)\n}\n\nfunc lockEventHandler(e lock.Event) {\n\tfmt.Print(e.Time.Format(time.TimeOnly), \"\\t\")\n\tif e.Locked {\n\t\tfmt.Println(\"screen locked\")\n\t} else {\n\t\tfmt.Println(\"screen unlocked\")\n\t}\n}\n```\n\n\n## License\n\n[MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamfaizankhalid%2Flock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamfaizankhalid%2Flock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamfaizankhalid%2Flock/lists"}