add Intel platform_profile toggle script

This commit is contained in:
Rune Juhl Jacobsen 2025-01-28 23:44:25 +01:00
parent b0d9b2c717
commit 4c1d731532

14
platform_profile Executable file
View file

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -euo pipefail
set -x
case "${1}" in
get)
head -c1 /sys/firmware/acpi/platform_profile | tr '[:lower:]' '[:upper:]'
;;
toggle)
current="$(cat /sys/firmware/acpi/platform_profile)"
choices="$(cat /sys/firmware/acpi/platform_profile_choices)"
next="$(echo "${choices} ${choices}" | tr \ \\n | grep -A1 "${current}" | tail -n+2 | head -n1)"
echo "${next}" | sudo tee /sys/firmware/acpi/platform_profile
esac