diff options
Diffstat (limited to 'home/bin/open-project')
-rwxr-xr-x | home/bin/open-project | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/home/bin/open-project b/home/bin/open-project new file mode 100755 index 0000000..bb98946 --- /dev/null +++ b/home/bin/open-project @@ -0,0 +1,25 @@ +#!/bin/bash + +kind="$1" +root="$HOME/src/driver" +projects=$(find "$root" -mindepth 1 -maxdepth 1 -type d -printf "%f\n" | sort) +project=$(echo "$projects" | dmenu -p "Open project:") +[ "$?" -eq 0 ] || exit 1 +dir=$(realpath "$root/$project") + +# Rename workspace +i3-msg rename workspace to \ + "$(i3-msg -t get_workspaces | jq '.[] | select(.focused==true).num'):$project" > /dev/null + +case "$kind" in + intellij|"") + idea "$dir" & + sakura -d "$dir" & + sakura -d "$dir" & + ;; + *) + echo "unknown project kind $kind" + exit 1 +esac + +#i3-msg "append_layout ~/layout.json; exec emacsclient --alternate-editor=\"\" --create-frame \"$dir\"; exec gnome-terminal --working-directory=\"$dir\" -x sh -c sbt; exec gnome-terminal --working-directory=\"$dir\"" |