Wrote two one-liners to switch profiles of power-profiles-daemon, to be run automatically when power cord gets plugged in and unplugged.
Here’s the repo
Here are the scripts:
filename: performance.sh
#!/bin/sh
#set performance profile through D-bus
powerprofilesctl set performance
filename: power-save.sh
#!/bin/sh
#set performance profile through D-bus
powerprofilesctl set power-saver
-
Store these scripts in
~/bin
or/usr/local/bin
-
Make the scripts executable by changing to the folder where the scripts are located and execute:
sudo chmod 555 *e.sh
To use automatically in KDE Plasma:
- Go to System Settings
- go to Energy Saving
- set the
power-save.sh
script to execute in the On AC Power tab - set the
performance.sh
script to execute in the On Battery tab