forked from zap-zsh/zap-prompt
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdistro-prompt.zsh-theme
78 lines (68 loc) · 2.1 KB
/
distro-prompt.zsh-theme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/zsh
autoload -Uz vcs_info
autoload -U colors && colors
zstyle ':vcs_info:*' enable git
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
zstyle ':vcs_info:git*+set-message:*' hooks git-untracked
#
+vi-git-untracked(){
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \
git status --porcelain | grep '??' &> /dev/null ; then
hook_com[staged]+='!' # signify new files with a bang
fi
}
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:git:*' formats " %{$fg[blue]%}(%{$fg[red]%}%m%u%c%{$fg[yellow]%}%{$fg[magenta]%} %b%{$fg[blue]%})%{$reset_color%}"
OS=$(uname -or)
case $OS in
*Darwin*) ICON="" ;;
*Android*) ICON="" ;;
*microsoft*) ICON="" ;;
*BSD*)
DISTRO=$(uname -s)
case $DISTRO in
*FreeBSD*) ICON="" ;;
*OpenBSD*) ICON="" ;;
esac
;;
*Linux*)
DISTRO=$(awk -F= '/^ID=/ {print $2}' /etc/os-release 2> /dev/null | sed 's/"//g')
case $DISTRO in
arch|archarm) ICON="" ;;
void) ICON="" ;;
centos) ICON="" ;;
ubuntu) ICON="" ;;
fedora) ICON="" ;;
alpine) ICON="" ;;
artix) ICON="" ;;
gentoo) ICON="" ;;
debian) ICON="" ;;
linuxmint) ICON="" ;;
manjaro) ICON="" ;;
pop) ICON="" ;;
parrot) ICON="" ;;
kali) ICON="" ;;
guix) ICON="" ;;
nixos) ICON="" ;;
endeavouros) ICON="" ;;
deepin) ICON="" ;;
archlabs) ICON="" ;;
almalinux) ICON="" ;;
raspbian) ICON="" ;;
rhel) ICON="" ;;
slackware) ICON="" ;;
zorin) ICON="" ;;
elementary) ICON="" ;;
solus) ICON="" ;;
rocky) ICON="" ;;
opensuse*) ICON="" ;;
*) ICON="" ;;
esac
;;
*) ICON="" ;;
esac
PROMPT="%B%{$fg[yellow]%} $ICON % %(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )%{$fg[cyan]%}%c%{$reset_color%}"
PROMPT+="\$vcs_info_msg_0_ "
ROMPT+="\$vcs_info_msg_0_ "