aboutsummaryrefslogtreecommitdiff
path: root/scripts/sessions/project.sh
blob: 4250f67053c9ae0d163c3a31421e9ee64bff7d92 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash

dir="$1";

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; zsh"; }

editor &
sleep 0.1;
term &
term &

disown;