summaryrefslogtreecommitdiff
path: root/.local/bin/kn
blob: da668ba0dd08f23ee6cfcd600210af85b6439454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc"
context="${XDG_STATE_HOME:-$HOME/.local/state}/context"
if ! [ -d "${context}" ]
then notify-send "kn" "${context} is not a dir!"; exit 1
fi

export PATH="${context}/bin:${PATH}"

if [ -f "${context}/name" ]
then exec kak-shell "$(cat "${context}/name")"
else notify-send "kn" "Context has no name!"; exit 1
fi