From 4a3e1264d55e59b6de8976b26d080165fea74e87 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 3 Oct 2018 19:13:54 -0700 Subject: [PATCH] Add -m / --open-menu option: force open the Variety menu on systems where the indicator is unavailable An experimental workaround for #12. It looks like rootless menus work consistently on Xorg (appearing where the mouse clicks), but not on Wayland. --- variety/VarietyWindow.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/variety/VarietyWindow.py b/variety/VarietyWindow.py index 2f80e3f0..34cfa4f0 100644 --- a/variety/VarietyWindow.py +++ b/variety/VarietyWindow.py @@ -1986,6 +1986,10 @@ def parse_options(arguments, report_errors=True): "-v", "--verbose", action="count", dest="verbose", default=0, help=_("Show logging messages (-vv to -vvvvv will profile various parts of Variety with increasing detail")) + parser.add_option( + "-m", "--open-menu", action="store_true", dest="open_menu", + help=_("Forces opening the Variety menu")) + parser.add_option( "-q", "--quit", action="store_true", dest="quit", help=_("Make the running instance quit")) @@ -2151,6 +2155,8 @@ def _process_command(): self.show_hide_wallpaper_selector() if options.preferences: self.on_mnu_preferences_activate() + if options.open_menu: + self.ind.menu.popup(None, None, None, self.ind.status_icon, 0, Gtk.get_current_event_time()) if options.quotes_fast_forward: self.next_quote(bypass_history=True)