| Summary: | Plasma 6 Panel - Ability to set lengthMode through API Scripting | ||
|---|---|---|---|
| Product: | [Plasma] plasmashell | Reporter: | Frank <frankebay99> |
| Component: | Panel | Assignee: | fanzhuyifan |
| Status: | RESOLVED FIXED | ||
| Severity: | wishlist | CC: | fanzhuyifan, nate, niccolo.venerandi |
| Priority: | NOR | Keywords: | qt6 |
| Version First Reported In: | 5.90.0 | ||
| Target Milestone: | 1.0 | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/plasma/plasma-workspace/-/commit/bc6140284f661e1c7006f0be73f0e1b826e3dcf0 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
| Attachments: | How to from GUI | ||
|
Description
Frank
2023-12-13 23:23:44 UTC
This API doesn't seem implemented yet. A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3681 As a work around, just do `panel.setConfig("panelLengthMode", 1)` for setting fit.
(In reply to fanzhuyifan from comment #3) > As a work around, just do `panel.setConfig("panelLengthMode", 1)` for > setting fit. Thanks for the suggestion. I'm missing something. Here's one of the 5 or 6 versions I tried following re-reading this documentation https://develop.kde.org/docs/plasma/scripting/api/#applets-containments-and-widgets var plasma = getApiVersion(1) ----- // Create bottom panel (Dock) // const dock = new Panel // Basic Dock Geometry dock.alignment = "center" dock.height = Math.round(gridUnit * 2.8); dock.hiding = "windowscover" dock.location = "bottom" //dock.maximumLenth = 1000 //dock.minimumLength = 250 // Icons-Only Task Manager var tasks = dock.addWidget("org.kde.plasma.icontasks") tasks.currentConfigGroup = ["General"] tasks.writeConfig("fill", false) tasks.writeConfig("iconSpacing", 2) tasks.writeConfig("launchers", "applications:garuda-welcome.desktop,applications:org.kde.konsole.desktop,preferred://browser,preferred://filemanager,applications:org.kde.plasma-systemmonitor.desktop,applications:snapper-tools.desktop,applications:systemsettings.desktop,applications:octopi.desktop") tasks.writeConfig("maxStripes", 1) tasks.writeConfig("showOnlyCurrentDesktop", false) tasks.writeConfig("showOnlyCurrentScreen", false) const panel = ConfigFile('plasmashellrc') panel.group = 'PlasmaViews' panel.setConfig("panelLenghtMode", 1) // End of Dock creation // ----- Nothing is written in plasmashellrc. However if I use instead panel.writeEntry("panelLenghtMode", 1), I do get the following section written in plasmashellrc: [PlasmaViews] panelLenghtMode=1 It's alone in its own section, not associated to a Panel. (In reply to fanzhuyifan from comment #3) > As a work around, just do `panel.setConfig("panelLengthMode", 1)` for > setting fit. (In reply to Frank from comment #4) > (In reply to fanzhuyifan from comment #3) > > As a work around, just do `panel.setConfig("panelLengthMode", 1)` for > > setting fit. > > Thanks for the suggestion. > I'm missing something. Here's one of the 5 or 6 versions I tried following > re-reading this documentation > https://develop.kde.org/docs/plasma/scripting/api/#applets-containments-and- > widgets > > var plasma = getApiVersion(1) > > ----- > // Create bottom panel (Dock) // > > const dock = new Panel > > // Basic Dock Geometry > dock.alignment = "center" > dock.height = Math.round(gridUnit * 2.8); > dock.hiding = "windowscover" > dock.location = "bottom" > //dock.maximumLenth = 1000 > //dock.minimumLength = 250 > > // Icons-Only Task Manager > var tasks = dock.addWidget("org.kde.plasma.icontasks") > tasks.currentConfigGroup = ["General"] > tasks.writeConfig("fill", false) > tasks.writeConfig("iconSpacing", 2) > tasks.writeConfig("launchers", > "applications:garuda-welcome.desktop,applications:org.kde.konsole.desktop, > preferred://browser,preferred://filemanager,applications:org.kde.plasma- > systemmonitor.desktop,applications:snapper-tools.desktop,applications: > systemsettings.desktop,applications:octopi.desktop") > tasks.writeConfig("maxStripes", 1) > tasks.writeConfig("showOnlyCurrentDesktop", false) > tasks.writeConfig("showOnlyCurrentScreen", false) > > const panel = ConfigFile('plasmashellrc') > panel.group = 'PlasmaViews' > panel.setConfig("panelLenghtMode", 1) > > // End of Dock creation // > ----- > > Nothing is written in plasmashellrc. > However if I use instead panel.writeEntry("panelLenghtMode", 1), I do get > the following section written in plasmashellrc: > > [PlasmaViews] > panelLenghtMode=1 > > It's alone in its own section, not associated to a Panel. Sorry I meant `writeConfig`, not `setConfig`. Also for support please use the KDE forums or the matrix channels. The bugzilla is only for reporting bugs. (In reply to fanzhuyifan from comment #5) > Sorry I meant `writeConfig`, not `setConfig`. Tried it part of my tests with same result, therefore plz read below: > Also for support please use the KDE forums or the matrix channels. The bugzilla is only for reporting bugs. That's true, sorry about that. This is the correct Forum? https://discuss.kde.org/ Git commit bc6140284f661e1c7006f0be73f0e1b826e3dcf0 by Yifan Zhu. Committed on 16/12/2023 at 01:54. Pushed by fanzhuyifan into branch 'master'. Implement panel lengthMode scripting api M +39 -0 shell/scripting/panel.cpp M +4 -0 shell/scripting/panel.h M +1 -0 shell/scripting/scriptengine_v1.cpp https://invent.kde.org/plasma/plasma-workspace/-/commit/bc6140284f661e1c7006f0be73f0e1b826e3dcf0 Tested and working. Thank you so much! This saves our Theming so it can be automatically applied correctly. |