From 6426f460419405eec44847e117af6f591190e92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 2 Aug 2023 15:30:46 +0200 Subject: [PATCH] Add new menu launcher to the initial panel layout too 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 --- Makefile | 1 + kde-panel-layout.patch | 17 +++++++++++++++++ kde-settings-qubes.spec.in | 8 ++++++++ 3 files changed, 26 insertions(+) create mode 100644 kde-panel-layout.patch diff --git a/Makefile b/Makefile index 13908e1..e2c416f 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/kde-panel-layout.patch b/kde-panel-layout.patch new file mode 100644 index 0000000..6513e31 --- /dev/null +++ b/kde-panel-layout.patch @@ -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") diff --git a/kde-settings-qubes.spec.in b/kde-settings-qubes.spec.in index de4d75b..4bade8a 100644 --- a/kde-settings-qubes.spec.in +++ b/kde-settings-qubes.spec.in @@ -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 @@ -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