From 090f8d1c6dee21e640a78362119e65828e738f7b Mon Sep 17 00:00:00 2001 From: trigg Date: Mon, 18 Oct 2021 20:05:54 +0100 Subject: [PATCH] - Isn't it cool when someone finishes what they started? --- discover_overlay/discover_overlay.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/discover_overlay/discover_overlay.py b/discover_overlay/discover_overlay.py index 9a6f093..c2b1bd5 100755 --- a/discover_overlay/discover_overlay.py +++ b/discover_overlay/discover_overlay.py @@ -38,7 +38,7 @@ class Discover: self.tray = None self.steamos = False - self.do_args(args) + self.do_args(args, True) self.create_gui() @@ -59,19 +59,28 @@ class Discover: Gtk.main() - def do_args(self, data): + def do_args(self, data, normal_close): """ Read in arg list from command or RPC and act accordingly """ if "--help" in data: - pass - elif "--about" in data: - pass - elif "--configure" in data: + print("Usage: discover-overlay [OPTIONS]... ") + print("Show an X11 or wlroots overlay with information") + print("from Discord client") + print("") + print(" -c, --configure Open configuration window") + print(" -s, --steamos Add X11 hint to overlay in gamescope") + print(" --close Close currently running instance") + print(" -v, --debug Verbose output for aid in debugging") + print("") + print("For gamescope compatibility ensure ENV has 'GDK_BACKEND=x11'") + if normal_close: + sys.exit(0) + if "--configure" in data or "-c" in data: self.show_settings() - elif "--close" in data: + if "--close" in data: sys.exit(0) - elif "--steamos" in data: + if "--steamos" in data: self.steamos=True if "--debug" in data: logging.getLogger().setLevel(0) @@ -83,7 +92,7 @@ class Discover: with open(self.rpc_file, "r") as tfile: data = tfile.readlines() if len(data) >= 1: - self.do_args(data[0]) + self.do_args(data[0], False) def create_gui(self): """