Apply persistent history to a powerline shell
This commit is contained in:
parent
c0ac09c0a4
commit
614cf02561
@ -1,54 +0,0 @@
|
|||||||
# If not running interactively, don't do anything!
|
|
||||||
[[ $- != *i* ]] && return
|
|
||||||
|
|
||||||
# Resolve DOTFILES_DIR (assuming ~/.dotfiles on distros without readlink and/or $BASH_SOURCE/$0)
|
|
||||||
|
|
||||||
READLINK=$(which greadlink || which readlink)
|
|
||||||
CURRENT_SCRIPT=$BASH_SOURCE
|
|
||||||
|
|
||||||
if [[ -n $CURRENT_SCRIPT && -x "$READLINK" ]]; then
|
|
||||||
SCRIPT_PATH=$($READLINK -f "$CURRENT_SCRIPT")
|
|
||||||
DOTFILES_DIR=$(dirname "$(dirname "$SCRIPT_PATH")")
|
|
||||||
elif [ -d "$HOME/.dotfiles" ]; then
|
|
||||||
DOTFILES_DIR="$HOME/.dotfiles"
|
|
||||||
else
|
|
||||||
echo "Unable to find dotfiles, exiting."
|
|
||||||
return # `exit 1` would quit the shell itself
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Finally we can source the dotfiles (order matters)
|
|
||||||
|
|
||||||
for DOTFILE in "$DOTFILES_DIR"/system/.{function,,env,alias,prompt,vimrc}; do
|
|
||||||
[ -f "$DOTFILE" ] && . "$DOTFILE"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Set LSCOLORS
|
|
||||||
|
|
||||||
eval "$(dircolors "$DOTFILES_DIR"/system/.dir_colors)"
|
|
||||||
|
|
||||||
# Hook for extra/custom stuff
|
|
||||||
|
|
||||||
EXTRA_DIR="$HOME/.extra"
|
|
||||||
|
|
||||||
if [ -d "$EXTRA_DIR" ]; then
|
|
||||||
for EXTRAFILE in "$EXTRA_DIR"/run/*.sh; do
|
|
||||||
[ -f "$EXTRAFILE" ] && . "$EXTRAFILE"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# BEGIN ANSIBLE MANAGED BLOCK
|
|
||||||
if [ -f `which powerline-daemon` ]; then
|
|
||||||
powerline-daemon -q
|
|
||||||
POWERLINE_BASH_CONTINUATION=1
|
|
||||||
POWERLINE_BASH_SELECT=1
|
|
||||||
. /usr/share/powerline/bindings/bash/powerline.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Clean up
|
|
||||||
|
|
||||||
unset READLINK CURRENT_SCRIPT SCRIPT_PATH DOTFILE
|
|
||||||
|
|
||||||
# Export
|
|
||||||
|
|
||||||
export OS DOTFILES_DIR EXTRA_DIR
|
|
@ -171,6 +171,13 @@ log_bash_persistent_history()
|
|||||||
|
|
||||||
log_bash_persistent_history
|
log_bash_persistent_history
|
||||||
|
|
||||||
|
run_on_prompt_command()
|
||||||
|
{
|
||||||
|
log_bash_persistent_history
|
||||||
|
}
|
||||||
|
|
||||||
|
PROMPT_COMMAND="run_on_prompt_command && _powerline_set_prompt"
|
||||||
|
|
||||||
## Keyboard Mapping!!!
|
## Keyboard Mapping!!!
|
||||||
setxkbmap dvorak
|
setxkbmap dvorak
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
|
Loading…
Reference in New Issue
Block a user