{"id":19746849,"url":"https://github.com/b-ryan/py-screen-events","last_synced_at":"2025-02-28T00:17:38.099Z","repository":{"id":21908760,"uuid":"25232827","full_name":"b-ryan/py-screen-events","owner":"b-ryan","description":"A python library to detect when your screen turns on or off.","archived":false,"fork":false,"pushed_at":"2015-07-09T22:27:54.000Z","size":180,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-10T20:53:01.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/b-ryan.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}},"created_at":"2014-10-15T00:54:44.000Z","updated_at":"2024-07-25T08:38:57.000Z","dependencies_parsed_at":"2022-08-20T01:30:59.208Z","dependency_job_id":null,"html_url":"https://github.com/b-ryan/py-screen-events","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-ryan%2Fpy-screen-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-ryan%2Fpy-screen-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-ryan%2Fpy-screen-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-ryan%2Fpy-screen-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b-ryan","download_url":"https://codeload.github.com/b-ryan/py-screen-events/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241078406,"owners_count":19905850,"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","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-11-12T02:16:03.214Z","updated_at":"2025-02-28T00:17:38.081Z","avatar_url":"https://github.com/b-ryan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"py-screen-events\n================\n\nA python library to detect when your screen goes blank or wakes up.\n\nHas been tested on Ubuntu 14.04 and OS X Yosemite using Python 2.7.6.\n\nUsage\n=====\n\nHave a callback function triggered whenever the screen is locked or turns off:\n\n```python\nfrom screen_events import ScreenState, event_loop\n\n\ndef callback(state):\n    if state == ScreenState.ON:\n        print \"the screen was unlocked or it turned back on\"\n    elif state == ScreenState.OFF:\n        print \"the screen was locked or it turned off\"\n    else:\n        print \"this will never happen\"\n\nevent_loop(callback)\n```\n\nTo get the current state of the screen:\n\n```python\nfrom screen_events import screen_state\n\nprint screen_state()\n```\n\n\nRelevant links\n==============\n\nBug report for GetActive (dbus org.gnome.ScreenSaver) changing in trusty:\n\nhttps://bugs.launchpad.net/unity/+bug/1342152\n\nPython dbus examples (particularly interesting is INTROSPECTIVE_IFACE):\n\nhttp://en.wikibooks.org/wiki/Python_Programming/Dbus\n\nDocs for org.gnome.ScreenSaver:\n\nhttps://people.gnome.org/~mccann/gnome-screensaver/docs/gnome-screensaver.html#gs-method-GetActive\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-ryan%2Fpy-screen-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb-ryan%2Fpy-screen-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-ryan%2Fpy-screen-events/lists"}