From 426fdbd7eeaf62297af35d798d98436e17cd5b16 Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Tue, 9 Apr 2019 15:33:53 +0200 Subject: [PATCH] Fixup some startup scripts. --- dotfiles/env | 16 +++++++++++++--- dotfiles/profile | 3 +++ dotfiles/zshrc | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/dotfiles/env b/dotfiles/env index 2b00419..c9faf6a 100755 --- a/dotfiles/env +++ b/dotfiles/env @@ -1,7 +1,7 @@ # Sourced by zshrc as well as bash. +# Should only use POSIX shell constructs. umask 027 -ulimit -c unlimited # Paths and preferences export PYTHONPATH="$HOME/.python:$PYTHONPATH" @@ -15,11 +15,20 @@ export LESS="-MR" export QUOTING_STYLE="literal" # Coreutils quotes # Fix gnome-terminal -if [ "$TERM" = "xterm" -a "$COLORTERM" = "gnome-terminal" ] ; then +if [ "$TERM" = "xterm" ] && [ "$COLORTERM" = "gnome-terminal" ] ; then # Requires `ncurses-base` package for terminfo. export TERM="xterm-256color" fi +# Terminal preferences for i3 +if [ -z "${TERMINAL}" ] ; then + for t in urxvt gnome-terminal; do + if TERMINAL=$(command -v ${t}) ; then + export TERMINAL + fi + done +fi + # For virtualenvwrapper export WORKON_HOME=$HOME/.virtualenvs export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages' @@ -60,4 +69,5 @@ else fi export LC_COLLATE=C -if [ -e $HOME/.localenv ] ; then source $HOME/.localenv ; fi +# shellcheck source=/dev/null +test -e "$HOME/.localenv" && . "$HOME/.localenv" diff --git a/dotfiles/profile b/dotfiles/profile index ac87789..ed96787 100755 --- a/dotfiles/profile +++ b/dotfiles/profile @@ -1,3 +1,6 @@ +# Interactive shells only. +# Should only use POSIX constructs. + # Always load ENV test -f "$HOME/.env" && . "$HOME/.env" diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 42387a9..6a90144 100755 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -6,6 +6,9 @@ setopt appendhistory autocd autopushd extendedglob nohup nomatch histignorespace unsetopt beep histbeep listbeep flowcontrol bindkey -v +# Allow core files +ulimit -c unlimited + # Completion zstyle :compinstall filename "${HOME}/.zshrc" zstyle ':completion:*' users root ${USER}