From ff5ae2e271313e7638510108e347ad922a8775c2 Mon Sep 17 00:00:00 2001 From: Andre Ramnitz Date: Fri, 21 Mar 2025 07:58:47 +0100 Subject: [PATCH] bash: make config more robust --- dot-bash_profile | 2 +- dot-bashrc | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dot-bash_profile b/dot-bash_profile index 8e1359fb..6d81ea9f 100644 --- a/dot-bash_profile +++ b/dot-bash_profile @@ -23,7 +23,7 @@ export GTK_USE_PORTAL=1 # This file is sourced by bash for login shells. The following line # runs your .bashrc and is recommended by the bash info pages. -if [ grep -q suse /etc/os-release ]; then +if grep -q suse /etc/os-release; then # for compatibility with OpenSuSE don't forget to source .bash_profile from .profile true else diff --git a/dot-bashrc b/dot-bashrc index 04530f37..5955106e 100644 --- a/dot-bashrc +++ b/dot-bashrc @@ -88,8 +88,17 @@ lfcd () { PS1='\u@\h \w \$ ' command -v starship > /dev/null 2>&1 && eval "$(starship init bash)" -# apply base16 theme -test -e ~/.local/bin/base16-flavours && ~/.local/bin/base16-flavours || true -clear -test -e /usr/bin/fastfetch && command fastfetch -c "$HOME/.config/fastfetch/default.jsonc" || true +# apply base16 theme in X/Wayland session only, or flavours' plasma-hook hangs: +case $(tty) in + /dev/tty[0-9]*) + command -v ttyscheme > /dev/null 2>&1 && ttyscheme onedark + clear + test -e /usr/bin/fastfetch && command fastfetch -c "$HOME/.config/fastfetch/default.jsonc" || true + ;; + /dev/pts/[0-9]*) + test -e ~/.local/bin/base16-flavours && ~/.local/bin/base16-flavours || true + clear + test -e /usr/bin/fastfetch && command fastfetch -c "$HOME/.config/fastfetch/default.jsonc" || true + ;; +esac -- 2.51.2