From 20b5be4f667498f72a4700760dc46f74de183f67 Mon Sep 17 00:00:00 2001 From: Przemyslaw Grondek Date: Wed, 28 Aug 2019 11:59:54 +0200 Subject: [PATCH] [bash] few changes separate local aliases remove running bash in screen on servers --- bash/.bash_aliases | 14 ++++++++++++++ bash/Makefile | 2 +- bash/bash_aliases | 8 +------- bash/bashrc | 26 ++++++-------------------- 4 files changed, 22 insertions(+), 28 deletions(-) create mode 100644 bash/.bash_aliases mode change 100644 => 120000 bash/bash_aliases diff --git a/bash/.bash_aliases b/bash/.bash_aliases new file mode 100644 index 0000000..c80fd01 --- /dev/null +++ b/bash/.bash_aliases @@ -0,0 +1,14 @@ +# This file is copy from repo config +# To define local only aliases use ~/.bash_aliases2 + +alias ll='ls -AlFh' +alias la='ls -A' +alias l='ls -CF' + +alias home='cd ~' +alias root='cd /' + +alias q=exit +alias open=xdg-open + +alias jar='java -jar' diff --git a/bash/Makefile b/bash/Makefile index a3165fe..18e2d3b 100644 --- a/bash/Makefile +++ b/bash/Makefile @@ -1,4 +1,4 @@ -BASH_ALIASES=bash_aliases +BASH_ALIASES=.bash_aliases BASH_ALIASES_OUT=$(HOME)/.bash_aliases BASHRC=bashrc BASHRC_OUT=$(HOME)/.bashrc diff --git a/bash/bash_aliases b/bash/bash_aliases deleted file mode 100644 index ec21daf..0000000 --- a/bash/bash_aliases +++ /dev/null @@ -1,7 +0,0 @@ -alias home='cd ~' -alias root='cd /' - -alias q=exit -alias open=xdg-open - -alias jar='java -jar' diff --git a/bash/bash_aliases b/bash/bash_aliases new file mode 120000 index 0000000..8b9b8ec --- /dev/null +++ b/bash/bash_aliases @@ -0,0 +1 @@ +.bash_aliases \ No newline at end of file diff --git a/bash/bashrc b/bash/bashrc index 3a05097..0037e04 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -109,11 +109,6 @@ fi # colored GCC warnings and errors #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' -# some more ls aliases -alias ll='ls -alFh' -alias la='ls -A' -alias l='ls -CF' - # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' @@ -122,11 +117,15 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. - if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi +# Local defined aliases +if [ -f ~/.bash_aliases2 ]; then + . ~/.bash_aliases2 +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). @@ -138,7 +137,7 @@ if ! shopt -oq posix; then fi fi -#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! +# sdkman configuration if present if [ -d ~/.sdkman ]; then export SDKMAN_DIR="$HOME/.sdkman" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" @@ -146,16 +145,3 @@ fi export VISUAL=vim export EDITOR="$VISUAL" - -# Start all sessions in screen when running on server -if [ "$computer_type" == "server" ]; then - if [ -d /usr/bin/screen ]; then - echo Server - if [ -z "$STY" ]; then - screen -R; - exit - fi - else - echo "Warning, no screen binary found" - fi -fi