From 93b9d17c6b2c8f63b1d05205c6ec696d998f904c Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 4 Oct 2020 14:41:10 +0530 Subject: migrate to home-manager --- bash/.bash_aliases | 2 ++ bash/.bash_profile | 4 ---- bash/.bash_prompt | 20 ++++++++++++++++---- bash/.bashrc | 6 +++--- 4 files changed, 21 insertions(+), 11 deletions(-) (limited to 'bash') diff --git a/bash/.bash_aliases b/bash/.bash_aliases index efecd71..60c1d93 100644 --- a/bash/.bash_aliases +++ b/bash/.bash_aliases @@ -23,3 +23,5 @@ alias ggp='git push' alias gl='git log -p --abbrev-commit --pretty=medium' alias glo='git log --pretty=oneline --abbrev-commit' alias gst='git status --short' + +alias pfetch='pfetch | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g"' diff --git a/bash/.bash_profile b/bash/.bash_profile index d7df6a9..6d8c25b 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -2,7 +2,3 @@ # Get the aliases and functions [ -f $HOME/.bashrc ] && . $HOME/.bashrc - - - -export PATH="$HOME/.poetry/bin:$PATH" diff --git a/bash/.bash_prompt b/bash/.bash_prompt index ca47d1d..eaeecb6 100755 --- a/bash/.bash_prompt +++ b/bash/.bash_prompt @@ -15,10 +15,10 @@ git_branch() { if [[ $git_status =~ $on_branch ]]; then local branch=${BASH_REMATCH[1]} - echo -ne "\001${cyn}\002 $branch\001${rst}\002" + echo -ne "\001${cyn}\002$branch\001${rst}\002" elif [[ $git_status =~ $on_commit ]]; then local commit=${BASH_REMATCH[1]} - echo -ne "\001${prp}\002 $commit\001${rst}\002" + echo -ne "\001${prp}\002$commit\001${rst}\002" fi } @@ -29,7 +29,7 @@ prompt_pwd() { echo "/" else path="$(echo $PWD | sed -e "s-$HOME/--g")" - echo -ne " \001${gry}\002$path/\001${rst}\002" + echo -ne "\001${gry}\002$path/\001${rst}\002" fi } @@ -37,7 +37,7 @@ rootornot() { if [[ "$(id -u)" -eq 0 ]]; then echo -ne "\001${red}\002#\001${rst}\002" else - echo -ne "$" + echo -ne "λ" fi } @@ -47,7 +47,19 @@ host() { fi } +in_nix() { + if [ "$IN_NIX_SHELL" == "impure" ]; then + echo -ne "\001${red}\002(nix)\001${rst}\002" + elif [ "$IN_NIX_SHELL" == "pure" ]; then + echo -ne "\001${grn}\002(nix)\001${rst}\002" + else + echo -ne "" + fi + +} + +# export PS1='\n$(prompt_pwd) $(git_branch)\n$(rootornot) ' export PS1='\n$(pista)' export PS2=" > " diff --git a/bash/.bashrc b/bash/.bashrc index 656978a..279a81a 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -2,11 +2,10 @@ export PATH=$PATH":$HOME/scripts" export TERM=xterm-256color-italic export EDITOR="/run/current-system/sw/bin/nvim" -export MANPAGER="less" +export MANPAGER="nvim +Man!" export BROWSER="/run/current-system/sw/bin/nvim" export GPG_TTY=$(tty) export TZ='Asia/Kolkata' -export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --color=bw' export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' @@ -53,7 +52,7 @@ fi [ -f $HOME/.github ] && . $HOME/.github [ -f ~/.bash_aliases ] && . ~/.bash_aliases -[ -f ~/.bash_prompt ] && . ~/.bash_prompt +# [ -f ~/.bash_prompt ] && . ~/.bash_prompt [ -f ~/.fzf.bash ] && source ~/.fzf.bash eval "$(stack --bash-completion-script stack)" @@ -110,3 +109,4 @@ export BRANCH_COLOR="bright black" # if HEAD ref peels to a commit (detached state) export COMMIT_COLOR="green" +eval "$(direnv hook bash)" -- cgit v1.2.3