distribution/packages/jelos/autostart/008-perfmode

34 lines
855 B
Bash
Executable file

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
# Minimal OS variable loading for performance
. /etc/profile.d/001-functions
. /etc/profile.d/030-powerfunctions
. /etc/profile.d/099-freqfunctions
tocon "Setting performance mode..."
### Enable the desired number of threads.
tocon "Restoring cpu threads..."
NUMTHREADS=$(get_setting "system.threads")
if [ -n "${NUMTHREADS}" ]
then
onlinethreads ${NUMTHREADS} 0
else
onlinethreads all 1
fi
### If we don't have a default governor set, set it
### to schedutil but don't enable it.
if [ -z "$(get_setting system.cpugovernor)" ]
then
set_setting system.cpugovernor schedutil
fi
### Set the default GPU performance mode
GPUPERF=$(get_setting system.gpuperf)
if [ -n "${GPUPERF}" ]
then
gpu_performance_level ${GPUPERF}
fi