From 1ce0e2ad424bf38768094488774eff23b3871ccc Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 20 Aug 2016 00:43:35 +1200 Subject: Port all bash_profile.d scripts to POSIX sh Also require flag files in ~/.welcome for displaying or not displaying login stuff --- bash/bash_profile | 6 ------ bash/bash_profile.d/fortune.bash | 19 ------------------- bash/bash_profile.d/remind.bash | 22 ---------------------- bash/bash_profile.d/verse.bash | 24 ------------------------ 4 files changed, 71 deletions(-) delete mode 100644 bash/bash_profile.d/fortune.bash delete mode 100644 bash/bash_profile.d/remind.bash delete mode 100644 bash/bash_profile.d/verse.bash (limited to 'bash') diff --git a/bash/bash_profile b/bash/bash_profile index db1d9bc8..69350102 100644 --- a/bash/bash_profile +++ b/bash/bash_profile @@ -13,12 +13,6 @@ elif ((BASH_VERSINFO[0] == 2)) && return fi -# Load any supplementary scripts -for sh in "$HOME"/.bash_profile.d/*.bash ; do - [[ -e $sh ]] && source "$sh" -done -unset -v sh - # If ~/.bashrc exists, source that too; the test for interactivity is in there if [[ -f $HOME/.bashrc ]] ; then source "$HOME"/.bashrc diff --git a/bash/bash_profile.d/fortune.bash b/bash/bash_profile.d/fortune.bash deleted file mode 100644 index cc16ff05..00000000 --- a/bash/bash_profile.d/fortune.bash +++ /dev/null @@ -1,19 +0,0 @@ -# Only if shell is interactive -if [[ $- != *i* ]] ; then - return -fi - -# Only if fortune(6) available -if ! hash fortune 2>/dev/null ; then - return -fi - -# Print from subshell to keep namespace clean -( - if [[ -d $HOME/.local/share/games/fortunes ]] ; then - FORTUNE_PATH=${FORTUNE_PATH:-$HOME/.local/share/games/fortunes} - fi - printf '\n' - fortune -s "$FORTUNE_PATH" - printf '\n' -) diff --git a/bash/bash_profile.d/remind.bash b/bash/bash_profile.d/remind.bash deleted file mode 100644 index a8f14599..00000000 --- a/bash/bash_profile.d/remind.bash +++ /dev/null @@ -1,22 +0,0 @@ -# Only if shell is interactive -if [[ $- != *i* ]] ; then - return -fi - -# Only if rem(1) available -if ! hash rem 2>/dev/null ; then - return -fi - -# Only if reminders file exists -if [[ ! -e ${DOTREMINDERS:-$HOME/.reminders} ]] ; then - return -fi - -# Print from subshell to keep namespace clean -( - while IFS= read -r reminder ; do - printf '* %s\n' "$reminder" - done < <(rem -hq) - printf '\n' -) diff --git a/bash/bash_profile.d/verse.bash b/bash/bash_profile.d/verse.bash deleted file mode 100644 index 69c48021..00000000 --- a/bash/bash_profile.d/verse.bash +++ /dev/null @@ -1,24 +0,0 @@ -# Only if shell is interactive -if [[ $- != *i* ]] ; then - return -fi - -# Only if verse(1) available -if ! hash verse 2>/dev/null ; then - return -fi - -# Run verse(1) if we haven't seen it already today (the verses are selected by -# date); run in a subshell to keep vars out of global namespace -( - date=$(date +%Y-%m-%d) - versefile=${VERSEFILE:-$HOME/.verse} - if [[ -e $versefile ]] ; then - IFS= read -r lastversedate < "$versefile" - fi - if [[ $date > $lastversedate ]] ; then - verse - printf '\n' - printf '%s\n' "$date" > "$versefile" - fi -) -- cgit v1.2.3