Skip to content

Instantly share code, notes, and snippets.

@aelkz
Created June 25, 2019 12:31
Show Gist options
  • Save aelkz/c0cf5f5ee5dfac6e56e0d86d88457aa6 to your computer and use it in GitHub Desktop.
Save aelkz/c0cf5f5ee5dfac6e56e0d86d88457aa6 to your computer and use it in GitHub Desktop.
.zshrc
1 MAVEN_PATH=/usr/local/devtools/apache-maven-3.5.4/bin/
2 #OC_CLIENT=/usr/local/devtools/oc-cli-v3.11/
3 OC_CLIENT=/usr/local/devtools/oc-cli-v4.1/
4
5 export PATH=$PATH:$MAVEN_PATH:$OC_CLIENT
6
7 # Path to your oh-my-zsh installation.
8 export ZSH="/Users/raphael/.oh-my-zsh"
9
10 # Set name of the theme to load --- if set to "random", it will
11 # load a random theme each time oh-my-zsh is loaded, in which case,
12 # to know which specific one was loaded, run: echo $RANDOM_THEME
13 # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
14 #ZSH_THEME="robbyrussell"
15 ZSH_THEME="powerlevel9k/powerlevel9k"
16 #ZSH_THEME="wild-cherry"
17 #ZSH_THEME="spaceship-prompt/spaceship"
18 POWERLEVEL9K_MODE='nerdfont-complete'
19
20 # Uncomment the following line to enable command auto-correction.
21 ENABLE_CORRECTION="true"
22
23 # which plugins do you like to load?
24 # Standard plugins can be found in ~/.oh-my-zsh/plugins/*
25 # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
26 # Example format: plugins=(rails git textmate ruby lighthouse)
27 # Add wisely, as too many plugins slow down shell startup.
28 plugins=(
29 git
30 zsh-syntax-highlighting
31 zsh-autosuggestions
32 )
33
34 source $ZSH/oh-my-zsh.sh
35 #source $(dirname $(gem which colorls))/tab_complete.sh
36
37 # User configuration
38 DEFAULT_USER="raphael"
39
40 alias zsh="vim ~/.zshrc"
41 alias down="cd ~/Downloads"
42 alias desktop="cd ~/Desktop"
43 alias redhat="cd ~/Documents/_redhat/"
44 alias ..="cd .."
45 alias ....="cd ../.."
46 alias look="sudo find . -name"
47 alias search="sudo grep --color -rnw ./ -e "
48 alias ports="sudo lsof -PiTCP -sTCP:LISTEN"
49 alias xclip="xclip -selection c"
50 alias speedtest="wget -O /dev/null cachefly.cachefly.net/100mb.test"
51 alias ls="colorls --group-directories-first -lA --sd"
52 alias ll="ls -la --block-size=MB"
54 # =========================
55 # POWERLEVEL CONFIGURATIONS
56 # =========================
57 POWERLEVEL9K_MODE='nerdfont-complete'
58
59 # Colorise the top Tabs of Iterm2 with the same color as background
60 # Just change the 18/26/33 wich are the rgb values
61 echo -ne "\033]6;1;bg;red;brightness;18\a"
62 echo -ne "\033]6;1;bg;green;brightness;26\a"
63 echo -ne "\033]6;1;bg;blue;brightness;33\a"
64
65 # Please only use this battery segment if you have material icons in your nerd font (or font)
66 # Otherwise, use the font awesome one in "User Segments"
67 prompt_zsh_battery_level() {
68 local percentage1=`pmset -g ps | sed -n 's/.*[[:blank:]]+*\(.*%\).*/\1/p'`
69 local percentage=`echo "${percentage1//\%}"`
70 local color='%F{red}'
71 local symbol="\uf00d"
72 pmset -g ps | grep "discharging" > /dev/null
73 if [ $? -eq 0 ]; then
74 local charging="false";
75 else
76 local charging="true";
77 fi
78 if [ $percentage -le 20 ]
79 then symbol='\uf579' ; color='%F{red}' ;
80 #10%
81 elif [ $percentage -gt 19 ] && [ $percentage -le 30 ]
82 then symbol="\uf57a" ; color='%F{red}' ;
83 #20%
84 elif [ $percentage -gt 29 ] && [ $percentage -le 40 ]
85 then symbol="\uf57b" ; color='%F{yellow}' ;
86 #35%
87 elif [ $percentage -gt 39 ] && [ $percentage -le 50 ]
88 then symbol="\uf57c" ; color='%F{yellow}' ;
89 #45%
90 elif [ $percentage -gt 49 ] && [ $percentage -le 60 ]
91 then symbol="\uf57d" ; color='%F{blue}' ;
92 #55%
93 elif [ $percentage -gt 59 ] && [ $percentage -le 70 ]
94 then symbol="\uf57e" ; color='%F{blue}' ;
95 #65%
96 elif [ $percentage -gt 69 ] && [ $percentage -le 80 ]
97 then symbol="\uf57f" ; color='%F{blue}' ;
98 #75%
99 elif [ $percentage -gt 79 ] && [ $percentage -le 90 ]
100 then symbol="\uf580" ; color='%F{blue}' ;
101 #85%
102 elif [ $percentage -gt 89 ] && [ $percentage -le 99 ]
103 then symbol="\uf581" ; color='%F{blue}' ;
104 #85%
105 elif [ $percentage -gt 98 ]
106 then symbol="\uf578" ; color='%F{green}' ;
107 #100%
108 fi
109 if [ $charging = "true" ];
110 then color='%F{green}'; if [ $percentage -gt 98 ]; then symbol='\uf584'; fi
111 fi
112 echo -n "%{$color%}$symbol" ;
113 }
114
115 zsh_internet_signal(){
116 local color
117 local symbol="\uf7ba"
118 if ifconfig en0 | grep inactive &> /dev/null; then
119 color="%F{red}"
120 else
121 color="%F{blue}"
122 fi
123 echo -n "%{$color%}$symbol "
124 }
125
126 POWERLEVEL9K_PROMPT_ON_NEWLINE=true
127 POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
128 POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
129 POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
130 POWERLEVEL9K_SHORTEN_STRATEGY="truncate_beginning"
131 POWERLEVEL9K_RVM_BACKGROUND="black"
132 POWERLEVEL9K_RVM_FOREGROUND="249"
133 POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_COLOR="red"
134 POWERLEVEL9K_TIME_BACKGROUND="black"
135 POWERLEVEL9K_TIME_FOREGROUND="249"
136 POWERLEVEL9K_TIME_FORMAT="%D{%H:%M %d/%m/%y}"
137 POWERLEVEL9K_RVM_BACKGROUND="black"
138 POWERLEVEL9K_RVM_FOREGROUND="249"
139 POWERLEVEL9K_RVM_VISUAL_IDENTIFIER_COLOR="red"
140 POWERLEVEL9K_STATUS_VERBOSE=false
141 POWERLEVEL9K_VCS_CLEAN_FOREGROUND='black'
142 POWERLEVEL9K_VCS_CLEAN_BACKGROUND='green'
143 POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND='black'
144 POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='yellow'
145 POWERLEVEL9K_VCS_MODIFIED_FOREGROUND='white'
146 POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='black'
147 POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND='black'
148 POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND='blue'
149 POWERLEVEL9K_FOLDER_ICON=''
150 POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE=true
151 POWERLEVEL9K_STATUS_VERBOSE=false
152 POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
153 POWERLEVEL9K_VCS_UNTRACKED_ICON='\u25CF'
154 POWERLEVEL9K_VCS_UNSTAGED_ICON='\u00b1'
155 POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON='\u2193'
156 POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON='\u2191'
157 POWERLEVEL9K_VCS_COMMIT_ICON="\uf417"
158 POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="%F{blue}\u256D\u2500%f"
159 POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%F{blue}\u2570\uf460%f "
160 POWERLEVEL9K_CUSTOM_BATTERY_STATUS="prompt_zsh_battery_level"
161 POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context battery custom_internet_signal custom_battery_status_joined ssh root_indicator dir dir_writable vcs)
162 POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(command_execution_time status time ip)
163 HIST_STAMPS="mm/dd/yyyy"
164 DISABLE_UPDATE_PROMPT=true
165
166 # Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
167 export PATH="$PATH:$HOME/.rvm/bin"
168
169 neofetch --memory_display bar --color_blocks off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment