aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/home/.config/sh/shinit
blob: 404722e7a8b563843a00f4486df888d31e1f2469 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env sh
# If not running interactively, don't do anything
case $- in
    *i*) stty -ixon
        ;;
      *) return
          ;;
esac

# shellcheck source=/dev/null
[ -r  ~/.config/sh/envrc ] && . ~/.config/sh/envrc

gpg-connect-agent updatestartuptty /bye >/dev/null

_fzf_compgen_path() {
  eval "$FZF_DEFAULT_COMMAND" "$1"
}

_fzf_compgen_dir() {
  eval "$FZF_DIRS_COMMAND" "$1"
}

safesource "$XDG_CONFIG_HOME"/sh/aliases

# numlock
tput smkx

PS1="[\$?]\$ "
export PS1

if [ "$TERM" = "linux" ]; then
    _SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'
    mkfifo mypipe
    sed -n "$_SEDCMD" "$HOME"/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}' > mypipe &
    while IFS= read -r i
    do
        printf "%s" "$i"
    done < mypipe
    rm mypipe
    clear
fi