System76 Scheduler is a service which optimizes Linux's CPU scheduler and automatically assigns process priorities for improved desktop responsiveness.
This KWin Script interactively notifies System76 Scheduler which app has focus via D-Bus, so it is prioritized.
The system76-scheduler
service is published on the systemwide D-Bus bus; but KWin Scripts can only call D-Bus methods on the user session bus (as far as I can tell).
This can be worked around by forwarding these specific messages from the session bus to the system bus. See the installation instructions below.
This KWin Script is published at the KDE Store and can be downloaded and installed via "Get New Scripts" at the Window Management → KWin Scripts settings.
git clone https://github.com/maxiberta/kwin-system76-scheduler-integration.git
cd kwin-system76-scheduler-integration
kpackagetool6 --type KWin/Script -i .
or if updating:
kpackagetool5 --type=KWin/Script -u .
Save this script as ~/.local/bin/system76-scheduler-dbus-proxy.sh
(or anywhere else), and make it executable:
chmod +x /usr/local/bin/system76-scheduler-dbus-proxy.sh
This script can be run manually; or can be installed as a systemd user service so that it runs automatically on login.
For example, save the following service definition as ~/.config/systemd/user/com.system76.Scheduler.dbusproxy.service
:
[Unit]
Description=Forward com.system76.Scheduler session DBus messages to the system bus
[Service]
ExecStart=/usr/local/bin/system76-scheduler-dbus-proxy.sh
[Install]
WantedBy=default.target
And enable it:
systemctl --user enable --now com.system76.Scheduler.dbusproxy.service
- Install and configure System76 Scheduler.
- Install this KWin script.
- Activate the script at System Settings → Window Management → KWin Scripts (or run
kcmshell5 kwinscripts
). - Run the dedicated D-Bus proxy as described above.
- Process priority (niceness) of focused apps should interactively update (e.g. check the
NICE
column inSystem Activity
,htop
, or any other process manager).