diff --git a/platform_profile b/platform_profile new file mode 100755 index 0000000..22cebd8 --- /dev/null +++ b/platform_profile @@ -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