From 15d3ac5692cbebfae65432a9f0900492adb5cf8a Mon Sep 17 00:00:00 2001 From: Sheldon Lee Date: Wed, 24 Jun 2020 22:48:14 +0100 Subject: [PATCH] Added .bash* files --- .bash_logout | 3 +++ .bash_profile | 9 ++++++++ .bashrc | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 .bash_logout create mode 100644 .bash_profile create mode 100644 .bashrc diff --git a/.bash_logout b/.bash_logout new file mode 100644 index 0000000..0e4e4f1 --- /dev/null +++ b/.bash_logout @@ -0,0 +1,3 @@ +# +# ~/.bash_logout +# diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..9814928 --- /dev/null +++ b/.bash_profile @@ -0,0 +1,9 @@ +# +# ~/.bash_profile +# + +[[ -f ~/.bashrc ]] && . ~/.bashrc + +if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then + exec startx +fi diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..c40a6f2 --- /dev/null +++ b/.bashrc @@ -0,0 +1,60 @@ +# +# ~/.bashrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +alias ls='ls --color=auto' +PS1='[\u@\h \W]\$ ' + +# for nnn file manager +n () +{ + # Block nesting of nnn in subshells + if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then + echo "nnn is already running" + return + fi + + # The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set) + # To cd on quit only on ^G, remove the "export" as in: + # NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" + # NOTE: NNN_TMPFILE is fixed, should not be modified + export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd" + + # Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn + # stty start undef + # stty stop undef + # stty lwrap undef + # stty lnext undef + + nnn "$@" + + if [ -f "$NNN_TMPFILE" ]; then + . "$NNN_TMPFILE" + rm -f "$NNN_TMPFILE" > /dev/null + fi +} + +#.dotfiles repo alias +alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' +# nnn +# bookmarks +export NNN_BMS='q:~/.config/qtile/;' +# use trashcan +export NNN_TRASH=1 + +# custom scripts +CUSTOM_SCRIPTS_FILE=~/.custom_bash_scripts.sh +if test -f $CUSTOM_SCRIPTS_FILE; then + source $CUSTOM_SCRIPTS_FILE +else + echo ".custom_bash_scripts.sh does not exist." +fi +# vi bindings +set -o vi + +# default programs +export EDITOR=vim +export VISUAL=vim