123456789101112131415161718192021222324252627282930313233343536373839 |
- set fish_greeting
- function posix_source
- for line in (cat $argv)
- set ass (echo $line | sed 's/export //')
- set arr (string split -m1 = $ass)
- set v (echo $arr[2] | sed -E 's/\$\((.*)\)/\1/')
- if [ $v != $arr[2] ]
- set -gx $arr[1] ($v)
- else if [ (echo $arr[1] | cut -c1) != '#' ]
- set -gx $arr[1] (eval "echo $arr[2]")
- end
- end
- end
- for name in (cat ~/.config/sh/functions | grep '()' | grep -v '#' | cut -d '(' -f 1)
- function $name
- bash -c ". ~/.config/sh/functions && $_ $argv"
- end
- end
- if [ (tty) = "/dev/tty1" ] && which sway >/dev/null 2>&1
- exec sway
- end
- . ~/.config/sh/aliases
- if [ -f ~/.config/sh/variables.(hostname) ]
- posix_source ~/.config/sh/variables.(hostname)
- end
- posix_source ~/.config/sh/variables
- if [ -f /tmp/ssh-agent.fish ]
- . /tmp/ssh-agent.fish >/dev/null
- end
- # todo function fish_prompt
- # echo ''
- # end
|