Skip to content

Commit

Permalink
Move menu launcher to the left on the update too
Browse files Browse the repository at this point in the history
Apparently there is no other API method than settings AppletOrder
directly. This may require restarting panel after applying the change -
it seems like changing it on the live panel doesn't work.

Furthermore, on initial start the AppletOrder may be not set yet, in
that case get initial value from widgetIds property.

QubesOS/qubes-issues#8159
  • Loading branch information
marmarek committed Jul 16, 2023
1 parent d08926f commit d7555a7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions 10-qubes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,32 @@ var panels = panels()
for (var i in panelIds) {
var panel = panelById(panelIds[i])
var widgetIds = panel.widgetIds
var menuLauncherId = -1
for (id in widgetIds) {
var widget = panel.widgetById(widgetIds[id])
if (widget.type == 'org.kde.plasma.kickoff') {
var qubesMenu = panel.addWidget('org.kde.plasma.quicklaunch')
qubesMenu.index = widget.index
qubesMenu.currentConfigGroup = ['General']
qubesMenu.writeConfig('launcherUrls', ['file:///usr/share/applications/open-qubes-app-menu.desktop'])
menuLauncherId = qubesMenu.id
widget.remove()
} else if (widget.type == 'org.kde.plasma.quicklaunch') {
// move existing one too, to fix after earlier broken version
menuLauncherId = widget.id
}
}
// move the menu launcher as the first applet
if (menuLauncherId != -1) {
panel.currentConfigGroup = ['General']
var order = panel.readConfig("AppletOrder").split(";")
if (!order)
order = panel.widgetIds
// remove from the list (likely its end) and add it at the beginning
order = order.filter(function(x) { return x != menuLauncherId })
order.unshift(menuLauncherId)
panel.writeConfig("AppletOrder", order.join(";"))
}
}

/* wallpaper */
Expand Down

0 comments on commit d7555a7

Please sign in to comment.