You have made this possible for me.
In my sway environment, changing smt crashes the status bar (waybar), so I did not change the smt setting.
@slangbein Thanks kindly.
/root/.local/bin/cpupower-performance-app.sh
Code: Select all
#!/bin/bash
performance_app="$*"
if ps -C "$performance_app" > /dev/null ; then
cpupower frequency-info | grep '"performance"' > /dev/null ||
cpupower frequency-set -g performance
else
cpupower frequency-info | grep '"powersave"' > /dev/null ||
cpupower frequency-set -g powersave
fi
/etc/systemd/system/cpupower-performance-app.service
Code: Select all
[Unit]
Description=%n
[Service]
Type=oneshot
ExecStart=/bin/bash /root/.local/bin/cpupower-performance-app.sh reaper,renoise,pd
/etc/systemd/system/cpupower-performance-app.timer
Code: Select all
[Unit]
Description=%n
[Timer]
OnCalendar=minutely
[Install]
WantedBy=timers.target
Code: Select all
# grep cpupower /etc/sudoers.d/wheel
%wheel ALL=(ALL:ALL) NOPASSWD: /usr/bin/cpupower
#
# systemctl enable --now cpupower-performance-app.timer
Created symlink /etc/systemd/system/timers.target.wants/cpupower-performance-app.timer → /etc/systemd/system/cpupower-performance-app.timer.
#
When reaper is started, it is now in performance mode immediately, without waiting for timer to start.
~/.local/bin/reaper-performance.sh
Code: Select all
#!/bin/bash
sudo cpupower frequency-set -g performance
reaper