Skip to content

Commit

Permalink
Add -m / --open-menu option: force open the Variety menu on systems w…
Browse files Browse the repository at this point in the history
…here 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.
  • Loading branch information
jlu5 committed Oct 4, 2018
1 parent 59800ea commit 4a3e126
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions variety/VarietyWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4a3e126

Please sign in to comment.