Startup Scripts

Plasma Manager allows you to inject scripts that run during the Plasma startup process. This is useful for applying imperative settings that cannot be configured via config files or DBus directly, or for running maintenance tasks.

Autostart Scripts

These scripts run on login.

programs.plasma.startup.startupScript."my_script" = {
  text = ''
    echo "Plasma started" > /tmp/plasma_start_log
  '';
  priority = 1;
};

Desktop Scripts (JavaScript)

KDE Plasma allows execution of JavaScript to modify the runtime shell (panels, widgets, wallpaper). Plasma Manager uses this internally to configure panels, but you can also provide your own custom scripts.

These scripts execute via qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript.

programs.plasma.startup.desktopScript."custom_layout" = {
  text = ''
    // JavaScript for Plasma
    var allDesktops = desktops();
    for (var i = 0; i < allDesktops.length; i++) {
        d = allDesktops[i];
        d.wallpaperPlugin = "org.kde.image";
        // ...
    }
  '';
  priority = 2;
};