Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Path to oh-my-zsh installation. ##
- export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH
- fpath=(/usr/local/share/zsh-completions $fpath)
- ## Path to oh-my-zsh installation. ##
- export ZSH=$HOME/.oh-my-zsh
- export TERM=screen-256color
- ## Theme in use. ##
- POWERLEVEL9K_MODE='nerdfont-complete"
- ZSH_THEME="powerlevel9k/powerlevel9k"
- ## Wifi signal config. ##
- zsh_wifi_signal(){
- local output=$(/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I)
- local airport=$(echo $output | grep 'AirPort' | awk -F': ' '{print $2}')
- if [ "$airport" = "Off" ]; then
- local color='%F{yellow}'
- echo -n "%{$color%}Wifi Off"
- else
- local ssid=$(echo $output | grep ' SSID' | awk -F': ' '{print $2}')
- local speed=$(echo $output | grep 'lastTxRate' | awk -F': ' '{print $2}')
- local color='%F{yellow}'
- [[ $speed -gt 100 ]] && color='%F{blue}'
- [[ $speed -lt 50 ]] && color='%F{red}'
- echo -n "%{$color%}$ssid $speed Mb/s%{%f%}" # removed char not in my PowerLine font
- fi
- }
- ## PowerlinePromtConfigArea. ##
- zsh_internet_signal(){
- #Try to ping google DNS to see if you have internet
- local net=$(ping 8.8.8.8 -c 1| grep transmitted | awk '{print $6}' | grep 0)
- local color='%F{red}'
- local symbol="\uf0e8"
- if [[ ! -z "$net" ]] ;
- then color='%F{green}' ; symbol="\uf1e6" ;
- fi
- echo -n "%{$color%}$symbol" # \f1eb is wifi bars
- }
- ##Get the weather information from https://www.apixu.com/.Just create a free account to have an API key. Download jq do convert json. ##
- zsh_weather(){
- local weather=$(curl -s "https://api.apixu.com/v1/current.json?key=e16fc4806872490f85f140155181404&q"="Aachen"")
- local temp=$(echo $weather | jq .current.temp_c)
- local condition=$(echo $weather | jq .current.condition.text)
- #Default value
- local color='%F{green}'
- local symbol="\ue339"
- if [[ $condition == *"rain"* ]] ;
- then symbol="\ue306" ; color='%F{blue}'
- fi
- if [[ $condition == *"cloudy"* || $condition == *"Overcast"* ]] ;
- then symbol="\uf0c2" ; color='%F{grey}';
- fi
- if [[ $condition == *"Sunny"* ]] ;
- then symbol="\ue368" ; color='%F{yellow}';
- fi
- echo -n "%{$color%}$temp\ue34f $symbol"
- }
- POWERLEVEL9K_PROMPT_ON_NEWLINE=true
- POWERLEVEL9K_DIR_PATH_SEPARATOR=
- POWERLEVEL9K_DIR_HOME_ICON="\uf286"
- POWERLEVEL9K_DIR_HOME_SUB_ICON="\ue203"
- POWERLEVEL9K_DIR_FOLDER_ICON="\uf413"
- POWERLEVEL9K_ALWAYS_SHOW_CONTEXT=true
- POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND="green"
- POWERLEVEL9K_CONTEXT_TEMPLATE="%F{cyan}%n%f"
- POWERLEVEL9K_CONTEXT_DEFAULT_BACKGROUND="black"
- POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
- POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
- POWERLEVEL9K_SHORTEN_DELIMITE="\uf557"
- POWERLEVEL9K_SHORTEN_ICON="\uE203"
- POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR="\uE0B0"
- POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR="\uE0B2"
- POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR="\uE0B1"
- POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR="\uE0B3"
- POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""
- POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%K{black}%F{black} `zsh_weather` %f%k%F{black}%f "
- POWERLEVEL9K_CUSTOM_INTERNET_SIGNAL="zsh_internet_signal"
- POWERLEVEL9K_CUSTOM_WIFI_SIGNAL="zsh_wifi_signal"
- POWERLEVEL9K_CUSTOM_WIFI_SIGNAL_BACKGROUND="145"
- POWERLEVEL9K_CUSTOM_WIFI_SIGNAL_FOREGROUND="228"
- POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=('os_icon' 'custom_internet_signal' 'dir' 'dir_writable' 'root_indicator' 'command_execution_time')
- POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=('status' 'ram_free' 'disk_usage' 'time' 'custom_wifi_signal')
- POWERLEVEL9K_ROOT_INDICATOR_ICON="\uf023"
- POWERLEVEL9K_OS_ICON_BACKGROUND="238"
- POWERLEVEL9K_OS_ICON_FOREGROUND="white"
- POWERLEVEL9K_DISK_USAGE_ONLY_WARNING=false
- POWERLEVEL9K_DISK_USAGE_ICON="\ue240"
- POWERLEVEL9K_DISK_USAGE_WARNING_LEVEL=90
- POWERLEVEL9K_DISK_USAGE_CRITICAL_LEVEL=95
- POWERLEVEL9K_DIR_SHOW_WRITABLE=true
- POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_BACKGROUND="clear"
- POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND="red"
- POWERLEVEL9K_DIR_WRITEABLE_BACKGROUND="102"
- POWERLEVEL9K_DIR_WRITEABLE_FOREGROUND="184"
- POWERLEVEL9K_DIR_WRITEABLE_VISUAL_IDENTIFIER_COLOR="197"
- POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
- POWERLEVEL9K_DIR_DEFAULT_BACKGROUND="green"
- POWERLEVEL9K_DIR_HOME_FOREGROUND="015"
- POWERLEVEL9K_DIR_HOME_BACKGROUND="033"
- POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="197"
- POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND="020"
- POWERLEVEL9K_STATUS_VERBOSE=false
- POWERLEVEL9K_STATUS_OK_BACKGROUND="clear"
- POWERLEVEL9K_STATUS_OK_FOREGROUND="green"
- POWERLEVEL9K_STATUS_ERROR_BACKGROUND="clear"
- POWERLEVEL9K_STATUS_ERROR_FOREGROUND="red"
- POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S \uf252 %d.%m.%y}"
- POWERLEVEL9K_TIME_FOREGROUND="033"
- POWERLEVEL9K_TIME_BACKGROUND="188"
- POWERLEVEL9K_RAM_ICON="\uf2db"
- POWERLEVEL9K_RAM_ELEMENTS="ram_free"
- POWERLEVEL9K_RAM_BACKGROUND="069"
- POWERLEVEL9K_RAM_FOREGROUND="152"
- POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
- POWERLEVEL9K_EXECUTION_TIME_ICON="\ue755"
- POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION="2"
- POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND="blue"
- POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND="white"
- ## use hyphen-insensitive completion. ##
- HYPHEN_INSENSITIVE="true"
- ## Red Dots while waiting for input. ##
- COMPLETION_WAITING_DOTS="true"
- ## Uncomment the following line to enable command auto-correction. ##
- ENABLE_CORRECTION="true"
- ## ZSH Update Cycle. ##
- export UPDATE_ZSH_DAYS=3
- ## Enable Autoupdate oh-my-zsh. ##
- DISABLE_UPDATE_PROMPT="true"
- ## Disable Autosetting Terminal Title. ##
- DISABLE_AUTO_TITLE="true"
- ## Plugins Path $HOME/.oh-my-zsh/plugins/ ##Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
- plugins=( python extract brew sublime thefuck colored-man-pages iterm2 colorize zsh-autosuggestions zsh-syntax-highlighting.zsh)
- ## Source. ##
- source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
- source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
- source $ZSH/oh-my-zsh.sh
- source ~/.fonts/*.sh
- source "$(pluc-cli --destinationPath)" ##function pluc-cli aka Aliasforever
- ## Language environment ##
- # export LANG=de_DE@euro
- export LANG=de_DE
- ## Alias ##
- alias sublmyzshrc="subl ~/.zshrc"
- alias sublohmyzsh="subl ~/.oh-my-zsh"
- alias to=". gotodir"
- alias brewup='brew update; brew upgrade; brew prune; brew cleanup; brew doctor'
- ## function ##
- # function dependent to powerline-shell.
- ffunction powerline_precmd() {
- PS1="$(powerline-shell --shell zsh $?)"
- }
- function install_powerline_precmd() {
- for s in "${precmd_functions[@]}"; do
- if [ "$s" = "powerline_precmd" ]; then
- return
- fi
- done
- precmd_functions+=(powerline_precmd)
- }
- if [ "$TERM" != "linux" ]; then
- install_powerline_precmd
- fi
- # function options to see which plugins run.
- function options(){
- PLUGIN_PATH="$HOME/.oh-my-zsh/plugins/"
- for plugin in $plugins; do
- echo "\n\nPlugin: $plugin"; grep -r "^function \w*" $PLUGIN_PATH$plugin | awk '{print $2}' | sed 's/()//'| tr '\n' ', '; grep -r "^alias" $PLUGIN_PATH$plugin | awk '{print $2}' | sed 's/=.*//' | tr '\n' ', '
- done
- }
- #function for pluc.
- function pluc(){
- pluc-cli "$@"
- source "$(pluc-cli --destinationPath)"
- }
- # This will give you nicely formatted, line-numbered output.
- lno() {
- if [ $# == 0 ]; then
- echo "No filename provided."
- else
- sed = "$1" | paste -s -d '\t\n' - -
- fi
- }
- # output a quick markdown list from stdin to stdout.
- qlist() {
- sed -E '/^[ ]*$/d'|sed -E 's/^([ ]*)/\1* /'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement