diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-11-16 03:20:56 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-11-16 03:20:56 -0500 |
commit | 790064c91f1291b55ac3a6627c41c8181e4b6b42 (patch) | |
tree | 8fc98a0e9326613def8174eda79189ff02428d73 | |
parent | 654d626159e1fab6bb6cd85c4ad593ea260c3195 (diff) | |
download | conf-790064c91f1291b55ac3a6627c41c8181e4b6b42.tar.gz conf-790064c91f1291b55ac3a6627c41c8181e4b6b42.zip |
shellcheck
-rw-r--r-- | bash_profile | 3 | ||||
-rw-r--r-- | bashrc | 32 | ||||
-rw-r--r-- | config/sh/aliases | 4 | ||||
-rw-r--r-- | config/sh/env | 6 | ||||
-rw-r--r-- | config/sh/functions | 4 | ||||
-rw-r--r-- | profile | 3 | ||||
-rw-r--r-- | xinitrc | 1 | ||||
-rw-r--r-- | xprofile | 2 |
8 files changed, 33 insertions, 22 deletions
diff --git a/bash_profile b/bash_profile index 111f2ef..b200eb1 100644 --- a/bash_profile +++ b/bash_profile @@ -1,3 +1,4 @@ -. $HOME/.bashrc +# shellcheck source=bashrc +. "$HOME"/.bashrc # vim:ft=sh: @@ -1,36 +1,41 @@ # language environments {{{ -test -f $HOME/perl5/perlbrew/etc/bashrc && source $HOME/perl5/perlbrew/etc/bashrc -test -f $HOME/python/bin/activate && source $HOME/python/bin/activate +# shellcheck disable=1090 +test -f "$HOME"/perl5/perlbrew/etc/bashrc && source "$HOME"/perl5/perlbrew/etc/bashrc +test -f "$HOME"/python/bin/activate && source "$HOME"/python/bin/activate type rbenv > /dev/null 2>&1 && eval "$(rbenv init -)" -test -d $HOME/.cargo/bin && export PATH="$HOME/.cargo/bin:$PATH" +test -d "$HOME"/.cargo/bin && export PATH="$HOME/.cargo/bin:$PATH" # }}} # environment {{{ [ -d /usr/share/git/diff-highlight ] && export PATH="/usr/share/git/diff-highlight:${PATH}" [ -d /usr/local/share/git-core/contrib/diff-highlight ] && export PATH="/usr/local/share/git-core/contrib/diff-highlight:${PATH}" -export PATH="${HOME}/.bin/local:${HOME}/.bin/$(hostname):${HOME}/.bin:/usr/lib/ccache/bin:$PATH" -[ -f "$HOME/.config/sh/env" ] && source $HOME/.config/sh/env +PATH="${HOME}/.bin/local:${HOME}/.bin/$(hostname):${HOME}/.bin:/usr/lib/ccache/bin:$PATH" +export PATH +[ -f "$HOME/.config/sh/env" ] && source "$HOME"/.config/sh/env # }}} # Test for an interactive shell. {{{ # There is no need to set anything past this point for scp and rcp, and it's # important to refrain from outputting anything in those cases. if [[ $- != *i* ]] ; then - # Shell is non-interactive. Be done now! - return + # Shell is non-interactive. Be done now! + return fi [ -z "$PS1" ] && return # }}} # Change the window title of X terminals {{{ case ${TERM} in - xterm*|rxvt*|Eterm|aterm|kterm|gnome|screen*) - PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"' - ;; + xterm*|rxvt*|Eterm|aterm|kterm|gnome|screen*) + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"' + ;; esac # }}} # aliases {{{ -[ -f "$HOME/.config/sh/aliases" ] && source $HOME/.config/sh/aliases -[ -f "$HOME/.config/sh/functions" ] && source $HOME/.config/sh/functions +[ -f "$HOME/.config/sh/aliases" ] && source "$HOME"/.config/sh/aliases +[ -f "$HOME/.config/sh/functions" ] && source "$HOME"/.config/sh/functions # }}} # completion {{{ +#shellcheck disable=SC1091 [ -f /etc/bash_completion ] && source /etc/bash_completion +#shellcheck disable=SC1091 [ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion +#shellcheck disable=SC1091 [ -f /usr/share/bash-completion/bash_completion ] && source /usr/share/bash-completion/bash_completion # }}} # bash configuration {{{ @@ -57,7 +62,8 @@ source ~/.config/sh/fzf/shell/key-bindings.bash # }}} # prompt {{{ if type fancy-prompt > /dev/null 2>&1; then - export PROMPT_COMMAND="__err=\$?;$PROMPT_COMMAND;PS1=\"\$(fancy-prompt --prompt-escape bash "\$__err")\"" + __err=0 + export PROMPT_COMMAND="__err=\$?;$PROMPT_COMMAND;PS1=\"\$(fancy-prompt --prompt-escape bash \$__err)\"" fi # }}} # }}} diff --git a/config/sh/aliases b/config/sh/aliases index c764f38..fa479aa 100644 --- a/config/sh/aliases +++ b/config/sh/aliases @@ -13,8 +13,8 @@ type sudo-askpass > /dev/null 2>&1 && alias sudo="sudo -A" # }}} # games {{{ alias nao="env TERM=rxvt telnet nethack.alt.org" -alias cao="env TERM=rxvt /usr/bin/ssh -C -i $HOME/.ssh/cao_key joshua@crawl.akrasiac.org" -alias cdo="ssh -C -i $HOME/.ssh/cao_key crawl@crawl.develz.org" +alias cao="env TERM=rxvt /usr/bin/ssh -C -i \$HOME/.ssh/cao_key joshua@crawl.akrasiac.org" +alias cdo="ssh -C -i \$HOME/.ssh/cao_key crawl@crawl.develz.org" # }}} # termcast {{{ alias tc="telnet termcast.org" diff --git a/config/sh/env b/config/sh/env index 218ddde..dd54019 100644 --- a/config/sh/env +++ b/config/sh/env @@ -1,7 +1,9 @@ -export GPG_TTY=$(tty) +GPG_TTY=$(tty) +export GPG_TTY export MANPAGER="$HOME/.bin/vimmanpager" export PERLDOC_PAGER="$HOME/.bin/vimmanpager" -export EDITOR=$(/usr/bin/which vim) +EDITOR=$(command -v vim) +export EDITOR ssh="${HOME}/.bin/$(hostname)/ssh" if [ -x "$ssh" ]; then export GIT_SSH="$ssh" diff --git a/config/sh/functions b/config/sh/functions index d6068e0..a662f2d 100644 --- a/config/sh/functions +++ b/config/sh/functions @@ -11,9 +11,9 @@ function cdu { local root root="$(git rev-parse --show-superproject-working-tree 2>/dev/null)" if [ -n "$root" ]; then - cd "$root" + cd "$root" || return else - cd "$(git rev-parse --show-toplevel)" + cd "$(git rev-parse --show-toplevel)" || return fi } @@ -1,3 +1,4 @@ -. $HOME/.bash_profile +# shellcheck source=bash_profile +. "$HOME"/.bash_profile # vim:ft=sh: @@ -1,5 +1,6 @@ #!/bin/sh +# shellcheck source=xprofile [ -f ~/.xprofile ] && . ~/.xprofile exec i3 @@ -4,6 +4,6 @@ start-pulseaudio-x11 eval "$(ssh-agent)" -pidof svscan || (svscan $HOME/.services/enabled 2>&1 | readproctitle $USER ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................) & +pidof svscan || (svscan "$HOME"/.services/enabled 2>&1 | readproctitle "$USER" ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................) & setup-inputs |