Skip to content

Instantly share code, notes, and snippets.

@shoaib281
Created January 19, 2023 22:30
Show Gist options
  • Save shoaib281/a09cab14903f77b13f724785fc58de92 to your computer and use it in GitHub Desktop.
Save shoaib281/a09cab14903f77b13f724785fc58de92 to your computer and use it in GitHub Desktop.
toggle dont auto-turn off
#!/bin/bash
if grep -q "\[AC\]\[SuspendSession\]" ~/.config/powermanagementprofilesrc; then
sed -i -e 's/\[AC\]\[SuspendSession\]/\[AC\]\[SuspendSessio3\]/g' ~/.config/powermanagementprofilesrc
sed -i -e "s/lidAction=1/lidAction=64/g" ~/.config/powermanagementprofilesrc
echo "downloading overnight"
else
sed -i -e 's/\[AC\]\[SuspendSessio3\]/\[AC\]\[SuspendSession\]/g' ~/.config/powermanagementprofilesrc
sed -i -e "s/lidAction=64/lidAction=1/g" ~/.config/powermanagementprofilesrc
echo "back to normal"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment