Skip to content

Instantly share code, notes, and snippets.

@YamiYukiSenpai
Last active April 9, 2019 08:38
Show Gist options
  • Save YamiYukiSenpai/c48f349f6bfb6128d80b21f27b588403 to your computer and use it in GitHub Desktop.
Save YamiYukiSenpai/c48f349f6bfb6128d80b21f27b588403 to your computer and use it in GitHub Desktop.
Switching performance profiles based on Plasma's activities

Requirements:

  • KActivities
  • cpufrequtils
  1. Place the files in $HOME/bin

  2. Customize the values based on your hardware

  3. Set script to run on profile load in Plasma's activities manager

#!/bin/bash
# Lowering performance to save on power
# CPU = Core i5-6500
# GPU = GTX 1060 6GB
# Change values in regards to your hardware
cur_gov=`cpufreq-info -c 0 | grep -i "The governor" | cut -d "\"" -f 2`
if [ $cur_gov != "performance" ]; then
pkexec cpufreq-set -g powersave -d 900MHz -u 3.4GHz
fi
# Setting to Auto mode
nvidia-settings -a GPUPowerMizerMode=2
#!/bin/bash
# Maximizing performance
# CPU = Core i5-6500
# GPU = GTX 1060 6GB
# Change values in regards to your hardware
cur_gov=`cpufreq-info -c 0 | grep -i "The governor" | cut -d "\"" -f 2`
if [ $cur_gov != "performance" ]; then
pkexec cpufreq-set -g performance -d 3.5GHz -u 3.6GHz
fi
# Maximum Performance mode
nvidia-settings -a GPUPowerMizerMode=1
#!/bin/bash
# Set script to run on profile load in Plasma's activities manager
act_id=`kactivities-cli --current-activity | awk '{print $2}'`
# Default mode
if [ $act_id == "8491e724-c481-49e2-9150-3a6b792729ed" ]; then
echo "Default mode = $act_id"
$USER/bin/default_mode.sh
# Gaming Mode
elif [ $act_id == "c8a382f7-09b8-4fcd-ad50-97674cc148c1" ]; then
echo "Gaming mode = $act_id"
$USER/bin/gaming_mode.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment