From 822706fd7d87e813be6ad3d4acaf6260f7ed32fd Mon Sep 17 00:00:00 2001 From: Andre Ramnitz Date: Sat, 15 Feb 2025 00:31:17 +0100 Subject: [PATCH] bash: fix endless loop while sourcing configs --- dot-bash_profile | 17 ++++++++++------- dot-bashrc | 10 +++------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/dot-bash_profile b/dot-bash_profile index cff41a63..8e1359fb 100644 --- a/dot-bash_profile +++ b/dot-bash_profile @@ -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 diff --git a/dot-bashrc b/dot-bashrc index 914fdd3e..04530f37 100644 --- a/dot-bashrc +++ b/dot-bashrc @@ -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 -- 2.51.2