From 2166e53b8edb8c2592946f39955b7bc336ad6972 Mon Sep 17 00:00:00 2001 From: Andre Ramnitz Date: Thu, 14 Nov 2024 07:29:08 +0100 Subject: [PATCH] bash: workarounds for opensuse --- dot-bash_profile | 6 ++++-- dot-bashrc | 15 ++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/dot-bash_profile b/dot-bash_profile index 6bdc697c..e7142cba 100644 --- a/dot-bash_profile +++ b/dot-bash_profile @@ -15,8 +15,10 @@ 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 +if [[ ! "$(grep -i suse /etc/os-release)" ]]; then + if [[ -f ~/.bashrc ]] ; then + . ~/.bashrc + fi fi # autorun display-manager diff --git a/dot-bashrc b/dot-bashrc index 73305c1f..9edad24a 100644 --- a/dot-bashrc +++ b/dot-bashrc @@ -23,11 +23,15 @@ alias glo='git log --oneline' alias gst='git status' alias nano='nano -_qpT4 ' alias free='free -h --si' -alias lsblk='lsblk -o name,size,partuuid,fstype,mountpoints,label' -alias wtemp='sensors | grep WaterPostRad | cut -f2 -d'+'' - +alias lsblk='lsblk -o name,partuuid,type,size,fstype,label,mountpoints' alias lf='lfrun' +# compatibility with OpenSuSE +if [[ "$(grep -i suse /etc/os-release)" ]]; then + . ~/.bash_profile +fi +test -s ~/.alias && . ~/.alias || true + case $(tty) in /dev/tty[0-9]*) alias l1='EZA_GRID_ROWS=13 eza -w 220 --group --group-directories-first -1' @@ -93,6 +97,7 @@ PS1='\u@\h \w \$ ' command -v starship > /dev/null 2>&1 && eval "$(starship init bash)" # apply base16 theme -~/.local/bin/base16-flavours +test -f ~/.local/bin/base16-flavours && ~/.local/bin/base16-flavours clear -command fastfetch -c "$HOME/.config/fastfetch/config.jsonc" +test -f /usr/bin/fastfetch && command fastfetch -c "$HOME/.config/fastfetch/config.jsonc" + -- 2.51.2