From 656da025bb037b816b2e7be9102a6705772207b8 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 31 May 2017 18:15:39 +1200 Subject: Conditions for downloads.sh --- sh/profile.d/downloads.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'sh/profile.d') diff --git a/sh/profile.d/downloads.sh b/sh/profile.d/downloads.sh index 4c57ddfd..fb8dd64a 100644 --- a/sh/profile.d/downloads.sh +++ b/sh/profile.d/downloads.sh @@ -1,4 +1,19 @@ +# Only if shell is interactive +case $- in + *i*) ;; + *) return ;; +esac + +# Only if not in a tmux window +[ -z "$TMUX" ] || return + +# Not if ~/.hushlogin exists +[ -e "$HOME"/.hushlogin ] && return + +# Not if ~/.downloads doesn't [ -f "$HOME"/.downloads ] || return + +# Count files in each directory, report if greater than zero ( while IFS= read -r dir ; do case $dir in -- cgit v1.2.3