From 0a4dc975e0a02bda8bebbf14dd9cc516b2819fcc Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Mon, 11 Jan 2021 21:52:49 +0530 Subject: Updates scripts --- scripts/sessions/project.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'scripts/sessions') diff --git a/scripts/sessions/project.sh b/scripts/sessions/project.sh index ffe9cc9..f642a9e 100755 --- a/scripts/sessions/project.sh +++ b/scripts/sessions/project.sh @@ -2,10 +2,19 @@ dir="$1"; -sensible-terminal -d "$dir" -e sensible-editor . & +editor="sensible-editor"; + +if [[ -f "$dir/default.nix" ]]; then + editor="nix-shell --run '$editor'"; +fi; + +term() { sensible-terminal -d "$dir" "$@"; } +editor() { term -e sh -c "echo 'Loading...'; $editor"; } + +editor & sleep 0.1; -sensible-terminal -d "$dir" & -sensible-terminal -d "$dir" & +term & +term & disown; -- cgit v1.3.1