Skip to content

ChiIIBiII/winsomnia-nopython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Winsomnia-noPython

Usage

Inspired by Winsomnia-ssh but works without python (just uses bash ans wsl). Usage

  • Set Powershell path in winsomnia-nopython.sh
  • Set (absolute WSL) path to keep_awake.ps1 in winsomnia-nopython.sh
  • Add the line . /path/to/my-winsomnia.sh to your ~/.bashrc or other shell initialization script. The . prefix is crucial.

How does it work?

Whenever a new shell is initialized, the script checks if it is inside an ssh session. If that is the case, a Powershell child process is started that sets the SetThreadExecutionState to ES_CONTINUOUS | ES_SYSTEM_REQUIRED. This state is active until the windows thread exits. Fortunately, the windows thread will be killed when the corresponding linux process is killed, which is done using the trap ... EXIT.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published