diff options
author | Arnold Sommerfeld <sommerfeld@strisemarx.com> | 2023-05-17 18:44:48 +0100 |
---|---|---|
committer | Arnold Sommerfeld <sommerfeld@strisemarx.com> | 2023-10-18 11:16:43 +0100 |
commit | b487984ecc61c6229cf92550030745c192fd3d0b (patch) | |
tree | 937e598c941fc1172467aeeed8ef51cbfceaca62 /home/.config/sh/shinit | |
download | dotfiles-b487984ecc61c6229cf92550030745c192fd3d0b.tar.gz dotfiles-b487984ecc61c6229cf92550030745c192fd3d0b.tar.bz2 dotfiles-b487984ecc61c6229cf92550030745c192fd3d0b.zip |
first commit
Diffstat (limited to 'home/.config/sh/shinit')
-rw-r--r-- | home/.config/sh/shinit | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/home/.config/sh/shinit b/home/.config/sh/shinit new file mode 100644 index 0000000..404722e --- /dev/null +++ b/home/.config/sh/shinit @@ -0,0 +1,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 |