Created
December 22, 2022 11:38
-
-
Save AOx0/91e757d2ff363c181ba0a3bc7fff5d33 to your computer and use it in GitHub Desktop.
This file contains 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
function set-sleep --argument-names on | |
if [ "$on" = "on" ] | |
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0; | |
echo "Enabled sleep"; | |
else if [ "$on" = "off" ] | |
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1; | |
echo "Disabled sleep"; | |
else | |
echo "Invalid first argument. Should be 'on' or 'off'" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment