Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Tray Applet Option To Disable Menus #418

Open
0pLuS0 opened this issue May 2, 2022 · 6 comments
Open

Request: Tray Applet Option To Disable Menus #418

0pLuS0 opened this issue May 2, 2022 · 6 comments
Labels
feature request New functionality that is wished for tray applet Specific to the tray applet application

Comments

@0pLuS0
Copy link

0pLuS0 commented May 2, 2022

Hello,

First, let me say, a big thanks for this app, really nice!

I hope in the future you can please create a tray applet preferences/option to disable all the menu settings that appear, and only display Open Controller and Quit when you right click the applet.

This is what I see now for my mouse and keyboard.

applet-menu

And this is how I'd like to be able to make it with a option in the menu setting to disable/turn off all the other settings.

modified

Thank you very much for your time and consideration, greatly appreciated!

Keep up the great work, I love this app! 👍

@lah7 lah7 added feature request New functionality that is wished for tray applet Specific to the tray applet application labels May 2, 2022
@lah7
Copy link
Member

lah7 commented May 2, 2022

Ahh, this happens because you've got a single Razer device with multiple "zones". so everything appears in the main menu. Typically they'd be submenus for each device that would definitely help keep it short:

image

Thank you for your support! I have some work to do around the tray applet, and expanding the customisation options to show/hide certain options is on my long list. I just expanded this note to include customising the device presentation as well for these cases.

The tray applet is supposed to be a separate "thing" intended to change options without needing the fully fledged Controller. I will try and see if we can left click the tray icon to toggle show/hide the Controller, if that's the kind of behaviour you'd expect from a tray applet, which would make it similar to other programs.

@0pLuS0
Copy link
Author

0pLuS0 commented May 2, 2022

Hi,

Make it anyway you like, but if possible, it would be nice to at least have Compile Options, so at compile time, end-users can disable/enable menu features they don't want to use.

THANKS

@lah7
Copy link
Member

lah7 commented May 3, 2022

Compile options would be unnecessary because it's a Python application, an interpreted script if you like. You can simply comment out / delete the code so it isn't displayed:

/usr/bin/polychromatic-tray-applet
        # Order devices A-Z for consistency
        sorted_devices = sorted(devices, key=lambda device: device.name)

-        for device in sorted_devices:
-            indicator.add_menu_item(menu, self.build_device_submenu(device))
- 
        for device in self.middleman.get_unsupported_devices():

Such change will persist until the next time the package is updated.

@0pLuS0
Copy link
Author

0pLuS0 commented May 4, 2022

I commented out these two;

for device in sorted_devices:
indicator.add_menu_item(menu, self.build_device_submenu(device))

But I still have the Apply to All section.

THANKS

apply_to_all

@lah7
Copy link
Member

lah7 commented May 5, 2022

Likewise, you can alter the logic around line 368 to prevent that menu from appearing too:

        # When multiple devices are present, show 'apply to all' actions
-        if len(devices) > 1:
+        if len(devices) > 99:
            bulk_menu, bulk_menu_item = indicator.create_submenu(_("Apply to All"), True, self._get_icon("devices", "all"))

@0pLuS0
Copy link
Author

0pLuS0 commented May 8, 2022

Thanks a lot for helping me/showing me this.

I made a patch for this, in case anyone else would like to do this at compile time.

Here's a screen shot showing the new menu. 👍

modified_tray_applet

Here's the patch; (rename it from menu-tray-applet.txt to menu-tray-applet.patch)

menu-tray-applet.txt

Silly that GitHub won't let you upload a .patch extension... LOL 😮‍💨

THANKS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New functionality that is wished for tray applet Specific to the tray applet application
Projects
None yet
Development

No branches or pull requests

2 participants