Author: flatwhite

  • Caffeine

    Caffine – keep your comuter awake with Python or Powershell

    Python
    ~/flatwhite via 🐍 v3.10.2 (flatwhite) 
    ❯ cat misc/caffeine.py
    import time
    from pyautogui import press
    
    while(True):
        press('shift')
        print('on shift! \n')
        time.sleep(300)
    Powershell
    c/Users/flatwhite
    :) cat caffeine.ps1
    while(1)
    {
            $dummyshell = New-Object -com "Wscript.shell"
            $dummyshell.sendkeys("+")
            Start-Sleep -seconds 59
    }⏎