Customizing the right-click menu on the desktop

Updated

You can 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, follow these steps:

  1. Log into the standard GNOME session, either Wayland or X11.

  2. Install the gnome-shell-extension-custom-menu package:

    # dnf install gnome-shell-extension-custom-menu
    
  3. Restart your your desktop session.

  4. Enable the custom-menu-panel GNOME Shell extension.

    In RHEL 9, you can use the following command:

    $ gnome-extensions enable custom-menu-panel@AndreaBenini
    
  5. In the ~/.entries.json file, specify your custom menu entries as described in Content from github.com is not included.Gnome Custom Menu Panel.

    For example:

    {
      "entries": [
        {
          "type": "launcher",
          "title": "Desktop Windows",
          "command": "/usr/bin/xfreerdp +clipboard /v:192.168.0.x /d:DOMAIN /u:USER /p:'PASSWORD' /monitors:1 /f /kbd:0x00020409"
        },
        {
          "type": "toggler",
          "title": "Use System Audio",
          "command_on":  "$HOME/bin/audio.switch speaker",
          "command_off": "$HOME/bin/audio.switch headset",
          "detector":    "$HOME/bin/audio.switch status|grep speaker >/dev/null && echo yes"
        },
        {
          "type": "separator"
        },
        {
            "type": "submenu",
            "title": "Examples",
            "entries": [
                {
                  "type": "launcher",
                  "title": "Desktop Windows",
                  "command": "/usr/bin/xfreerdp +clipboard /v:192.168.0.x /d:DOMAIN /u:USER /p:'PASSWORD' /monitors:1 /f /kbd:0x00020409"
                },
                {
                  "type": "launcher",
                  "title": "RDP Desktop (Generic)",
                  "command": "$HOME/bin/rdp.generic"
                },
                {
                  "type": "launcher",
                  "title": "Apple Keyboard Function Keys fix",
                  "command": "$HOME/bin/keyboard.mac.functionkeys.sh"
                }
            ]
        },
        {
          "type": "launcher",
          "title": "Stream CAM ",
          "command": "/usr/bin/ffplay -x 640 -y 360 rtsp://192.168.0.x:5555/MyCamUnicast"
        },
        {
          "type": "launcher",
          "title": "Edit Menu",
          "command": "/usr/bin/gedit $HOME/.entries.json"
        }
      ]
    }
    
  6. Restart your desktop session.

  7. Right-click on the desktop. Your custom menu opens.

SBR
Category
Tags
Article Type