zypper in nano
nano /etc/systemd/system/cpu-governor.service
[Unit] Description=set cpu governor to 'conservative' when 'active (exited)' or 'interactive' (default setting) when 'inactive (dead)' [Service] Type=oneshot ExecStart=/usr/lib/systemd/scripts/cpu-governor start ExecStop=/usr/lib/systemd/scripts/cpu-governor stop RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=basic.target
mkdir /usr/lib/systemd/scripts/ nano /usr/lib/systemd/scripts/cpu-governor
#!/bin/bash # Toggle script to switch CPU governor to 'conservative' or 'interactive. # Used as systemd.service in combination with /etc/systemd/system/cpu-governor # Can be used as simple 'toggler' without systemd. start() { /bin/echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor } stop() { /bin/echo interactive > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor } case "$1" in start) start ;; stop) stop ;; restart) stop sleep 1 start ;; *) exit 1 esac
chmod +x /usr/lib/systemd/scripts/cpu-governor systemctl enable cpu-governor.service
systemctl start/stop/restart/disable/status cpu-governor.service