summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-11-16 03:20:56 -0500
committerJesse Luehrs <doy@tozt.net>2018-11-16 03:20:56 -0500
commit790064c91f1291b55ac3a6627c41c8181e4b6b42 (patch)
tree8fc98a0e9326613def8174eda79189ff02428d73
parent654d626159e1fab6bb6cd85c4ad593ea260c3195 (diff)
downloadconf-790064c91f1291b55ac3a6627c41c8181e4b6b42.tar.gz
conf-790064c91f1291b55ac3a6627c41c8181e4b6b42.zip
shellcheck
-rw-r--r--bash_profile3
-rw-r--r--bashrc32
-rw-r--r--config/sh/aliases4
-rw-r--r--config/sh/env6
-rw-r--r--config/sh/functions4
-rw-r--r--profile3
-rw-r--r--xinitrc1
-rw-r--r--xprofile2
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:
diff --git a/bashrc b/bashrc
index 52966e3..c6015cf 100644
--- a/bashrc
+++ b/bashrc
@@ -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
}
diff --git a/profile b/profile
index 3188a7d..76e64da 100644
--- a/profile
+++ b/profile
@@ -1,3 +1,4 @@
-. $HOME/.bash_profile
+# shellcheck source=bash_profile
+. "$HOME"/.bash_profile
# vim:ft=sh:
diff --git a/xinitrc b/xinitrc
index 93fd2a6..8d6d364 100644
--- a/xinitrc
+++ b/xinitrc
@@ -1,5 +1,6 @@
#!/bin/sh
+# shellcheck source=xprofile
[ -f ~/.xprofile ] && . ~/.xprofile
exec i3
diff --git a/xprofile b/xprofile
index 6d491f5..4213a9c 100644
--- a/xprofile
+++ b/xprofile
@@ -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