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
#!/bin/bash | |
# throttle - utility throttling applications according to CPU temperature. | |
# Usage: throttle.sh <PID> | |
# Alternatively: throttle.sh <your command here> | |
# Version: 1 | |
# Changelog: | |
# 1: | |
# * Configuration vars are only set if not already set (per-app config. via env.) | |
# * Added QUIET configuration | |
# * Added notify-send support |
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
#!/bin/bash | |
SOURCE="${BASH_SOURCE[0]}" | |
# Resolve $SOURCE until the file is no longer a symlink. | |
while [ -h "$SOURCE" ]; do | |
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" | |
# If $SOURCE was a relative symlink, we need to resolve it | |
# relative to the path where the symlink file was located. | |
done |