Ralf Beckesch 1 неделя назад
Родитель
Сommit
474444e92e

+ 10 - 56
dot_bashrc

@@ -1,3 +1,5 @@
+#!/bin/bash
+
 # ~/.bashrc: executed by bash(1) for non-login shells.
 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
 # for examples
@@ -101,60 +103,6 @@ if [ -f ~/.bash_aliases ]; then
     . ~/.bash_aliases
 fi
 
-# enable programmable completion features (you don't need to enable
-# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
-# sources /etc/bash.bashrc).
-if ! shopt -oq posix; then
-  if [ -f /usr/share/bash-completion/bash_completion ]; then
-    . /usr/share/bash-completion/bash_completion
-  elif [ -f /etc/bash_completion ]; then
-    . /etc/bash_completion
-  fi
-fi
-# bash theme - partly inspired by https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme
-__bash_prompt() {
-    local userpart='`export XIT=$? \
-        && [ ! -z "${GITHUB_USER:-}" ] && echo -n "\[\033[0;32m\]@${GITHUB_USER:-} " || echo -n "\[\033[0;32m\]\u " \
-        && [ "$XIT" -ne "0" ] && echo -n "\[\033[1;31m\]➜" || echo -n "\[\033[0m\]➜"`'
-    local gitbranch='`\
-        if [ "$(git config --get devcontainers-theme.hide-status 2>/dev/null)" != 1 ] && [ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ]; then \
-            export BRANCH="$(git --no-optional-locks symbolic-ref --short HEAD 2>/dev/null || git --no-optional-locks rev-parse --short HEAD 2>/dev/null)"; \
-            if [ "${BRANCH:-}" != "" ]; then \
-                echo -n "\[\033[0;36m\](\[\033[1;31m\]${BRANCH:-}" \
-                && if [ "$(git config --get devcontainers-theme.show-dirty 2>/dev/null)" = 1 ] && \
-                    git --no-optional-locks ls-files --error-unmatch -m --directory --no-empty-directory -o --exclude-standard ":/*" > /dev/null 2>&1; then \
-                        echo -n " \[\033[1;33m\]✗"; \
-                fi \
-                && echo -n "\[\033[0;36m\]) "; \
-            fi; \
-        fi`'
-    local lightblue='\[\033[1;34m\]'
-    local removecolor='\[\033[0m\]'
-    PS1="${userpart} ${lightblue}\w ${gitbranch}${removecolor}\$ "
-    unset -f __bash_prompt
-}
-__bash_prompt
-export PROMPT_DIRTRIM=4
-
-# Check if the terminal is xterm
-if [[ "$TERM" == "xterm" ]]; then
-    # Function to set the terminal title to the current command
-    preexec() {
-        local cmd="${BASH_COMMAND}"
-        echo -ne "\033]0;${USER}@${HOSTNAME}: ${cmd}\007"
-    }
-
-    # Function to reset the terminal title to the shell type after the command is executed
-    precmd() {
-        echo -ne "\033]0;${USER}@${HOSTNAME}: ${SHELL}\007"
-    }
-
-    # Trap DEBUG signal to call preexec before each command
-    trap 'preexec' DEBUG
-
-    # Append to PROMPT_COMMAND to call precmd before displaying the prompt
-    PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }precmd"
-fi
 
 
 
@@ -256,13 +204,19 @@ alias chgrp='chgrp --preserve-root'
 # alias gpumeminfo='grep -i --color memory /var/log/Xorg.0.log'
 
 
-bashrcDir=".bashrc.d"
+echo "pwd: $(pwd)"
+
+bashrcDir="$HOME/.bashrc.d"
+echo "bashrcDir: '$bashrcDir'"
 if [ -d "$bashrcDir" ]; then
 	for ext in $bashrcDir/*sh; do
-		if [ -d "ext" ]; then
+		if [ -f "ext" ]; then
 			echo include "$ext"
 			. $ext
 		fi
 	done
+else
+	echo "bashrcDir: '$bashrcDir' NOT FOUND!"
+	ls -l $bashrcDir
 fi
 

+ 0 - 0
dot_bashrc.d/bash-setup-generic.sh → dot_bashrc.d/000-bash-setup-generic.sh


+ 0 - 0
dot_bashrc.d/empty_agent-env → dot_bashrc.d/010-bash-account-specific.sh


+ 0 - 0
dot_bashrc.d/app-specifics.sh → dot_bashrc.d/100-app-specifics.sh


+ 0 - 0
dot_bashrc.d/host_specifics/.keep → dot_bashrc.d/100-generic-aliases.sh


+ 0 - 0
dot_bashrc.d/app_specifics/chezmoi.sh → dot_bashrc.d/applications/chezmoi.sh


+ 0 - 0
dot_bashrc.d/containerlab.sh → dot_bashrc.d/applications/containerlab.sh


+ 0 - 0
dot_bashrc.d/devpod.sh → dot_bashrc.d/applications/devpod.sh


+ 0 - 0
dot_bashrc.d/app_specifics/kubernetes.sh → dot_bashrc.d/applications/kubernetes.sh


+ 0 - 0
dot_bashrc.d/applications/ls+lsd.sh


+ 0 - 0
dot_bashrc.d/app_specifics/ssh-agent.sh → dot_bashrc.d/applications/ssh-agent.sh


+ 0 - 0
dot_bashrc.d/app_specifics/ssh-completion.sh → dot_bashrc.d/applications/ssh-completion.sh


+ 0 - 0
dot_bashrc.d/app_specifics/vi.sh → dot_bashrc.d/applications/vi.sh


+ 0 - 4
dot_bashrc.d/distribution_specifics/arch-default-editor.sh

@@ -1,4 +0,0 @@
-EDITORCFG=/etc/profile.d/editor.sh
-if [ -f "$EDITORCFG" ]; then
-    . $EDITORCFG
-fi

+ 0 - 9
dot_bashrc.d/host-specifics.sh

@@ -1,9 +0,0 @@
-#!/bin/bash
-
-bashrcd_dir=~/.bashrc.d
-host_specifics_dir=$bashrcd_dir/host_specifics
-
-for i in $host_specifics_dir/*sh; do
-	echo NOT include "'$i'"
-done
-

+ 0 - 3
dot_bashrc.d/randomstrings.sh

@@ -1,3 +0,0 @@
-# Random String
-alias randomstring="tr -dc A-Za-z0-9 </dev/urandom | head -c 64; echo"
-