]> Freerunner's - dotfiles.git/commitdiff
bash: fix endless loop while sourcing configs
authorAndre Ramnitz <tux.rising@gmail.com>
Fri, 14 Feb 2025 23:31:17 +0000 (00:31 +0100)
committerAndre Ramnitz <tux.rising@gmail.com>
Fri, 14 Feb 2025 23:31:17 +0000 (00:31 +0100)
dot-bash_profile
dot-bashrc

index cff41a634a9f47579a3eb7ad39e83458bcce0a11..8e1359fbd1398f5286a51f334f3fd34b1c92d1bc 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
-# /etc/skel/.bash_profile
 
+# /etc/skel/.bash_profile
 export PATH="$PATH:$HOME/Applications:$HOME/go/bin:$HOME/.cargo/bin:/opt/android-sdk/platform-tools:$HOME/.local/bin"
 
 export EDITOR="kks edit"
@@ -23,15 +23,18 @@ 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 [[ -f ~/.bashrc ]] ; then
-       . ~/.bashrc
-    fi
+if [ grep -q suse /etc/os-release ]; then
+    # for compatibility with OpenSuSE don't forget to source .bash_profile from .profile
+    true
+else
+    test -f ~/.bashrc && . .bashrc || true
+fi
 
 # autorun display-manager
-if { [ -z "$DISPLAY" ] || [ -z "$WAYLAND_DISPLAY" ]; } && [ "$XDG_VTNR" -eq "1" ]; then
+if { [ -z "$DISPLAY" ] || [ -z "$WAYLAND_DISPLAY" ]; } && [ "$XDG_VTNR" -eq "1" ]; then
   #startx
   #dbus-launch --exit-with-session /usr/bin/startplasma-wayland
   #dbus-launch --exit-with-session Hyprland
-  tbsm
-fi
+  tbsm
+fi
 
index 914fdd3eedd09427a940f067bb14b6c9da72a119..04530f37f034ac76559a70d7c343e534ad320303 100644 (file)
@@ -6,7 +6,6 @@
 # that can't tolerate any output.  So make sure this doesn't display
 # anything or bad things will happen !
 
-
 alias df='/usr/bin/df -h --output=target,fstype,used,avail,pcent,source | sort -n'
 alias du='du -h'
 alias fastfetch='fastfetch -c "$HOME/.config/fastfetch/default.jsonc"'
@@ -20,12 +19,9 @@ alias gst='git status'
 alias nano='nano -_qpT4 '
 alias free='free -h --si'
 alias lsblk='lsblk -o name,partuuid,type,size,fstype,label,mountpoints'
-alias  lf='lfrun'
+alias lf='lfrun'
 
 # compatibility with OpenSuSE
-if [[ "$(grep -i suse /etc/os-release)" ]]; then
-    . ~/.bash_profile
-fi
 test -e ~/.alias && . ~/.alias || true
 
 case $(tty) in
@@ -93,7 +89,7 @@ PS1='\u@\h \w \$ '
 command -v starship > /dev/null 2>&1 && eval "$(starship init bash)"
 
 # apply base16 theme
-test -f ~/.local/bin/base16-flavours && ~/.local/bin/base16-flavours
+test -e ~/.local/bin/base16-flavours && ~/.local/bin/base16-flavours || true
 clear
-test -f /usr/bin/fastfetch && command fastfetch -c "$HOME/.config/fastfetch/default.jsonc"
+test -e /usr/bin/fastfetch && command fastfetch -c "$HOME/.config/fastfetch/default.jsonc" || true