nanuqsaurus/modules/desktop/patches/logo-menu-custom-menu.patch

143 lines
6.4 KiB
Diff
Raw Permalink Normal View History

diff -ru logo-menu-patch-orig/extension.js logo-menu-patch-mod/extension.js
--- logo-menu-patch-orig/extension.js 2026-02-03 21:59:13.353339473 +0200
+++ logo-menu-patch-mod/extension.js 2026-02-03 21:59:13.362477131 +0200
@@ -47,13 +47,8 @@
this.setIconSize();
this.add_child(this.icon);
- // Menu
- this._settings.connectObject('changed::hide-softwarecentre', () => this._displayMenuItems(), this);
- this._settings.connectObject('changed::show-power-options', () => this._displayMenuItems(), this);
- this._settings.connectObject('changed::hide-forcequit', () => this._displayMenuItems(), this);
- this._settings.connectObject('changed::show-lockscreen', () => this._displayMenuItems(), this);
- this._settings.connectObject('changed::show-activities-button', () => this._displayMenuItems(), this);
- this._displayMenuItems();
+ // Menu (custom layout)
+ this._displayMenuItems();
// bind middle click option to toggle overview
this.connect('button-press-event', this._buttonPressEvent.bind(this));
@@ -64,51 +59,40 @@
}
_displayMenuItems() {
- const showPowerOptions = this._settings.get_boolean('show-power-options');
- const showForceQuit = !this._settings.get_boolean('hide-forcequit');
- const showLockScreen = this._settings.get_boolean('show-lockscreen');
- const showSoftwareCenter = !this._settings.get_boolean('hide-softwarecentre');
- const showActivitiesButton = this._settings.get_boolean('show-activities-button');
-
- this.menu.removeAll();
-
- this._addItem(new MenuItem(_('About My System'), () => this._aboutThisDistro()));
- // this._addItem(new MenuItem(_('System Settings...'), () => this._systemPreferences()));
- this._addItem(new PopupMenu.PopupSeparatorMenuItem());
-
- if (!showActivitiesButton)
- this._addItem(new MenuItem(_('Activities'), () => this._overviewToggle()));
-
- this._addItem(new MenuItem(_('App Grid'), () => this._showAppGrid()));
- this._addItem(new PopupMenu.PopupSeparatorMenuItem());
-
- if (showSoftwareCenter)
- this._addItem(new MenuItem(_('Software Center'), () => this._openSoftwareCenter()));
-
- this._addItem(new MenuItem(_('System Monitor'), () => this._openSystemMonitor()));
- this._addItem(new MenuItem(_('Terminal'), () => this._openTerminal()));
- this._addItem(new MenuItem(_('Extensions'), () => this._openExtensionsApp()));
-
- if (showForceQuit) {
- this._addItem(new PopupMenu.PopupSeparatorMenuItem());
- this._addItem(new MenuItem(_('Force Quit App'), () => this._forceQuit()));
- }
+ this.menu.removeAll();
+
+ // Custom menu layout
+ this._addItem(new MenuItem(_('About My System'), () => this._aboutThisDistro()));
+ this._addItem(new MenuItem(_('System Settings'), () => this._systemPreferences()));
+
+ this._addItem(new PopupMenu.PopupSeparatorMenuItem());
+ this._addItem(new MenuItem(_('Extensions'), () => this._openExtensionsApp()));
+ this._addItem(new MenuItem(_('System Monitor'), () => this._openSystemMonitor()));
+ this._addItem(new MenuItem(_('Terminal'), () => this._openTerminal()));
- if (showPowerOptions) {
- this._addItem(new PopupMenu.PopupSeparatorMenuItem());
- this._addItem(new MenuItem(_('Sleep'), () => this._sleep()));
- this._addItem(new MenuItem(_('Restart...'), () => this._restart()));
- this._addItem(new MenuItem(_('Shut Down...'), () => this._shutdown()));
- this._addItem(new PopupMenu.PopupSeparatorMenuItem());
-
- if (showLockScreen)
- this._addItem(new MenuItem(_('Lock Screen'), () => this._lockScreen()));
-
- this._addItem(new MenuItem(_('Log Out...'), () => this._logOut()));
- } else if (!showPowerOptions && showLockScreen) {
- this._addItem(new PopupMenu.PopupSeparatorMenuItem());
- this._addItem(new MenuItem(_('Lock Screen'), () => this._lockScreen()));
+ this._addItem(new PopupMenu.PopupSeparatorMenuItem());
+ this._addItem(new MenuItem(_('Containers'), () => this._openContainers()));
+ }
+
+ _openContainers() {
+ // Prefer launching via desktop ID so we don't depend on PATH in the GNOME Shell env.
+ const appSys = Shell.AppSystem.get_default();
+ const app = appSys.lookup_app('com.ranfdev.DistroShelf.desktop');
+ if (app) {
+ try {
+ app.launch(
+ 0,
+ -1,
+ Shell.AppLaunchGpu.APP_PREF
+ );
+ return;
+ } catch (e) {
+ log(e);
+ }
}
+
+ // Fallback: direct command.
+ Util.trySpawnCommandLine('distroshelf');
}
_buttonPressEvent(actor, event) {
diff -ru logo-menu-patch-orig/schemas/org.gnome.shell.extensions.logo-menu.gschema.xml logo-menu-patch-mod/schemas/org.gnome.shell.extensions.logo-menu.gschema.xml
--- logo-menu-patch-orig/schemas/org.gnome.shell.extensions.logo-menu.gschema.xml 2026-02-03 21:59:13.353462172 +0200
+++ logo-menu-patch-mod/schemas/org.gnome.shell.extensions.logo-menu.gschema.xml 2026-02-03 21:59:13.362611548 +0200
@@ -22,7 +22,7 @@
</key>
<key type="s" name="menu-button-extensions-app">
- <default>"org.gnome.Extensions.desktop"</default>
+ <default>"com.mattjakeman.ExtensionManager.desktop"</default>
<summary>Preffered Extensions app</summary>
<description>Change to preffered Extensions app.</description>
</key>
@@ -34,7 +34,7 @@
</key>
<key type="s" name="menu-button-terminal">
- <default>"gnome-terminal"</default>
+ <default>"ptyxis"</default>
<summary>Menu Button Terminal</summary>
<description>Change the Menu Button Terminal.</description>
</key>
@@ -70,7 +70,7 @@
</key>
<key type="b" name="hide-softwarecentre">
- <default>false</default>
+ <default>true</default>
<summary>Toggle Software Centre option visibility</summary>
<description>Toggle Software Centre option visibility.</description>
</key>
@@ -95,7 +95,7 @@
</key>
<key type="s" name="menu-button-system-monitor">
- <default>"gnome-system-monitor"</default>
+ <default>"missioncenter"</default>
<summary>Menu System Monitor</summary>
<description>Change the Menu System Monitor.</description>
</key>