From 79eedbf33fb71cb75753f7bcdc6ee29fbbc202b3 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Wed, 6 Aug 2025 13:05:05 +0300 Subject: [PATCH] {bash,zsh}rc: introduce bat for motivational-message.txt reading --- .mikaela/motivational-message.txt | 4 ++-- rc/bashrc | 8 +++++++- rc/zshrc | 8 +++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.mikaela/motivational-message.txt b/.mikaela/motivational-message.txt index 0771e59a..fae77eee 100644 --- a/.mikaela/motivational-message.txt +++ b/.mikaela/motivational-message.txt @@ -16,8 +16,8 @@ Aferoj emas funkcii sin mem... OM MANI PEME HUNG... # You are a perfect expression of perfect Love, here and now. # Illusions I & II - Richard Bach - "They say that I must learn to kill before I can feel safe. But I, - I'd rather kill myself then turn into their slave." +> They say that I must learn to kill before I can feel safe. But I, +> I'd rather kill myself then turn into their slave. # The Rasmus: In the Shadows MEMENTO VIVERE! Advice, total nonsense or something between: diff --git a/rc/bashrc b/rc/bashrc index ce28b0db..84ee7a37 100755 --- a/rc/bashrc +++ b/rc/bashrc @@ -168,7 +168,13 @@ if hash lsb_release 2> /dev/null; then # Only print motivational phrases if username is aminda or mikaela or deck if [[ $(whoami) == aminda ]] || [[ $(whoami) == mikaela ]] || [[ $(whoami) == deck ]]; then if [ -f $HOME/.shell-things/.mikaela/motivational-message.txt ]; then - tail -n +1 $HOME/.shell-things/.mikaela/motivational-message.txt | grep -v '#' + # Confusion between bat and batcula is not a concern at this + # point. + if hash bat 2> /dev/null; then + bat -l markdown -f --style=plain $HOME/.shell-things/.mikaela/motivational-message.txt | \grep -v '#' + else + tail -n +1 $HOME/.shell-things/.mikaela/motivational-message.txt | grep -v '#' + fi fi elif [[ "$(id -u)" == "0" ]]; then # This comes from Charybdis IRCd diff --git a/rc/zshrc b/rc/zshrc index 959fb700..518e663e 100755 --- a/rc/zshrc +++ b/rc/zshrc @@ -64,7 +64,13 @@ if hash lsb_release 2> /dev/null; then # Only print motivational phrases if username is aminda or mikaela or deck if [[ $(whoami) == aminda ]] || [[ $(whoami) == mikaela ]] || [[ $(whoami) == deck ]]; then if [ -f $HOME/.shell-things/.mikaela/motivational-message.txt ]; then - tail -n +1 $HOME/.shell-things/.mikaela/motivational-message.txt | grep -v '#' + # Confusion between bat and batcula is not a concern at this + # point. + if hash bat 2> /dev/null; then + bat -l markdown -f --style=plain $HOME/.shell-things/.mikaela/motivational-message.txt | \grep -v '#' + else + tail -n +1 $HOME/.shell-things/.mikaela/motivational-message.txt | grep -v '#' + fi fi elif [[ "$(id -u)" == "0" ]]; then # This comes from Charybdis IRCd