This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Plasma script to add shortcuts to quicklaunch widget

Tags: None
(comma "," separated)
User avatar
cleary
Registered Member
Posts
32
Karma
0
I'm customising the KDE desktop environment for our corporate desktop (based on Kubuntu 16.04), and I've found what I hope is not a bug -
In short, all I want to do is add a quicklaunch widget to the panel, then populate it with some application shortcuts via the plasma scripting interface.

I have code that I believe should work:

Code: Select all
//new panel for testing purposes
var panel = new Panel
var quicklaunch = panel.addWidget("org.kde.plasma.quicklaunch"); 
var qlurls = ["file:///usr/share/applications/firefox.desktop",
          "file:///usr/share/applications/org.kde.dolphin.desktop"
         ];
quicklaunch.currentConfigGroup = ["General"];
quicklaunch.writeConfig("launcherUrls", qlurls);
//confirm it's written correctly
print(quicklaunch.readConfig("launcherUrls"));
//flailing for ideas now?!?
quicklaunch.reloadConfig()


You can test it by starting the scripting console in a KDE session, and copying and pasting:
Code: Select all
qdbus org.kde.plasmashell /PlasmaShell showInteractiveConsole

This correctly adds a new panel, a quicklaunch widget, and applies all the same settings that were applied when I interrogated a manually created quicklaunch, but - it doesn't display any of the application shortcuts, just a rocket icon.

What am I doing wrong?
User avatar
cleary
Registered Member
Posts
32
Karma
0
Confirmed my code works on kde neon, it's a bug in the (k)ubuntu plasma packages.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]