]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/themes/mlh.zsh-theme
...
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / themes / mlh.zsh-theme
1 # The Official Theme of Major League Hacking
2
3 ##     ## ##       ##     ##
4 ###   ### ##       ##     ##
5 #### #### ##       ##     ##
6 ## ### ## ##       #########
7 ##     ## ##       ##     ##
8 ##     ## ##       ##     ##
9 ##     ## ######## ##     ##
10
11 # # # # # # # # # # # # # # # # # #
12 # # # Feel free to customize! # # #
13 # # # # # # # # # # # # # # # # # #
14
15 # To customize symbols (e.g MLH_AT_SYMBOL), simply set them as environment variables
16 # for example in your ~/.zshrc file, like this:
17 # MLH_AT_SYMBOL=" at "
18
19 # Settings *must* be set before sourcing oh-my-zsh.sh the .zshrc file.
20 #
21 # To easily discover colors and their codes, type `spectrum_ls` in the terminal
22
23 # right prompt default settings
24 if [ -z "$MLH_PRINT_EXIT_CODE" ]; then
25   MLH_PRINT_EXIT_CODE=true
26 fi
27
28 if [ -z "$MLH_PRINT_TIME" ]; then
29   MLH_PRINT_TIME=false
30 fi
31
32 # left prompt symbols default settings
33
34 if [ -z "$MLH_AT_SYMBOL" ]; then
35   MLH_AT_SYMBOL="@"
36 fi
37
38 if [ -z "$MLH_IN_SYMBOL" ]; then
39   MLH_IN_SYMBOL=" in "
40 fi
41
42 if [ -z "$MLH_ON_SYMBOL" ]; then
43   MLH_ON_SYMBOL=" on "
44 fi
45
46 if [ -z "$MLH_SHELL_SYMBOL" ]; then
47   MLH_SHELL_SYMBOL="$ "
48 fi
49
50 # colors
51 USER_COLOR="%F{001}"
52 DEVICE_COLOR="%F{033}"
53 DIR_COLOR="%F{220}"
54 BRANCH_COLOR="%F{001}"
55 TIME_COLOR="%F{033}"
56
57 username() {
58   echo "$USER_COLOR%n%f"
59 }
60
61 # Prints device name
62 device() {
63   echo "$DEVICE_COLOR%m%f"
64 }
65
66 # Prints the current directory
67 directory() {
68   echo "$DIR_COLOR%1~%f"
69 }
70
71 # Prints current time
72 current_time() {
73   if [ "$MLH_PRINT_TIME" = true ]; then
74     echo " $TIME_COLOR%*%f"
75   fi
76 }
77
78 # Prints exit code of the last executed command
79 exit_code() {
80   if [ "$MLH_PRINT_EXIT_CODE" = true ]; then
81     echo "%(?..%F{001}exit %?)%f"
82   fi
83 }
84
85 prompt_end() {
86   printf "\n$MLH_SHELL_SYMBOL"
87 }
88
89 # Set git_prompt_info text
90 ZSH_THEME_GIT_PROMPT_PREFIX="${MLH_ON_SYMBOL}${BRANCH_COLOR}"
91 ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
92 ZSH_THEME_GIT_PROMPT_DIRTY=""
93 ZSH_THEME_GIT_PROMPT_CLEAN=""
94
95 # %B and %b make the text bold
96 PROMPT='%b$(username)$MLH_AT_SYMBOL$(device)$MLH_IN_SYMBOL$(directory)$(git_prompt_info)%b$(prompt_end)'
97 RPROMPT="$(exit_code)$(current_time)"