{"id":18827103,"url":"https://github.com/nullpo-head/winsomnia-ssh","last_synced_at":"2025-04-14T02:08:41.628Z","repository":{"id":148583205,"uuid":"354510396","full_name":"nullpo-head/winsomnia-ssh","owner":"nullpo-head","description":"Prevents Windows from sleeping during ssh in WSL. It also provides a handy CLI, `winsomnia`, which allows you to pause sleep whenever you want, for however long you want.","archived":false,"fork":false,"pushed_at":"2021-04-04T15:20:30.000Z","size":13,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T02:08:34.814Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nullpo-head.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-04T10:02:56.000Z","updated_at":"2025-03-13T18:52:31.000Z","dependencies_parsed_at":"2023-05-20T14:45:07.967Z","dependency_job_id":null,"html_url":"https://github.com/nullpo-head/winsomnia-ssh","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullpo-head%2Fwinsomnia-ssh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullpo-head%2Fwinsomnia-ssh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullpo-head%2Fwinsomnia-ssh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nullpo-head%2Fwinsomnia-ssh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nullpo-head","download_url":"https://codeload.github.com/nullpo-head/winsomnia-ssh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248809044,"owners_count":21164896,"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-08T01:12:59.322Z","updated_at":"2025-04-14T02:08:41.616Z","avatar_url":"https://github.com/nullpo-head.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Winsomnia-ssh and Winsomnia\n\n`winsomnia-ssh` prevents Windows from going to sleep while your ssh session is active in WSL.\nIt also provides a simple CLI, `winsomnia`, which allows you to pause sleep whenever you want, for however long you want.\n\n## Installation\n\nInstall `winsomnia-ssh` in WSL by `pip`.\n\n```sh\npip install \"git+https://github.com/nullpo-head/winsomnia-ssh\"\n```\n\n`winsomnia-ssh` requires `python` both in WSL2 and Windows. Please install Python for Windows via [the official installer](https://www.python.org/downloads/). Please DO NOT install Python via Microsoft store. It appears that the store app cannot be launched from WSL.\n\nIf you install `winsomnia-ssh` in native Windows, `winsomnia` should work without problem.\n`winsomnia-ssh` may be able to work, but it's not tested or supported.\n\n## Usage\n\n### Prevent sleep while your ssh session in WSL is active\n\nAdd the following line to your `~/.bashrc` or an equivalent file of your environment in WSL.\n\n```sh\nwinsomnia-ssh\n```\n\nAs long as the shell session in WSL that launched `winsomnia-ssh` is active, it will prevent Windows from going to sleep.\nIt does nothing when your session is not in a ssh session, so you can just add the line above to your `.bashrc`.\n\nPlease note that the detection of ssh sessions assumes that your `sshd` is `sshd` of Linux (WSL).\nFor your reference, here is an example tutorial of how to set up an ssh server in WSL. [How to SSH into WSL2 on Windows 10 from an external machine - Scott Hanselman's Blog](https://www.hanselman.com/blog/how-to-ssh-into-wsl2-on-windows-10-from-an-external-machine).\nScott's article recommends that `DO NOT DO THE INSTRUCTIONS IN THIS POST` because it is simpler to use the native OpenSSH service of Windows. However, `winsomnia-ssh` depends on Linux `sshd`, so please follow the instruction. Personally, I recommend you to set up a ssh server and port forwardings in WSL2 instead of Windows, because it is more flexible when you want to have more Linux services in the future.\n\n### Manually prevent sleep for a while by CLI\n\n`winsomnia-ssh` provides a handy CLI tool, `winsomnia`.\n`winsomnia` allows you to prevent sleep whenever you want, regardless of whether you are in an ssh session or not.\n\n```sh\nwinsomnia [duration_in_minutes]\n```\n\nYou can quit `winsomnia` to resume Windows Sleep.\n\n```console\n$ winsomnia\nTrying to run via python.exe\nKill this program by Ctrl+C to let Windows sleep\n^C\n```\n\nSee `winsomnia --help` for the detailed usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullpo-head%2Fwinsomnia-ssh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnullpo-head%2Fwinsomnia-ssh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnullpo-head%2Fwinsomnia-ssh/lists"}