add Intel platform_profile toggle script
This commit is contained in:
parent
b0d9b2c717
commit
4c1d731532
1 changed files with 14 additions and 0 deletions
14
platform_profile
Executable file
14
platform_profile
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue