From 136e676bc69e9c0f0f69972eba292adb5278f147 Mon Sep 17 00:00:00 2001 From: ION606 Date: Wed, 15 Jan 2025 13:33:32 -0500 Subject: [PATCH] added auto-cpufreq --- auto-cpufreq.conf | 85 +++++++++++++++++++++++++++++++++++++++++++++++ packages.txt | 1 + setup.sh | 22 +++++++----- 3 files changed, 99 insertions(+), 9 deletions(-) create mode 100644 auto-cpufreq.conf diff --git a/auto-cpufreq.conf b/auto-cpufreq.conf new file mode 100644 index 0000000..bf69879 --- /dev/null +++ b/auto-cpufreq.conf @@ -0,0 +1,85 @@ +# settings for when connected to a power source +[charger] +# see available governors by running: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors +# preferred governor +governor = performance + +# EPP: see available preferences by running: cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences +energy_performance_preference = performance + +# EPB (Energy Performance Bias) for the intel_pstate driver +# see conversion info: https://www.kernel.org/doc/html/latest/admin-guide/pm/intel_epb.html +# available EPB options include a numeric value between 0-15 +# (where 0 = maximum performance and 15 = maximum power saving), +# or one of the following strings: +# performance (0), balance_performance (4), default (6), balance_power (8), or power (15) +# if the parameter is missing in the config and the hardware supports this setting, the default value will be used +# the default value is `balance_performance` (for charger) +energy_perf_bias = 2 #balance_performance + +# Platform Profiles +# https://www.kernel.org/doc/html/latest/userspace-api/sysfs-platform_profile.html +# See available options by running: +# cat /sys/firmware/acpi/platform_profile_choices +# platform_profile = performance + +# minimum cpu frequency (in kHz) +# example: for 800 MHz = 800000 kHz --> scaling_min_freq = 800000 +# see conversion info: https://www.rapidtables.com/convert/frequency/mhz-to-hz.html +# to use this feature, uncomment the following line and set the value accordingly +# scaling_min_freq = 800000 + +# maximum cpu frequency (in kHz) +# example: for 1GHz = 1000 MHz = 1000000 kHz -> scaling_max_freq = 1000000 +# see conversion info: https://www.rapidtables.com/convert/frequency/mhz-to-hz.html +# to use this feature, uncomment the following line and set the value accordingly +# scaling_max_freq = 1000000 + +# turbo boost setting. possible values: always, auto, never +turbo = auto + +# settings for when using battery power +[battery] +# see available governors by running: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors +# preferred governor +governor = powersave + +# EPP: see available preferences by running: cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences +energy_performance_preference = power + +# EPB (Energy Performance Bias) for the intel_pstate driver +# see conversion info: https://www.kernel.org/doc/html/latest/admin-guide/pm/intel_epb.html +# available EPB options include a numeric value between 0-15 +# (where 0 = maximum performance and 15 = maximum power saving), +# or one of the following strings: +# performance (0), balance_performance (4), default (6), balance_power (8), or power (15) +# if the parameter is missing in the config and the hardware supports this setting, the default value will be used +# the default value is `balance_power` (for battery) +energy_perf_bias = power + +# Platform Profiles +# https://www.kernel.org/doc/html/latest/userspace-api/sysfs-platform_profile.html +# See available options by running: +# cat /sys/firmware/acpi/platform_profile_choices +# platform_profile = low-power + +# minimum cpu frequency (in kHz) +# example: for 800 MHz = 800000 kHz --> scaling_min_freq = 800000 +# see conversion info: https://www.rapidtables.com/convert/frequency/mhz-to-hz.html +# to use this feature, uncomment the following line and set the value accordingly +# scaling_min_freq = 800000 + +# maximum cpu frequency (in kHz) +# see conversion info: https://www.rapidtables.com/convert/frequency/mhz-to-hz.html +# example: for 1GHz = 1000 MHz = 1000000 kHz -> scaling_max_freq = 1000000 +# to use this feature, uncomment the following line and set the value accordingly +# scaling_max_freq = 1000000 + +# turbo boost setting (always, auto, or never) +turbo = auto + +# battery charging threshold +# reference: https://github.com/AdnanHodzic/auto-cpufreq/#battery-charging-thresholds +#enable_thresholds = true +#start_threshold = 20 +#stop_threshold = 80 diff --git a/packages.txt b/packages.txt index c4ef434..a2bfe08 100644 --- a/packages.txt +++ b/packages.txt @@ -5,6 +5,7 @@ alacritty-themes ani-cli asciiquarium audacity +auto-cpufreq base base-devel batsignal diff --git a/setup.sh b/setup.sh index 2fc1e72..1605b1e 100644 --- a/setup.sh +++ b/setup.sh @@ -1,8 +1,8 @@ #!/bin/bash # Make sure you're sudo -if [ "$EUID" -ne 0 ] - then echo "Please run as root using `sudo -i` then try again" +if [ "$EUID" -ne 0 ]; then + echo "Please run as root using $(sudo -i) then try again" exit fi @@ -39,6 +39,7 @@ echo "This script will install and configure the following: - Starship (customizable shell prompt) - Tailscale (VPN) - Warp (Cloudflare's VPN) +- auto-cpufreq (battery optimizer) - Remove Thunar and Foot (if present) - Clean up and update the system @@ -47,8 +48,8 @@ read answer answer=${answer:-y} if [ "$answer" != "y" ]; then - echo "Installation aborted." - exit + echo "Installation aborted." + exit fi # Make temporary directory @@ -81,8 +82,12 @@ mkdir -p /home/$USERTEMP/.config/alacritty/ mv -f terminal/alacritty.toml /home/$USERTEMP/.config/alacritty/ mv -f terminal/starship.toml /home/$USERTEMP/.config/ +# battery +mkdir -p $USERTEMP/auto-cpufreq/auto-cpufreq.conf +mv auto-cpufreq.conf $USERTEMP/auto-cpufreq/auto-cpufreq.conf + # set up automations in child process -mkdir -p $USERTEMP/.automations && cp -r -f auto/* $USERTEMP/.automations/ && $(sudo pacman -Sy --needed --noconfirm dunst && sudo bash $USERTEMP/.automations/setupauto.sh $USERTEMP &> $USERTEMP/setuplogs.log) & +mkdir -p $USERTEMP/.automations && cp -r -f auto/* $USERTEMP/.automations/ && $(sudo pacman -Sy --needed --noconfirm dunst && sudo bash $USERTEMP/.automations/setupauto.sh $USERTEMP &>$USERTEMP/setuplogs.log) & # Installs # Librewolf @@ -99,19 +104,18 @@ LATEST_JDK=$(sudo dnf list available | grep -E 'java-[0-9]+-openjdk' | awk '{pri # && dnf install ./protonvpn-stable-release-1.0.1-2.noarch.rpm \ # || echo "failed to install Proton VPN!" - # General Package Install -yay -Sy --needed --noconfirm - < packages.txt || echo "failed to install some packages!" +yay -Sy --needed --noconfirm - $USERTEMP/.icons/links.txt +echo -e "https://www.gnome-look.org/p/1305251\nhttps://www.gnome-look.org/p/2091068" >$USERTEMP/.icons/links.txt alacritty-themes --create && alacritty-themes Hyper || echo "alacritty theme install failed!" -cp -r $USERTEMP/.config/wofi/ wofi > /dev/null 2>&1 & +cp -r $USERTEMP/.config/wofi/ wofi >/dev/null 2>&1 & gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' # Remove old programs