diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-10 10:44:18 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-06-10 10:44:18 +1200 |
commit | 69dabe5a87f556505b6dd05ea2250df293b4889b (patch) | |
tree | ffefcd8b0d4ac4d6d61beea8dd4ac67031f79b99 /bash/bash_profile.d/fortune.bash | |
parent | Print verse(1) output on login but only once a day (diff) | |
download | dotfiles-69dabe5a87f556505b6dd05ea2250df293b4889b.tar.gz dotfiles-69dabe5a87f556505b6dd05ea2250df293b4889b.zip |
Instate .bash_profile.d
Stuff that prints messages really only needs to be done for my primary
login shell
Diffstat (limited to 'bash/bash_profile.d/fortune.bash')
-rw-r--r-- | bash/bash_profile.d/fortune.bash | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bash/bash_profile.d/fortune.bash b/bash/bash_profile.d/fortune.bash new file mode 100644 index 00000000..9caa3d3c --- /dev/null +++ b/bash/bash_profile.d/fortune.bash @@ -0,0 +1,8 @@ +# If interactive shell and fortune(6) installed, print a short fortune +if [[ $- == *i* ]] && hash fortune 2>/dev/null ; then ( + if [[ -d "$HOME"/.local/share/games/fortunes ]] ; then + FORTUNE_PATH=${FORTUNE_PATH:-$HOME/.local/share/games/fortunes} + fi + fortune -sn "${FORTUNE_MAXSIZE:-1024}" "$FORTUNE_PATH" +) ; fi + |