aboutsummaryrefslogtreecommitdiff
path: root/scripts/sessions
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2021-01-11 21:52:49 +0530
committerAkshay Nair <phenax5@gmail.com>2021-01-11 21:52:49 +0530
commit0a4dc975e0a02bda8bebbf14dd9cc516b2819fcc (patch)
tree26e087bc89c9a6b2d567dd59acf885393470d35f /scripts/sessions
parent9c6ca8f41864fc1e0bf367dd4324e38d22aece98 (diff)
downloadnixos-config-0a4dc975e0a02bda8bebbf14dd9cc516b2819fcc.tar.gz
nixos-config-0a4dc975e0a02bda8bebbf14dd9cc516b2819fcc.zip
Updates scripts
Diffstat (limited to 'scripts/sessions')
-rwxr-xr-xscripts/sessions/project.sh15
1 files changed, 12 insertions, 3 deletions
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;