Skip to content

Instantly share code, notes, and snippets.

@trappedinspacetime
Created May 5, 2022 20:08
Show Gist options
  • Save trappedinspacetime/0e05aa7ce8a7475141601f6cb45455ce to your computer and use it in GitHub Desktop.
Save trappedinspacetime/0e05aa7ce8a7475141601f6cb45455ce to your computer and use it in GitHub Desktop.
limit chromium cpu
while true; do cpulimit -p $( while true ; do if [[ ! -z $(pstree -p -a | awk '/chromium-browser/ && !/awk/' | grep -oP "(?<=sh,).*[0-9]+") ]]; then echo "$(pstree -p -a | awk '/chromium-browser/ && !/awk/' | grep -oP "(?<=sh,).*[0-9]+")"; break; fi; sleep 2; done ) -l 60; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment