From 0bd9e1a8066706ebf806dbfdd55752bc3cb0a7ae Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 29 Jan 2022 22:17:02 +0530 Subject: update prompt to show up in tmux --- hosts/olive/configuration.nix | 2 +- programs/bash.nix | 30 +++++++++++++----------------- programs/tmux.nix | 20 ++++++++++++-------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/hosts/olive/configuration.nix b/hosts/olive/configuration.nix index 91d7b1c..02bf4a5 100644 --- a/hosts/olive/configuration.nix +++ b/hosts/olive/configuration.nix @@ -128,7 +128,7 @@ extraOptions = '' experimental-features = nix-command flakes ca-derivations warn-dirty = false - keep-outputs = true + keep-outputs = false keep-derivations = true ''; }; diff --git a/programs/bash.nix b/programs/bash.nix index 82e5c67..66546c2 100644 --- a/programs/bash.nix +++ b/programs/bash.nix @@ -11,6 +11,7 @@ historyFileSize = 2000; historyIgnore = [ "ls" "exit" "kill" ]; historySize = 1000; + shellAliases = { "..." = "cd -- ../.."; grep = "grep --color=auto"; @@ -34,6 +35,7 @@ glo = "git log --pretty=oneline --abbrev-commit"; gst = "git status --short"; }; + shellOptions = [ "histappend" "autocd" @@ -47,22 +49,9 @@ "histreedit" "nocasematch" ]; + sessionVariables = { - PROMPT_CHAR = "λ"; - PROMPT_CHAR_COLOR = "cyan"; - PROMPT_CHAR_ROOT = "#"; - PROMPT_CHAR_ROOT_COLOR = "magenta"; - SHORTEN_CWD = 1; - CWD_COLOR = "white"; - EXPAND_TILDE = 0; - GIT_CLEAN = "·"; - GIT_CLEAN_COLOR = "green"; - GIT_WT_MODIFIED = "×"; - GIT_WT_MODIFIED_COLOR = "red"; - GIT_INDEX_MODIFIED = "±"; - GIT_INDEX_MODIFIED_COLOR = "yellow"; - BRANCH_COLOR = "bright black"; - COMMIT_COLOR = "green"; + PF_INFO = "ascii title os kernel uptime pkgs shell"; PF_SEP = " "; PF_COL1 = 7; @@ -70,18 +59,25 @@ PF_COL3 = 6; PF_ALIGN = "9"; PF_ASCII = "nixos"; + _JAVA_AWT_WM_NONREPARENTING = 1; + TERM = "xterm-256color-italic"; EDITOR = "nvim"; MANPAGER = "nvim +Man!"; GPG_TTY = "\$(tty)"; + }; + initExtra = '' [ -f $HOME/.github ] && . $HOME/.github - [ -f ~/.bash_aliases ] && . ~/.bash_aliases eval "$(direnv hook bash)" - export PS1='\n$(pista)' export PATH=$PATH:"$HOME/scripts" + export PROMPT_COMMAND="tmux refresh-client -S"; + export PS1="\n\001\e[0;36m\002λ\001\e[0m\002 "; + export PS2="> "; + ''; + }; } diff --git a/programs/tmux.nix b/programs/tmux.nix index 30483aa..8975f44 100644 --- a/programs/tmux.nix +++ b/programs/tmux.nix @@ -67,19 +67,23 @@ set -g pane-border-style fg=colour11 set -g pane-active-border-style fg=colour8 - set -g status-justify right - set -g status-right "" - set -g status-style "bg=colour0" - set -ag status-style "fg=colour7" + set-option -g status-justify absolute-centre + set-option -g status-position bottom set -g window-status-current-format " #[fg=colour15]#W#{?window_zoomed_flag, #[fg=colour2]+,}#{?window_activity_flag, #[fg=colour3]!,}" set -g window-status-format " #[fg=colour8]#W#{?window_zoomed_flag, #[fg=colour2]+,}" + # status right + set -g status-style "bg=colour0" + set -ag status-style "fg=colour7" + + set -g status-right "#[fg=colour15]#(date +"%H%M") #[fg=colour8]hrs " + set -ag status-right "#[fg=colour15]#(date +"%d/%m")#[fg=colour8] #(date +"%Y") " + set -ag status-right "#[fg=colour7]#(bat -q)#[fg=colour12]" - set -g status-left-length 100 - set -g status-left "#[fg=colour15]#(date +"%H%M") #[fg=colour8]hrs " - set -ag status-left "#[fg=colour15]#(date +"%d/%m")#[fg=colour8] #(date +"%Y") " - set -ag status-left "#[fg=colour7]#(bat -q)#[fg=colour12]" + # status left + set -g status-left "#[fg=colour7]#(/home/np/code/rust/prompt/target/debug/prompt cwd #{pane_current_path}) " + set -ag status-left "#[fg=colour7]#(/home/np/code/rust/prompt/target/debug/prompt vcs #{pane_current_path})" ''; }; } -- cgit v1.2.3