From 856493f7dce81125fdc5e8df2486ac1bc9ff753f Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Mon, 23 Dec 2019 23:04:53 -0800 Subject: [PATCH] Remove flags until the file gets bigger, fix prompt officially so it stops overwriting --- README.md | 6 ++++++ dotfiles/bash/bashrc | 39 +++++++++++++++++++++++++++++++-------- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3789290..14c707e 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,12 @@ To rebind capslock and escape in XFCE paste the following command in your termin `/usr/bin/setxkbmap -option "caps:swapescape"` +To make it permanent, add it to your XFCE startup items via: + +`xfce4-settings-manager` + +and then `Session and Startup > Application autostart` using an `onlogin` trigger. + ``` pip install pynvim ``` diff --git a/dotfiles/bash/bashrc b/dotfiles/bash/bashrc index db0250d..bc3853a 100644 --- a/dotfiles/bash/bashrc +++ b/dotfiles/bash/bashrc @@ -14,26 +14,41 @@ else symlink_dir=$(cd "$( dirname "`readlink ${BASH_SOURCE[0]}`" )" && pwd) fi + # -------------------------------- SETUP -------------------------------- # # Store private information (exports, keys, etc) in .bash_private. -if [[ -f ~/.bash_private ]]; then - source ~/.bash_private +if [[ -f $HOME/.bash_private ]]; then + source $HOME/.bash_private echo ".bash_private loaded" fi -if [ -f ~/.inputrc ]; then - bind -f ~/.inputrc +if [ -f $HOME/.inputrc ]; then + bind -f $HOME/.inputrc else echo "No .inputrc detected" fi if [[ "$OSTYPE" == "darwin"* ]]; then - if [ -f ~/.macrc ]; then - source ~/.macrc + if [ -f $HOME/.macrc ]; then + source $HOME/.macrc fi fi + +# Set up projects and gopath folder properly for the export in the export section. + +if [[ ! -d $HOME/projects ]]; then + echo "Making $HOME/projects" + mkdir -p $HOME/projects +fi + +if [[ -x go ]]; then + echo "Making $HOME/projects/go" + mkdir -p $HOME/projects/go +fi + + # ------------------------------ END SETUP ------------------------------ # @@ -77,6 +92,12 @@ export PATH="/usr/local/opt/openjdk/bin:$PATH" # Ignore duplicates in history to make history less of a hassle to use. export HISTCONTROL=ignoredups + +# If go is installed, set the $GOPATH to the projects directory created above. +if [[ -x go ]]; then + export GOPATH=$HOME/projects/go +fi + # ------------ END EXPORTS ------------# @@ -108,9 +129,11 @@ export PROMPT_DIRTRIM=2 # Important note for PS1 modification - everything non-printable must be escaped with `\[` and `\]`. Otherwise readline # fails to track the prompt right and things get messed up when you input long strings. +GIT_BRANCH=$(parse_git_branch) + if [[ "$OSTYPE" == "linux-gnu" ]]; then # I had some rendering issues running in XFCE unless I added an extra space at the end. - export PS1='\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]\[$(parse_git_branch)\]\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] ' + export PS1='\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]$GIT_BRANCH\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] ' else - export PS1='\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]\[$(parse_git_branch)\]\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] ' + export PS1='\[$bold\]\[$white\]\u@\h\[$reset\]: \[$bold\]\[$blue\]\w\[$reset\] \[$green\]$GIT_BRANCH\[$reset\]\[$bold\]\[$white\]⇨\[$reset\] ' fi