Share a single power profile parser between list and set

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier Hansson
2026-07-19 21:29:15 -07:00
co-authored by Claude Fable 5
parent d211de2ffc
commit f3878b341c
2 changed files with 8 additions and 10 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ case "$action" in
*) usage ;;
esac
mapfile -t profiles < <(powerprofilesctl list | awk '/^\s*[* ]\s*[a-zA-Z0-9\-]+:$/ { gsub(/^[*[:space:]]+|:$/,""); print }')
mapfile -t profiles < <(omarchy-powerprofiles-list)
profile_available() {
[[ " ${profiles[*]} " == *" $1 "* ]]