DEV Community

Cover image for Keep your Windows always on!
Amzar
Amzar

Posted on

Keep your Windows always on!

When you're working on something else that needs away from the keyboard, your Windows always automatically locks due to the setting (because you don't have admin access to change the setting due to company restrictions).

Usually, people will open YouTube repeatedly, which is tiring since YouTube also has a policy that if you're idle, it will auto-pause.

Solution

With Python, you can code a script to press the key for a certain time range.

...
def main(args):
    try:
        print(progname)
        console.print(
            "\nRunning with [bold cyan]{}[/bold cyan] key.".format(args.button)
        )
        no_lock(args.button)

    except KeyboardInterrupt:
        print("\n[Process Stopped]", flush=True)

    except Exception as ex:
        print({"main": ex})
...
Enter fullscreen mode Exit fullscreen mode

Only works on Windows :)

Full Code

Github follow the installation step in README.md

Top comments (2)

Collapse
 
sectasy0 profile image
sectasy • Edited

In my opinion, it's a silly case of "because you don't have admin access to change the setting due to company restrictions". I can't imagine that, being a programmer and not having local admin rights

Collapse
 
amzar profile image
Amzar

Indeed, but it's reality :)