From 616296c9bc1bd8bea80470ccf89a38c969147081 Mon Sep 17 00:00:00 2001 From: Julian T Date: Tue, 29 Mar 2022 09:28:55 +0200 Subject: i3 colors and open_rel --- scripts/Scripts/open_rel | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/Scripts/open_rel b/scripts/Scripts/open_rel index 6d68c41..a71df0a 100755 --- a/scripts/Scripts/open_rel +++ b/scripts/Scripts/open_rel @@ -24,7 +24,7 @@ def launch_term(command=None, directory=None): sp.run(run) -def decide_and_run(title: str, do_shell=True): +def decide_and_run(title: str, alt=False): if title.startswith("fish "): launch_term(directory=title[5:]) elif (m := re.search(".*client\d*@\[(\d*)\] - Kakoune", title)): @@ -36,7 +36,7 @@ def decide_and_run(title: str, do_shell=True): if folder is None: folder = shell_file shell_file = None - if do_shell: + if alt: command = "nix-shell" + (f" {shell_file}" if shell_file else "") else: command = None @@ -47,8 +47,8 @@ def decide_and_run(title: str, do_shell=True): if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument("--shell", "-s", action="store_true") + parser.add_argument("--alt", "-a", action="store_true", help="Alternative action") args = parser.parse_args() title = get_window_title() - decide_and_run(title, args.shell) + decide_and_run(title, args.alt) -- cgit v1.2.3