This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# -------------------------------------------------------------------- | |
No Sleep v2.2 - 2025 | |
- Moves the cursor in the shape of a heart every 118s. | |
- Pauses after a set time of true user absence to allow the computer to sleep. | |
- Default pause time is 2 hours, but can be overridden with an argument (e.g., .\script.ps1 1.5). | |
- Designed to work in locked-down corporate environments, avoids the use of external DLLs or WMI. | |
-------------------------------------------------------------------- #> | |
#region -- WIN32 API HELPERS (Idle Time & Mouse Nudge) -- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local json = require("json") | |
function command(cmd, raw) | |
local f = assert(io.popen(cmd, 'r')) | |
local s = assert(f:read('*a')) | |
f:close() | |
if raw then return s end | |
s = string.gsub(s, '^%s+', '') | |
s = string.gsub(s, '%s+$', '') | |
s = string.gsub(s, '[\n\r]+', ' ') |