Skip to content

Instantly share code, notes, and snippets.

View AzzyC's full-sized avatar
💭
Milk then cereal'ing

Azmath Choudhury AzzyC

💭
Milk then cereal'ing
View GitHub Profile
@AzzyC
AzzyC / nosleep.sh
Last active February 20, 2021 13:22
Completely disable sleep on Windows
#!/bin/bash
# Restore original and remove new power scheme, if User signals interruption
# Restore trap necessary, otherwise script will not work in subsequent instances
restore () {
powercfg -setactive "$activescheme" 2> /dev/null
powercfg -delete "$newscheme" 2> /dev/null
}
trap restore SIGINT