distribution/packages/jelos/profile.d/99-freqfunctions

46 lines
840 B
Text
Raw Normal View History

#!/bin/bash
2022-02-05 14:23:32 +00:00
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/os-release
set_cpu_gov() {
for POLICY in ${CPU_FREQ[@]}
do
2022-03-07 03:11:57 +00:00
echo $1 >${POLICY}/scaling_governor 2>/dev/null
done
}
set_dmc_gov() {
echo $1 >${DMC_FREQ}/governor 2>/dev/null || echo dmc_$1 >${DMC_FREQ}/governor 2>/dev/null
}
set_gpu_gov() {
echo $1 >${GPU_FREQ}/governor 2>/dev/null || echo dmc_$1 >${GPU_FREQ}/governor 2>/dev/null
2022-02-05 14:23:32 +00:00
}
performance() {
set_cpu_gov performance
set_gpu_gov performance
set_dmc_gov performance
2022-02-05 14:23:32 +00:00
}
ondemand() {
set_cpu_gov ondemand
set_gpu_gov ondemand
set_dmc_gov ondemand
2022-02-05 14:23:32 +00:00
}
interactive() {
set_cpu_gov interactive
set_gpu_gov ondemand
set_dmc_gov ondemand
}
2022-02-05 14:23:32 +00:00
powersave() {
set_cpu_gov powersave
set_gpu_gov powersave
set_dmc_gov powersave
2022-02-05 14:23:32 +00:00
}