diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/Scripts/open_rel | 8 |
1 files changed, 4 insertions, 4 deletions
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) |