Skip to content

Commit

Permalink
Add new menu launcher to the initial panel layout too
Browse files Browse the repository at this point in the history
The layout update script is running too early on the first KDE startup,
and default widgets are not there yet. This ends up in menu launcher
remaining on the right, instead of the left.

QubesOS/qubes-issues#8159
  • Loading branch information
marmarek committed Aug 3, 2023
1 parent 89e3efd commit 6426f46
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ install:
install -D -m 0644 qubes-generate-color-palette.desktop $(DESTDIR)/etc/xdg/autostart/qubes-generate-color-palette.desktop
install -D -m 0644 11-qubes.js $(DESTDIR)/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/11-qubes.js
install -D -m 0644 qubes-systray.js $(DESTDIR)/usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/qubes-systray.js
install -D -m 0644 kde-panel-layout.patch $(DESTDIR)/usr/share/qubes/kde-panel-layout.patch

install -D -m 0644 applications/kde4/nepomukbackup.desktop $(DESTDIR)/usr/share/kde-settings/kde-profile/default/share/applications/kde4/nepomukbackup.desktop
install -D -m 0644 applications/kde4/nepomukcontroller.desktop $(DESTDIR)/usr/share/kde-settings/kde-profile/default/share/applications/kde4/nepomukcontroller.desktop
Expand Down
17 changes: 17 additions & 0 deletions kde-panel-layout.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- /usr/share/plasma/layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js.orig 2023-08-03 01:11:03.210000000 +0200
+++ /usr/share/plasma/layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js 2023-08-03 01:11:33.814000000 +0200
@@ -21,9 +21,11 @@
}
}

-var kickoff = panel.addWidget("org.kde.plasma.kickoff")
-kickoff.currentConfigGroup = ["Shortcuts"]
-kickoff.writeConfig("global", "Alt+F1")
+var qubesMenu = panel.addWidget('org.kde.plasma.quicklaunch')
+qubesMenu.currentConfigGroup = ['General']
+qubesMenu.writeConfig('launcherUrls', ['file:///usr/share/applications/open-qubes-app-menu.desktop'])
+qubesMenu.currentConfigGroup = ["Shortcuts"]
+qubesMenu.writeConfig("global", "Alt+F1")

//panel.addWidget("org.kde.plasma.showActivityManager")
panel.addWidget("org.kde.plasma.pager")
8 changes: 8 additions & 0 deletions kde-settings-qubes.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Qubes colorful frames for Breeze plasma theme.
%{_sysconfdir}/skel/.kde/share/config/kickoffrc
%{_sysconfdir}/skel/.kde/share/config/kscreensaverrc
%{_sysconfdir}/skel/.config/plasma-org.kde.plasma.desktop-appletsrc
%{_datadir}/qubes/kde-panel-layout.patch
%{_datadir}/plasma/look-and-feel/org.fedoraproject.fedora.desktop/contents/plasmoidsetupscripts/org.kde.plasma.kicker.js.qubes
%{_datadir}/plasma/look-and-feel/org.fedoraproject.fedora.desktop/contents/plasmoidsetupscripts/org.kde.plasma.kickerdash.js.qubes
%{_datadir}/plasma/look-and-feel/org.fedoraproject.fedora.desktop/contents/plasmoidsetupscripts/org.kde.plasma.kickoff.js.qubes
Expand Down Expand Up @@ -117,6 +118,13 @@ sed -i 's|XDG_MENU_PREFIX="kf5-"|XDG_MENU_PREFIX="kf5-qubes-"|g' /etc/xdg/plasma
%settings_replace /usr/share/plasma/look-and-feel/org.fedoraproject.fedora.desktop/contents/plasmoidsetupscripts/org.kde.plasma.kickerdash.js.qubes
%settings_replace /usr/share/plasma/look-and-feel/org.fedoraproject.fedora.desktop/contents/plasmoidsetupscripts/org.kde.plasma.kickoff.js.qubes

%triggerin -- plasma-desktop
default_layout="/usr/share/plasma/layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js"
if ! grep -q qubesMenu "$default_layout"; then
cp -a "$default_layout" "$default_layout.qubes-orig"
patch "$default_layout" < /usr/share/qubes/kde-panel-layout.patch
fi

%post
# it used to be replaced, but now is back to default content - restore it on
# update
Expand Down

0 comments on commit 6426f46

Please sign in to comment.