2024-01-18 09:22:38 +01:00
|
|
|
#!/bin/bash
|
2024-05-06 22:55:03 +02:00
|
|
|
|
2024-05-07 00:44:37 +02:00
|
|
|
# deaktiviere alias von ll, wird von mir explizit gesetzt
|
|
|
|
unalias ll 2>/dev/null
|
|
|
|
|
2024-05-06 23:00:05 +02:00
|
|
|
# source extra files
|
2024-05-30 13:48:05 +02:00
|
|
|
source "${HOME}/repos/dotfiles/.bash_aliases"
|
|
|
|
source "${HOME}/repos/dotfiles/.bash_functions"
|
|
|
|
source "${HOME}/repos/dotfiles/.bash_ps1"
|
2024-05-06 22:55:03 +02:00
|
|
|
|
2024-05-06 23:00:05 +02:00
|
|
|
### PATH
|
|
|
|
# add my scripts to PATH
|
2024-06-04 13:49:39 +02:00
|
|
|
PATH=$PATH:"${HOME}/repos/dotfiles/scripts"
|
2024-01-18 09:22:38 +01:00
|
|
|
|
2024-05-06 23:16:31 +02:00
|
|
|
## check interactive shell https://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch
|
|
|
|
if [[ $- == *i* ]] ; then
|
2024-05-28 20:19:21 +02:00
|
|
|
### root alias
|
|
|
|
alias root='sudo -H -u root /usr/bin/sudo2uls'
|
2024-05-06 23:16:31 +02:00
|
|
|
if [ "$HOSTNAME" = lzeorpt001 ]; then
|
2024-05-28 20:19:21 +02:00
|
|
|
### git-bash
|
2024-05-06 23:16:31 +02:00
|
|
|
source /usr/share/git-core/contrib/completion/git-prompt.sh
|
2024-05-28 20:19:21 +02:00
|
|
|
### keychain
|
|
|
|
export GPG_TTY=$(tty)
|
2024-05-06 23:16:31 +02:00
|
|
|
fi
|
2024-08-05 12:04:07 +02:00
|
|
|
if [ "$(hostname -s)" == "lzeorpt001" ] ; then
|
|
|
|
export EDITOR="/usr/bin/vim"
|
|
|
|
fi
|
2024-05-06 23:16:31 +02:00
|
|
|
### tmux auto attach
|
2024-01-18 09:22:38 +01:00
|
|
|
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
|
|
|
|
tmux attach -t default || tmux new -s default
|
|
|
|
fi
|
2024-05-06 23:16:31 +02:00
|
|
|
if [ "$(hostname -s)" == "lzeorpt001" ] || [ "$(hostname -s)" == "lbdlspa001" ]; then
|
|
|
|
eval $(keychain -q --eval --timeout 60 --agents ssh,gpg)
|
|
|
|
fi
|
2024-01-18 09:22:38 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
### Praktische Dinge
|
|
|
|
# Deaktiviere FlowControl
|
|
|
|
# https://unix.stackexchange.com/questions/332791/how-to-permanently-disable-ctrl-s-in-terminal
|
|
|
|
stty -ixon
|
|
|
|
|
|
|
|
# farben fur manpages
|
|
|
|
# https://opensource.com/article/18/5/bash-tricks
|
|
|
|
export LESS_TERMCAP_mb=$'\E[01;31m'
|
|
|
|
export LESS_TERMCAP_md=$'\E[01;33m'
|
|
|
|
export LESS_TERMCAP_me=$'\E[0m'
|
|
|
|
export LESS_TERMCAP_se=$'\E[0m'
|
|
|
|
export LESS_TERMCAP_so=$'\E[01;42;30m'
|
|
|
|
export LESS_TERMCAP_ue=$'\E[0m'
|
|
|
|
export LESS_TERMCAP_us=$'\E[01;36m'
|
|
|
|
|
|
|
|
# bash history bei mehreren Session
|
|
|
|
shopt -s histappend
|
|
|
|
|
|
|
|
# bach History Zeitstempel am Anfang der Zeile
|
|
|
|
export HISTTIMEFORMAT='[%F_%T] '
|
|
|
|
|
|
|
|
# typo bei cd entfernen
|
|
|
|
shopt -s cdspell
|