From faaa562db0e47ccee92efeaba6f310231e1e02e9 Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Sat, 30 Jun 2018 09:32:55 +0200 Subject: [PATCH] Cleanup bash --- .bash_profile | 4 +++ .bashrc | 26 ++++++++++++++-- .config/bash/environ | 72 ------------------------------------------- .config/mimeapps.list | 18 +++-------- .profile | 60 +++++++++++++++++++++++++++++++----- 5 files changed, 84 insertions(+), 96 deletions(-) create mode 100644 .bash_profile delete mode 100644 .config/bash/environ diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..aa90e65 --- /dev/null +++ b/.bash_profile @@ -0,0 +1,4 @@ +# .bash_profile is for making sure that both the things in .profile and .bashrc are loaded for login shell. + +[ -f "${HOME}/.profile" ] && . "${HOME}/.profile" +[ -f "${HOME}/.bashrc" ] && . "${HOME}/.bashrc" diff --git a/.bashrc b/.bashrc index ad4cbcf..f25a908 100644 --- a/.bashrc +++ b/.bashrc @@ -1,12 +1,32 @@ -# User dependent .bashrc file +# .bashrc is for configuring the interactive Bash usage, like Bash aliases, setting favorite editor, setting Bash prompt, etc. # If not running interactively, don't do anything [[ -z "$PS1" ]] && return -# Load settings +# Set prompt +export PS1="\\w\$(__git_ps1 '(%s)') \$ " + +# Set favorites +export SHELL='bash' +export EDITOR='vim' +export VISUAL='vim' +export PAGER='less -eFRX' +export MANPAGER="less -eFRX" +export BROWSER='lynx -vikeys -use_mouse' + +# Larger bash history +export HISTFILESIZE=10000; +export HISTSIZE=5000; +export HISTCONTROL=ignoreboth:erasedups +export HISTIGNORE="ll:ls:cd:cd -:pwd:exit:date:* --help"; + +# Whenever displaying the prompt, write the previous line to disk +export PROMPT_COMMAND="history -a;" + +# Load aliases, functions, etc for file in ${HOME}/.config/bash/*; do [ -f "$file" ] && . "$file"; done; -# last line +# last line for local things [ -f ~/.bashrc_local ] && . ~/.bashrc_local diff --git a/.config/bash/environ b/.config/bash/environ deleted file mode 100644 index 7c21b81..0000000 --- a/.config/bash/environ +++ /dev/null @@ -1,72 +0,0 @@ -# set PATH so it includes user's private bin if it exists -if [ -d "$HOME/bin" ] ; then - PATH="$HOME/bin:$PATH" -fi - -# Set prompt -if [ -f /etc/profile.d/git-prompt.sh ]; then - . /etc/profile.d/git-prompt.sh -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' - -# Larger bash history -export HISTFILESIZE=10000; -export HISTSIZE=5000; -export HISTCONTROL=ignoreboth:erasedups -export HISTIGNORE="ll:ls:cd:cd -:pwd:exit:date:* --help"; - -# Whenever displaying the prompt, write the previous line to disk -export PROMPT_COMMAND="history -a;" - -# Set defaults -export SHELL='bash' -export EDITOR='vim' -export VISUAL='vim' -export PAGER='less -eFRX' -export MANPAGER="less -eFRX" -export BROWSER='lynx -vikeys -use_mouse' - - -# Prefer US language with SI units (Danish) -export LANG="en_DK.UTF-8" -export LANGUAGE="en_US.UTF-8" -KEYMAP=us - -# Highlight section titles in manual pages -export LESS_TERMCAP_md="${yellow}"; - -# Always enable colored `grep` output -#export GREP_OPTIONS="--color=auto"; - -# Set up syntax highlighting for 'less' (requires source-highlight package) -# See http://www.gnu.org/software/src-highlite/source-highlight.html -# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s" -export LESS=-eFRX -#export JAVA_HOME='/usr/lib/jvm/java-8-openjdk-amd64' -export GRADLE_USER_HOME=$HOME/.cache/gradle -#export GTEST_DIR='c:/googletest-release-1.7.0' -#export GTEST_DIR='c:/googletest-release-1.8.0' -#export CPPUNITDIR='c:/cppunit-1.12.1' -#export CPPUNITDIR='c:/cppunit-1.13.2' -export CPPUNITDIR_2013='c:/programs/cppunit_2013' -export RTEGENERATEVSCODE=1 - -export VIRTUALENVWRAPPER_PYTHON=/mingw64/bin/python3 - -# Set XDG directories -if [ -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs ]; then - . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs - export XDG_DESKTOP_DIR XDG_DOWNLOAD_DIR XDG_TEMPLATES_DIR XDG_PUBLICSHARE_DIR XDG_DOCUMENTS_DIR XDG_MUSIC_DIR XDG_PICTURES_DIR XDG_VIDEOS_DIR -fi -#export XDG_CONFIG_HOME = $HOME/.config/ -#export XDG_DATA_HOME = $HOME/.local/share/ -#export XDG_DATA_DIRS = /usr/local/share/:/usr/share/ -export QT_STYLE_OVERRIDE=adwaita-dark - -export USERNAME=$LOGNAME -export HOSTNAME=`hostname` -echo Welcome $USERNAME. You are on Server: $HOSTNAME !!! - - diff --git a/.config/mimeapps.list b/.config/mimeapps.list index 734055c..5f6fdc1 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -1,10 +1,10 @@ [Default Applications] text/plain=vim.desktop -text/html=firefox.desktop -x-scheme-handler/http=firefox.desktop -x-scheme-handler/https=firefox.desktop -x-scheme-handler/about=google-chrome.desktop -x-scheme-handler/unknown=google-chrome.desktop +text/html=brave.desktop +x-scheme-handler/http=brave.desktop +x-scheme-handler/https=brave.desktop +x-scheme-handler/about=brave.desktop +x-scheme-handler/unknown=brave.desktop video/x-ogm+ogg=vlc.desktop video/ogg=vlc.desktop video/x-ogm=vlc.desktop @@ -242,12 +242,4 @@ audio/x-xm=vlc.desktop; application/x-mimearchive=gvim.desktop; x-scheme-handler/http=firefox.desktop; x-scheme-handler/https=firefox.desktop; -x-scheme-handler/ftp=firefox.desktop; -x-scheme-handler/chrome=firefox.desktop; text/html=firefox.desktop; -application/x-extension-htm=firefox.desktop; -application/x-extension-html=firefox.desktop; -application/x-extension-shtml=firefox.desktop; -application/xhtml+xml=firefox.desktop; -application/x-extension-xhtml=firefox.desktop; -application/x-extension-xht=firefox.desktop; diff --git a/.profile b/.profile index ed0fa38..b7ddc9a 100644 --- a/.profile +++ b/.profile @@ -1,12 +1,56 @@ -# User dependent .profile file +# .profile is for things not specifically related to Bash, like environment variables PATH and others, and should be available anytime. + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +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' + +# Highlight section titles in manual pages +export LESS_TERMCAP_md="${yellow}"; + +# Always enable colored `grep` output +#export GREP_OPTIONS="--color=auto"; + +# Set up syntax highlighting for 'less' (requires source-highlight package) +# See http://www.gnu.org/software/src-highlite/source-highlight.html +# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s" +export LESS=-eFRX -# This file is not read by bash(1) if ~/.bash_profile or ~/.bash_login -# exists. -# the default umask is set in /etc/profile; -umask 022 -# if running bash -if [ -n "${BASH_VERSION}" ]; then - [ -f "${HOME}/.bashrc" ] && . "${HOME}/.bashrc" +# Prefer US language with SI units (Danish) +export LANG="en_DK.UTF-8" +export LANGUAGE="en_US.UTF-8" +export KEYMAP=us + +# Set XDG directories +if [ -f ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs ]; then + . ${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs + export XDG_DESKTOP_DIR XDG_DOWNLOAD_DIR XDG_TEMPLATES_DIR XDG_PUBLICSHARE_DIR XDG_DOCUMENTS_DIR XDG_MUSIC_DIR XDG_PICTURES_DIR XDG_VIDEOS_DIR fi +#export XDG_CONFIG_HOME = $HOME/.config/ +#export XDG_DATA_HOME = $HOME/.local/share/ +#export XDG_DATA_DIRS = /usr/local/share/:/usr/share/ +export QT_STYLE_OVERRIDE=adwaita-dark + +export USERNAME=$LOGNAME +export HOSTNAME=`hostname` +echo Welcome $USERNAME. You are on Server: $HOSTNAME !!! + +################################# DEBIAN LOCAL SETTINGS ##### TO BE MOVED #### + +#export JAVA_HOME='/usr/lib/jvm/java-8-openjdk-amd64' + +################################# WINDOWS LOCAL SETTINGS ##### TO BE MOVED #### +export VIRTUALENVWRAPPER_PYTHON=/mingw64/bin/python3 +export GRADLE_USER_HOME=$HOME/.cache/gradle +#export GTEST_DIR='c:/googletest-release-1.7.0' +#export GTEST_DIR='c:/googletest-release-1.8.0' +#export CPPUNITDIR='c:/cppunit-1.12.1' +#export CPPUNITDIR='c:/cppunit-1.13.2' +export CPPUNITDIR_2013='c:/programs/cppunit_2013' +export RTEGENERATEVSCODE=1 + -- 2.43.0