From 3140020d3bc3111ceedddde1b509548b67f8c576 Mon Sep 17 00:00:00 2001 From: Adrien Abraham Date: Tue, 5 Mar 2024 10:01:35 +0100 Subject: [PATCH] bang: idk, a fix --- bang.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bang.py b/bang.py index 3945c9e..3b5513a 100755 --- a/bang.py +++ b/bang.py @@ -153,15 +153,18 @@ def main(): exit("Bad Rofi output.") handle = parts[0] + query = None if handle not in handles and (default_handle := args.default): handle = default_handle if len(parts) == 1: - queries.append(parts[0]) + query = parts[0] else: - queries.append(output) + query = output + elif len(parts) == 2: + query = parts[1] - if len(parts) == 2: - queries.append(parts[1]) + if query is not None: + queries.append(query) # If no queries were obtained during options parsing, # show Rofi now to get a single query.