]> Freerunner's - dotfiles.git/commitdiff
bash: prepare .profile for openrc user services
authorAndre Ramnitz <tux.rising@gmail.com>
Fri, 5 Sep 2025 00:01:50 +0000 (02:01 +0200)
committerAndre Ramnitz <tux.rising@gmail.com>
Fri, 5 Sep 2025 00:01:50 +0000 (02:01 +0200)
dot-bashrc
dot-profile

index a8c18bba4694c928e08c7428aa9aabb45153b061..970ffcafc22c2e740eb4913feda99eb49870358c 100644 (file)
@@ -10,7 +10,8 @@ alias cdg='cd "$(git rev-parse --show-toplevel)"'
 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"'
-alias grep='command grep -si --color=auto'
+alias ff='fastfetch'
+alias grep='command grep -sil --color=auto'
 alias gdi='git diff '
 alias gg='cd "$(git rev-parse --show-toplevel)"'
 alias gco='git checkout'
@@ -64,20 +65,6 @@ fi
 # No double entries in the shell history.
 export HISTCONTROL="$HISTCONTROL erasedups:ignoreboth"
 
-# Wrap the following commands for interactive use to avoid accidental file overwrites.
-rm() { command rm -i "${@}"; }
-cp() { command cp -i "${@}"; }
-mv() { command mv -i "${@}"; }
-
-# enable moving between directories without cd
-shopt -s autocd
-# enable spelling correction
-shopt -s dirspell
-# enable case-insensitivity
-shopt -s nocaseglob
-# expand filename patterns without match to a null string
-shopt -s nullglob
-
 # Change working dir in shell to last dir in lf on exit (adapted from ranger).
 lfcd () {
     # `command` is needed in case `lfcd` is aliased to `lf`
@@ -85,22 +72,35 @@ lfcd () {
 }
 
 # Put your fun stuff here.
-#
-# just set a minimal prompt in bash and use starship instead
-PS1='\u@\h \w \$ '
-command -v starship > /dev/null 2>&1 && eval "$(starship init bash)"
+if [ -t 0 ]; then
+    # Wrap the following commands for interactive use to avoid accidental file overwrites.
+    rm() { command rm -i "${@}"; }
+    cp() { command cp -i "${@}"; }
+    mv() { command mv -i "${@}"; }
 
-# 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]*)
-        command -v base16-flavours > /dev/null 2>&1 && ~/.local/bin/base16-flavours || true
-        clear
-        test -e /usr/bin/fastfetch && command fastfetch -c "$HOME/.config/fastfetch/default.jsonc" || true
-        ;;
-esac
+    # enable moving between directories without cd
+    shopt -s autocd
+    # enable spelling correction
+    shopt -s dirspell
+    # enable case-insensitivity
+    shopt -s nocaseglob
+    # expand filename patterns without match to a null string
+    shopt -s nullglob
+
+    # just set a minimal prompt in bash and use starship instead
+    PS1='\u@\h \w \$ '
+    command -v starship > /dev/null 2>&1 && eval "$(starship init bash)"
+
+    # 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 c64
+            test -e /usr/bin/fastfetch && command fastfetch -c "$HOME/.config/fastfetch/default.jsonc" || true
+            ;;
+        /dev/pts/[0-9]*)
+            # command -v base16-flavours > /dev/null 2>&1 && ~/.local/bin/base16-flavours || true
+            test -e /usr/bin/fastfetch && command fastfetch -c "$HOME/.config/fastfetch/default.jsonc" || true
+            ;;
+    esac
+fi
 
index 4ff47c8714fa0a35f6bc7c85050e1f9cfd45ba69..9ff9068390d611a1c0aaa035d22d64d49107ec54 100644 (file)
@@ -29,3 +29,7 @@ if test -z "$XDG_RUNTIME_DIR"; then
     export XDG_RUNTIME_DIR=$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX)
 fi
 
+if [ -t 0 ]; then
+    # interactive commands here
+fi
+