Refactor: Replace users with home
This commit is contained in:
parent
36a22dc58a
commit
aaaf4808f3
65 changed files with 17 additions and 25 deletions
29
dotfiles/zsh/conf.d/ps1.zsh
Executable file
29
dotfiles/zsh/conf.d/ps1.zsh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env zsh
|
||||
|
||||
distro=$(cat /etc/os-release | grep -w 'ID=.*' | sed -e 's/ID=//g' | awk '{print $1}')
|
||||
case "$distro" in
|
||||
"debian") dicon="%F{red}%f" ;;
|
||||
"gentoo") dicon="%F{magenta}%f" ;;
|
||||
"\"opensuse-tumbleweed\"") dicon="%F{green} %f" ;;
|
||||
"nixos") dicon="%F{cyan}%f" ;;
|
||||
*) dicon="%F{yellow}[]%f" ;;
|
||||
esac
|
||||
|
||||
if [ -n "$IN_NIX_SHELL" ]; then
|
||||
if [ -z "$NIX_SHELL_PACKAGES" ]; then
|
||||
nix_shell_ps1=" %F{red}nix-shell%f"
|
||||
else
|
||||
nix_shell_ps1=" %F{red}{ $NIX_SHELL_PACKAGES }%f"
|
||||
fi
|
||||
else
|
||||
nix_shell_ps1=""
|
||||
fi
|
||||
|
||||
setopt prompt_subst
|
||||
autoload -Uz vcs_info
|
||||
precmd () { vcs_info }
|
||||
zstyle ':vcs_info:*' formats ' %F{yellow}(%b)%f'
|
||||
|
||||
NL=$'\n'
|
||||
export PS1='%F{green}%~%f$vcs_info_msg_0_$nix_shell_ps1$NL$dicon > '
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue