22 lines
536 B
Bash
22 lines
536 B
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
|
|
|
### Restore previous governors before going to sleep
|
|
|
|
. /etc/profile
|
|
|
|
### Grab the old governors.
|
|
OLD_CPU_FREQ=$(get_setting "sleep.cpugovernor")
|
|
if [ ! -n "${OLD_CPU_FREQ}" ]; then
|
|
OLD_CPU_FREQ="schedutil"
|
|
fi
|
|
|
|
OLD_GPU_LEVEL=$(get_setting "sleep.gpulevel")
|
|
if [ ! -n "${OLD_GPU_LEVEL}" ]; then
|
|
OLD_GPU_LEVEL="balanced"
|
|
fi
|
|
|
|
# Restore old governors.
|
|
set_cpu_gov "${OLD_CPU_FREQ}"
|
|
gpu_performance_level "${OLD_GPU_LEVEL}"
|