Skip to content

Commit

Permalink
Fix display of Extensions in context menu. Allow to use Resources app…
Browse files Browse the repository at this point in the history
…lication instead of System Monitor.
  • Loading branch information
lufog committed Nov 3, 2024
1 parent 504ede4 commit 72bd58d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
18 changes: 13 additions & 5 deletions appIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -1806,10 +1806,18 @@ export const MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {
cmd: [TERMINALSETTINGS.get_string('exec')]
});

this._appendItem({
title: _('System monitor'),
cmd: ['gnome-system-monitor']
});
if(SETTINGS.get_boolean('secondarymenu-contains-useresources')) {
this._appendItem({
title: _('Resources'),
cmd: ['resources']
});
}
else {
this._appendItem({
title: _('System monitor'),
cmd: ['gnome-system-monitor']
});
}

this._appendItem({
title: _('Files'),
Expand All @@ -1818,7 +1826,7 @@ export const MyShowAppsIconMenu = class extends PopupMenu.PopupMenu {

this._appendItem({
title: _('Extensions'),
cmd: ['gnome-shell-extension-prefs']
cmd: ['gnome-extensions-app']
});

this._appendItem({
Expand Down
6 changes: 6 additions & 0 deletions prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1900,6 +1900,7 @@ const Preferences = class {
// restore default settings
this._settings.set_value('secondarymenu-contains-appmenu', this._settings.get_default_value('secondarymenu-contains-appmenu'));
this._settings.set_value('secondarymenu-contains-showdetails', this._settings.get_default_value('secondarymenu-contains-showdetails'));
this._settings.set_value('secondarymenu-contains-useresources', this._settings.get_default_value('secondarymenu-contains-useresources'));
});

// TODO setting secondarymenu-contains-appmenu is not being used anywhere
Expand All @@ -1912,6 +1913,11 @@ const Preferences = class {
this._builder.get_object('secondarymenu_showdetails_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);

this._settings.bind('secondarymenu-contains-useresources',
this._builder.get_object('secondarymenu_useresources_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);

dialog.show();
dialog.set_default_size(480, 1);
Expand Down
4 changes: 4 additions & 0 deletions schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,10 @@
<default>false</default>
<summary>Display Show Details to open Gnome Software from right click menu</summary>
</key>
<key type="b" name="secondarymenu-contains-useresources">
<default>false</default>
<summary>Use Resources instead of System Monitor from right click menu</summary>
</key>
<key type="s" name="shortcut-text">
<default>"&lt;Super&gt;q"</default>
<summary>Keybinding to show the dock and the number overlay.</summary>
Expand Down
13 changes: 12 additions & 1 deletion ui/BoxSecondaryMenuOptions.ui
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,19 @@
</object>
</child>

<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Use Resources instead of System Monitor</property>
<child>
<object class="GtkSwitch" id="secondarymenu_useresources_switch">
<property name="valign">center</property>
</object>
</child>
</object>
</child>

</object>
</child>
</object>

</interface>
</interface>

0 comments on commit 72bd58d

Please sign in to comment.