RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2033572 - [RFE] Provide options to edit and add to the right-click menu
Summary: [RFE] Provide options to edit and add to the right-click menu
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: gnome-shell-extensions
Version: 8.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Florian Müllner
QA Contact: Michael Boisvert
Marek Suchánek
URL:
Whiteboard:
Depends On:
Blocks: 2160553
TreeView+ depends on / blocked
 
Reported: 2021-12-17 09:39 UTC by Anthony Russell
Modified: 2023-08-23 14:25 UTC (History)
13 users (show)

Fixed In Version: gnome-shell-extensions-3.32.1-32.el8
Doc Type: Enhancement
Doc Text:
.Custom right-click menu on the desktop You can now customize the menu that opens when you right-click the desktop background. You can create custom entries in the menu that run arbitrary commands. To customize the menu, see link:https://access.redhat.com/articles/7003141[Customizing the right-click menu on the desktop].
Clone Of:
: 2160553 (view as bug list)
Environment:
Last Closed: 2023-05-16 08:37:43 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-106077 0 None None None 2021-12-17 09:40:49 UTC
Red Hat Product Errata RHBA-2023:2840 0 None None None 2023-05-16 08:37:54 UTC

Comment 20 Florian Müllner 2022-06-27 13:36:37 UTC
I was asked to provide instructions for using the custom-menu-panel extension (https://extensions.gnome.org/extension/4295/custom-menu-panel/) in RHEL8. Here are my findings:

The oldest version the extension claims to support is GNOME 40 (RHEL9), but in reality it works as expected on older versions, including RHEL8.

By default, gnome-shell does accept extensions that don't explicitly support the GNOME version in use, so the extension should work out of the box.

To make sure that is the case, check that

  $ gsettings get org.gnome.shell disable-extension-version-validation

returns "true".

If it doesn't, the value can be changed with the following command:

  $ gsettings set org.gnome.shell disable-extension-version-validation true

Alternatively, edit the extension's metadata.json file to include "3.32" in the "shell-version" array.


The extension reads its menu definition from a ".entries.json" file in the user's $HOME.

The root object should have an "entries" property that contains an array of objects that describe menu items.

Each menu item has a "type" property that describes the item type:

 - launcher
   A regular, stateless item that runs a command when activated.

   It is defined by the following properties:
   - title - the menu item label
   - command - a shell command line to run if the item is activated

 - toggler
   A menu item with an on/off state (represented by a switch)

   It is defined by the following properties:
   - title - the menu item label
   - command_on - a shell command line to switch the item on
   - command_off - a shell command line to switch the item off
   - detector - a shell command for determining the initial state

   According to the documentation, the "detector" command should return
   0 for "on" and non-0 for "off". However in reality
     - the command isn't run at all (unless manually patching the extension)
     - the state actually depends on whether the command returns any output

 - submenu
   An expandable item that reveals additional menu items when activated

   It is defined by the following properties:
   - title - the menu item label
   - entries - an array of menu items, just like the top-level property

   The format allows for nested submenus, but the implementation does not.

 - separator
   A non-interactive item to visually separate menu sections from each other.


The following is an example configuration that contains at least one item of each type:

```
{
    "entries": [
        {
            "type": "submenu",
            "title": "Clock",
            "entries": [
                {
                    "type": "toggler",
                    "title": "Show Seconds",
                    "command_on": "gsettings set org.gnome.desktop.interface clock-show-seconds true",
                    "command_off": "gsettings set org.gnome.desktop.interface clock-show-seconds false",
                    "detector": "gsettings get org.gnome.desktop.interface clock-show-seconds | grep true"
                },
                {
                    "type": "toggler",
                    "title": "Show Weekday",
                    "command_on": "gsettings set org.gnome.desktop.interface clock-show-weekday true",
                    "command_off": "gsettings set org.gnome.desktop.interface clock-show-weekday false",
                    "detector": "gsettings get org.gnome.desktop.interface clock-show-weekday | grep true"
                }
            ]
        },
        {
            "type": "separator"
        },
        {
            "type": "launcher",
            "title": "Edit menu",
            "command": "gedit $HOME/.entries.json"
        }
    ]
}
```

Comment 22 Florian Müllner 2022-06-27 18:13:00 UTC
I've uploaded a modified version of the extension that
 - runs the 'detector' script to fetch the initial state
 - replaces the background menu instead of adding a custom indicator to the top bar

It is available at https://fedorapeople.org/~fmuellner/custom-menu-panel@AndreaBenini.shell-extension.zip.

Note that the extension only works with gnome-shell's own background menu. That is, it only works in the regular (non-classic) session with the desktop-icons extension disabled.

Comment 36 Anthony Russell 2022-10-06 07:13:43 UTC
Thank you very much.
I have passed it on to the customer.

Comment 44 Michael Boisvert 2023-01-19 18:15:44 UTC
Instructions for testing/docs:

1. In a non-classic session using either Wayland or X11, install and enable gnome-shell-extension-custom-menu-3.32.1-33.el8.noarch.rpm
2. Customize a file called .entries.json at $HOME/ as outlined here: https://github.com/andreabenini/gnome-plugin.custom-menu-panel/blob/main/README.md
3. Restart your session.
4. Right-click on the desktop to see your custom menu.

Comment 53 errata-xmlrpc 2023-05-16 08:37:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (gnome-shell-extensions bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2840


Note You need to log in before you can comment on or make changes to this bug.