mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
17 lines
549 B
Bash
17 lines
549 B
Bash
#!/bin/bash
|
|
|
|
# Temporarily switch to performance power profile on resume
|
|
# to avoid sluggishness while the system catches up, then
|
|
# restore the previous profile after 10 seconds.
|
|
|
|
if [[ $1 == "pre" ]]; then
|
|
mkdir -p /run/omarchy
|
|
powerprofilesctl get > /run/omarchy/power-profile-before-sleep
|
|
fi
|
|
|
|
if [[ $1 == "post" ]]; then
|
|
previous=$(cat /run/omarchy/power-profile-before-sleep 2>/dev/null || echo "balanced")
|
|
powerprofilesctl set performance
|
|
systemd-run --on-active=10 --timer-property=AccuracySec=1 powerprofilesctl set "$previous"
|
|
fi
|