How do I configure default panel, pinned applications & favorites in app launcher for new user profiles?

I’m looking for a way to configure the default panel and pinned applications and plasmoids that are on the panel itself.

In this scenario, every new user profile would have a custom panel with custom pinned applications & custom favorites in application launcher. Sorta like I’m creating my own Plasma-based distro, but with modified defaults

Related to Plasma and Ansible on enterprise thin clients - changing default Plasma settings - #3 by YamiYukiSenpai

Right Click and start customizing?

Not sure what you’re asking, and why you need to ask.

I’m setting up desktops with custom defaults at work with custom favorites/pinned applications.

i think your issue is going to be that some of those configuration settings are going to be tied to your user.

so just plopping them down into another user’s ~ folder is probably not going to work that simply.

you might need a script to copy and deploy the files to each new user substituting your user specifics with each new user in turn.

it doesn’t seem like a trivial effort.

you can lookup konsave and and see what it does, then look at the files it’s going to operate on for any user specific details you might need to swap out… then build a script to take care of those details.

Have a look at Introduction to Kiosk | Developer

And https://wiki.archlinux.org/title/Users_and_groups#Changing_user_defaults

Yea I’m reading through that document.

I’m currently trying to find pinned icons, and I can’t seem to find it, other than plasma-org.kde.plasma.desktop-appletsrc.

Any idea as to where?

~/.config/plasma-org.kde.plasma.desktop-appletsrc ?

Oh nvm, I missread.

Found the file in ~/.config/kactivitymanagerd-statsrc

but it doesn’t seem to apply in /etc/xdg

Seems that its broken in 5.27

https://bugs.kde.org/show_bug.cgi?id=448660

Found the post here where it’s fixed in 6.2

Distros can now customize the default set of favorite apps shared across Kickoff, Kicker, and Application Dashboard (Harald Sitter, Plasma 6.2.0. Link)

Ok. I got it working with Global Theme Explorer, but the panel isn’t maximizing properly.

If the theme was done on a 4K monitor, the panel overshoots itself when applied on 1440p.

From what I learned in reading the theme generated in Global Theme Explorer, I tried to use this:

var plasma = getApiVersion(1);

var layout = {
    "desktops": [
        {
            "applets": [
            ],
            "config": {
                "/": {
                    "ItemGeometries-2560x1307": "",
                    "ItemGeometriesHorizontal": "",
                    "formfactor": "0",
                    "immutability": "1",
                    "lastScreen": "0",
                    "wallpaperplugin": "org.kde.image"
                },
                "/ConfigDialog": {
                    "DialogHeight": "540",
                    "DialogWidth": "720"
                },
                "/General": {
                    "ToolBoxButtonState": "topcenter",
                    "ToolBoxButtonX": "879"
                },
                "/Wallpaper/org.kde.image/General": {
                    "Image": "/home/yamiyukisenpai/Pictures/WP/RA_Classica_Nikia_high_0004.jpg"
                }
            },
            "wallpaperPlugin": "org.kde.image"
        }
    ],
    "panels": [
        {
            "alignment": "left",
            "applets": [
                {
                    "config": {
                        "/": {
                            "PreloadWeight": "100",
                            "popupHeight": "514",
                            "popupWidth": "651"
                        },
                        "/Configuration%2FGeneral": {
                            "showAppsByName": "true"
                        },
                        "/General": {
                            "favoritesPortedToKAstats": "true"
                        },
                        "/Shortcuts": {
                            "global": "Alt+F1"
                        }
                    },
                    "plugin": "org.kde.plasma.kickoff"
                },
                {
                    "config": {
                    },
                    "plugin": "org.kde.plasma.pager"
                },
                {
                    "config": {
                        "/General": {
                            "launchers": "preferred://browser,applications:systemsettings.desktop,preferred://filemanager,applications:org.kde.gwenview.desktop"
                        }
                    },
                    "plugin": "org.kde.plasma.icontasks"
                },
                {
                    "config": {
                    },
                    "plugin": "org.kde.plasma.marginsseparator"
                },
                {
                    "config": {
                        "/": {
                            "PreloadWeight": "55"
                        }
                    },
                    "plugin": "org.kde.plasma.systemtray"
                },
                {
                    "config": {
                    },
                    "plugin": "org.kde.plasma.digitalclock"
                },
                {
                    "config": {
                    },
                    "plugin": "org.kde.plasma.minimizeall"
                }
            ],
            "config": {
                "/": {
                    "formfactor": "3",
                    "immutability": "1",
                    "lastScreen": "0",
                    "wallpaperplugin": "org.kde.image"
                }
            },
            "height": 2.4444444444444446,
            "hiding": "normal",
            "location": "left",
            "maximumLength": 72.61111111111111,
            "minimumLength": 72.61111111111111,
            "offset": 0
        }
    ],
    "serializationFormatVersion": "1"
}
;

plasma.loadSerializedLayout(layout);

And translate it on this to create a default panel:

var panel = new Panel
var panelScreen = panel.screen
var freeEdges = {"left": true, "top": true, "bottom": true, "right": true}

for (i = 0; i < panelIds.length; ++i) {
    var tmpPanel = panelById(panelIds[i])
    if (tmpPanel.screen == panelScreen) {
        // Ignore the new panel
        if (tmpPanel.id != panel.id) {
            freeEdges[tmpPanel.location] = false;
        }
    }
}

if (freeEdges["left"] == true) {
    panel.location = "left";
} else if (freeEdges["top"] == true) {
    panel.location = "top";
} else if (freeEdges["bottom"] == true) {
    panel.location = "bottom";
} else if (freeEdges["right"] == true) {
    panel.location = "right";
} else {
    // There is no free edge, so leave the default value
    panel.location = "left";
}
// For an Icons-Only Task Manager on the bottom, *3 is too much, *2 is too little
// Round down to next highest even number since the Panel size widget only displays
// even numbers
panel.height = 2 * Math.floor(gridUnit * 2.5 / 2)

// Restrict horizontal panel to a maximum size of a 21:9 monitor
const maximumAspectRatio = 21/9;
if (panel.formFactor === "horizontal") {
    const geo = screenGeometry(panelScreen);
    const maximumWidth = Math.ceil(geo.height * maximumAspectRatio);

    if (geo.width > maximumWidth) {
        panel.alignment = "center";
        panel.minimumLength = maximumWidth;
        panel.maximumLength = maximumWidth;
    }
}

var kickoff = panel.addWidget("org.kde.plasma.kickoff")
kickoff.currentConfigGroup = ["Shortcuts"]
kickoff.writeConfig("global", "Alt+F1")
kickoff.currentConfigGroup = ["Configuration/General"]
kickoff.writeConfig("showAppsByName", "true")

//panel.addWidget("org.kde.plasma.showActivityManager")
panel.addWidget("org.kde.plasma.pager")
// panel = {
//     "panels": [
//         "applets": {
//             "config": {
//                 "/General": {
//                     "launchers": "preferred://browser,applications:systemsettings.desktop,preferred://filemanager,applications:org.kde.gwenview.desktop"
//                 }
//             },
//             "plugin": "org.kde.plasma.icontasks"
//         },
//     ],
//     "serializationFormatVersion": "1"
// };
var taskmanager = panel.addWidget("org.kde.plasma.icontasks")
taskmanager.currentConfigGroup = ["General"]
taskmanager.writeConfig("launchers", 'application:firefox.desktop,preferred://browser,applications:systemsettings.desktop,preferred://filemanager,applications:org.kde.gwenview.desktop')
taskmanager.reloadConfig();
panel.addWidget("org.kde.plasma.marginsseparator")

/* Next up is determining whether to add the Input Method Panel
 * widget to the panel or not. This is done based on whether
 * the system locale's language id is a member of the following
 * white list of languages which are known to pull in one of
 * our supported IME backends when chosen during installation
 * of common distributions. */

var langIds = ["as",    // Assamese
               "bn",    // Bengali
               "bo",    // Tibetan
               "brx",   // Bodo
               "doi",   // Dogri
               "gu",    // Gujarati
               "hi",    // Hindi
               "ja",    // Japanese
               "kn",    // Kannada
               "ko",    // Korean
               "kok",   // Konkani
               "ks",    // Kashmiri
               "lep",   // Lepcha
               "mai",   // Maithili
               "ml",    // Malayalam
               "mni",   // Manipuri
               "mr",    // Marathi
               "ne",    // Nepali
               "or",    // Odia
               "pa",    // Punjabi
               "sa",    // Sanskrit
               "sat",   // Santali
               "sd",    // Sindhi
               "si",    // Sinhala
               "ta",    // Tamil
               "te",    // Telugu
               "th",    // Thai
               "ur",    // Urdu
               "vi",    // Vietnamese
               "zh_CN", // Simplified Chinese
               "zh_TW"] // Traditional Chinese

if (langIds.indexOf(languageId) != -1) {
    panel.addWidget("org.kde.plasma.kimpanel");
}

panel.addWidget("org.kde.plasma.systemtray")
panel.addWidget("org.kde.plasma.digitalclock")
panel.addWidget("org.kde.plasma.minimizeall")

For some reason, the one from the default panel won’t setup any pinned icons, while the one from global them does setup.

I gave up on Kickoff for now since it’s being a pain, and just need to focus on one that I see is making any changes.