]> Freerunner's - dotfiles.git/commitdiff
bash: make config more robust
authorAndre Ramnitz <tux.rising@gmail.com>
Fri, 21 Mar 2025 06:58:47 +0000 (07:58 +0100)
committerAndre Ramnitz <tux.rising@gmail.com>
Fri, 21 Mar 2025 06:58:47 +0000 (07:58 +0100)
dot-bash_profile
dot-bashrc

index 8e1359fbd1398f5286a51f334f3fd34b1c92d1bc..6d81ea9ff7267655f4681d336b81231293611e14 100644 (file)
@@ -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
index 04530f37f034ac76559a70d7c343e534ad320303..5955106e571641e789df1bccae60292d3f2e45b0 100644 (file)
@@ -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