Created
March 23, 2017 12:36
-
-
Save Cybolic/8ba4b6350826c8e5ad5eb23dcbf627d2 to your computer and use it in GitHub Desktop.
CPU governor selector for Argos
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
#!/usr/bin/env bash | |
echo "CPU | iconName=cpu" | |
echo "---" | |
echo "---" | |
GOVERNORS=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors) | |
SELECTED=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor) | |
for governor in $GOVERNORS; do | |
# Capitalize the governor name | |
governor_name="$(echo $governor | cut -c1 | tr [:lower:] [:upper:])$(echo $governor | cut -c2-)" | |
# Mark current governor in bold | |
if [[ "$SELECTED" == "$governor" ]]; then | |
governor_name="<b>${governor_name}</b>" | |
fi | |
# Output name and command | |
echo "${governor_name} | useMarkup=true refresh=true terminal=false bash='echo $governor | pkexec tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment