├── .config ├── omf │ ├── theme │ ├── themes │ │ ├── theme-nova │ │ │ ├── fish_greeting.fish │ │ │ ├── fish_mode_prompt.fish │ │ │ ├── fish_title.fish │ │ │ ├── LICENSE │ │ │ ├── fish_right_prompt.fish │ │ │ ├── README.md │ │ │ └── fish_prompt.fish │ │ └── theme-bobthefish │ │ │ ├── fish_greeting.fish │ │ │ ├── fish_mode_prompt.fish │ │ │ ├── fish_title.fish │ │ │ ├── LICENSE │ │ │ ├── fish_right_prompt.fish │ │ │ ├── README.md │ │ │ └── fish_prompt.fish │ └── bundle ├── autostart │ ├── remmina-applet.desktop │ └── redshift-gtk.desktop ├── fish │ └── config.fish ├── i3blocks │ └── i3blocks.conf ├── fontconfig │ └── conf.d │ │ └── 10-powerline-symbols.conf └── i3 │ └── config ├── .gitignore ├── scripts ├── i3wmthemer ├── hidpi ├── syne ├── speakers ├── emacs_screen.sh ├── feh_browser ├── headphones ├── gtkreload ├── keyboard_led ├── brightness └── i3blocks │ ├── wifi │ ├── battery │ ├── volume │ └── shutdown ├── etc ├── udev │ └── rules.d │ │ └── 95-monitor-hotplug.rules └── systemd │ └── system │ ├── hotplug.service │ └── synergyc.service ├── .Xresources ├── .gitconfig ├── libexec └── udev_monitor ├── xterm-256color-italic.terminfo ├── usr └── lib │ └── systemd │ └── system │ └── docker.service ├── packages.txt ├── install.sh ├── .tmux.conf └── .spacemacs /.config/omf/theme: -------------------------------------------------------------------------------- 1 | bobthefish 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gitconfig 2 | 3 | .gitconfig 4 | -------------------------------------------------------------------------------- /scripts/i3wmthemer: -------------------------------------------------------------------------------- 1 | /home/raphael/src/i3wm-themer/scripts/i3wmthemer -------------------------------------------------------------------------------- /scripts/hidpi: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gsettings set org.gnome.desktop.interface scaling-factor $1 4 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-nova/fish_greeting.fish: -------------------------------------------------------------------------------- 1 | function fish_greeting -d "what's up, fish?" 2 | end 3 | -------------------------------------------------------------------------------- /etc/udev/rules.d/95-monitor-hotplug.rules: -------------------------------------------------------------------------------- 1 | KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/bin/systemctl restart hotplug.service" 2 | 3 | -------------------------------------------------------------------------------- /.config/omf/bundle: -------------------------------------------------------------------------------- 1 | theme bobthefish 2 | theme cmorrell 3 | theme default 4 | theme edan 5 | theme eden 6 | theme idan 7 | theme numist 8 | theme plain 9 | theme pure 10 | theme tomita 11 | -------------------------------------------------------------------------------- /scripts/syne: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export DISPLAY=:0 4 | export XAUTHORITY=/run/user/1000/gdm/Xauthority 5 | 6 | killall synergyc 2>/dev/null 7 | synergyc -f --debug FATAL --yscroll 28 10.10.0.175 8 | -------------------------------------------------------------------------------- /.Xresources: -------------------------------------------------------------------------------- 1 | Xft.dpi: 182 2 | Xft.autohint: 0 3 | Xft.lcdfilter: lcddefault 4 | Xft.hintstyle: hintfull 5 | Xft.hinting: 1 6 | Xft.antialias: 1 7 | Xft.rgba: rgb 8 | 9 | rofi.font: mono 20 10 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-bobthefish/fish_greeting.fish: -------------------------------------------------------------------------------- 1 | function fish_greeting -d "what's up, fish?" 2 | set_color $fish_color_autosuggestion 3 | uname -nmsr 4 | uptime 5 | set_color normal 6 | end 7 | -------------------------------------------------------------------------------- /etc/systemd/system/hotplug.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Monitor hotplug 3 | 4 | [Service] 5 | Type=simple 6 | RemainAfterExit=no 7 | User=raphael 8 | ExecStart=/usr/libexec/udev_monitor 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | -------------------------------------------------------------------------------- /.config/autostart/remmina-applet.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Name=Remmina Applet 4 | Comment=Connect to remote desktops through the applet menu 5 | Icon=remmina 6 | Exec=remmina -i 7 | Terminal=false 8 | Type=Application 9 | Hidden=true 10 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Raphael Simon 3 | email = simon.raphael@gmail.com 4 | [url "git@github.com:"] 5 | insteadOf = gh: 6 | [github] 7 | user = raphael 8 | oauth-token = 449973b6d454236725ccb018a3a23155fb613d5a 9 | 10 | -------------------------------------------------------------------------------- /etc/systemd/system/synergyc.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Synergy client service 3 | After=display-manager.service 4 | 5 | [Service] 6 | ExecStart=/usr/bin/synergyc -f -d FATAL -n chromia --yscroll 28 10.10.2.18 7 | Restart=on-failure 8 | User=raphael 9 | 10 | [Install] 11 | WantedBy=graphical.target 12 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-nova/fish_mode_prompt.fish: -------------------------------------------------------------------------------- 1 | # This is handled inside fish_mode_prompt (see `__bobthefish_prompt_vi`) 2 | # 3 | # If you want to override this with your own mode prompt, disable bobthefish's 4 | # built-in mode prompt in your fish config: 5 | # 6 | # set -g theme_display_vi no 7 | 8 | function fish_mode_prompt; end 9 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-bobthefish/fish_mode_prompt.fish: -------------------------------------------------------------------------------- 1 | # This is handled inside fish_mode_prompt (see `__bobthefish_prompt_vi`) 2 | # 3 | # If you want to override this with your own mode prompt, disable bobthefish's 4 | # built-in mode prompt in your fish config: 5 | # 6 | # set -g theme_display_vi no 7 | 8 | function fish_mode_prompt; end 9 | -------------------------------------------------------------------------------- /scripts/speakers: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | amixer -c 1 cset name='Headphone Switch' off 4 | amixer -c 1 cset name='Stereo DAC MIXL DAC1 L Switch' off 5 | amixer -c 1 cset name='Stereo DAC MIXR DAC1 R Switch' off 6 | amixer -c 1 cset name='Stereo DAC MIXL DAC1 R Switch' on 7 | amixer -c 1 cset name='Stereo DAC MIXR DAC1 L Switch' on 8 | amixer -c 1 cset name='Speaker Switch' on 9 | -------------------------------------------------------------------------------- /scripts/emacs_screen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | eval $(xwininfo -name emacs@chromia | sed -n -e "s/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p") 4 | eval $(xrandr --listactivemonitors | sed -n -e "s/^Monitors: \+\([0-9]\+\)/m=\1/p") 5 | if [ "$m" -eq "1" ]; then 6 | echo "0" 7 | exit 8 | fi 9 | if [ "$x" -gt "1919" ]; then 10 | echo "0" 11 | else 12 | echo "1" 13 | fi 14 | -------------------------------------------------------------------------------- /scripts/feh_browser: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | shopt -s nullglob 4 | 5 | if [[ ! -f $1 ]]; then 6 | echo "$0: first argument is not a file" >&2 7 | exit 1 8 | fi 9 | 10 | file=$(basename -- "$1") 11 | dir=$(dirname -- "$1") 12 | arr=() 13 | shift 14 | 15 | cd -- "$dir" 16 | 17 | for i in *; do 18 | [[ -f $i ]] || continue 19 | arr+=("$i") 20 | [[ $i == $file ]] && c=$((${#arr[@]} - 1)) 21 | done 22 | 23 | exec feh "$@" -- "${arr[@]:c}" "${arr[@]:0:c}" 24 | -------------------------------------------------------------------------------- /scripts/headphones: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | amixer -c 1 cset name='Speaker Switch' off 4 | amixer -c 1 cset name='Stereo DAC MIXL DAC1 R Switch' off 5 | amixer -c 1 cset name='Stereo DAC MIXR DAC1 L Switch' off 6 | amixer -c 1 cset name='Stereo DAC MIXL DAC1 L Switch' on 7 | amixer -c 1 cset name='Stereo DAC MIXR DAC1 R Switch' on 8 | amixer -c 1 cset name='OUT1 Playback Switch' on 9 | amixer -c 1 cset name='OUT2 Playback Switch' on 10 | amixer -c 1 cset name='Headphone Switch' on 11 | -------------------------------------------------------------------------------- /scripts/gtkreload: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # gtkreload 3 | 4 | def usage(): 5 | print """\ 6 | Usage: gtkreload 7 | Signal applications to reload gtk, usually to apply a new theme.""" 8 | exit() 9 | 10 | import sys, gtk 11 | 12 | if len(sys.argv) >= 2: 13 | usage() 14 | events=gtk.gdk.Event(gtk.gdk.CLIENT_EVENT) 15 | data=gtk.gdk.atom_intern("_GTK_READ_RCFILES", False) 16 | events.data_format=8 17 | events.send_event=True 18 | events.message_type=data 19 | events.send_clientmessage_toall() 20 | -------------------------------------------------------------------------------- /libexec/udev_monitor: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export DISPLAY=:0 4 | export XAUTHORITY=/run/user/1000/gdm/Xauthority 5 | 6 | function connect(){ 7 | xrandr --output DP2 --auto --left-of eDP1 8 | /home/raphael/scripts/syne 9 | /home/raphael/.fehbg 10 | } 11 | 12 | function disconnect(){ 13 | xrandr --output DP2 --off 14 | /home/raphael/scripts/syne 15 | } 16 | 17 | # sleep a little so xrandr produces the correct output 18 | sleep 1 19 | 20 | xrandr | grep "DP2 connected" &> /dev/null && connect || disconnect 21 | -------------------------------------------------------------------------------- /xterm-256color-italic.terminfo: -------------------------------------------------------------------------------- 1 | # A xterm-256color based TERMINFO that adds the escape sequences for italic. 2 | # 3 | # Install: 4 | # 5 | # tic xterm-256color-italic.terminfo 6 | # 7 | # Usage: 8 | # 9 | # export TERM=xterm-256color-italic 10 | # 11 | #tmux-256color-italic|tmux with 256 colors and italic, 12 | # sitm=\ePtmux;\e\E[3m\e\\, ritm=\ePtmux;\e\E[23m\e\\, 13 | # use=screen-256color, 14 | xterm-256color-italic|xterm with 256 colors and italic, 15 | sitm=\E[3m, ritm=\E[23m, 16 | use=xterm-256color, 17 | -------------------------------------------------------------------------------- /scripts/keyboard_led: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | step=10 4 | file=/sys/class/leds/chromeos::kbd_backlight/brightness 5 | 6 | case "$1" in 7 | -i|--increase) ((val = +10));; 8 | -d|--decrease) ((val = -10));; 9 | esac 10 | 11 | if !((val)); then 12 | echo "Increase of decrease keyboard brightness" 13 | echo "Usage: ${0##*/} --increase | --decrease" 14 | exit 15 | fi 16 | 17 | read -r cur < "$file" 18 | ((val = cur + val)) 19 | 20 | if ((val < 0)); then ((val = 0));fi 21 | if ((val > 100)); then ((val = 100));fi 22 | 23 | printf '%d' "$val" > "$file" 24 | 25 | printf 'Before: %3d\n' "$cur" 26 | printf 'After : %3d\n' "$val" 27 | -------------------------------------------------------------------------------- /scripts/brightness: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | read -r max < /sys/class/backlight/intel_backlight/max_brightness 4 | ((step = max / 10)) 5 | file=/sys/class/backlight/intel_backlight/brightness 6 | 7 | case "$1" in 8 | -i|--increase) ((val = +step));; 9 | -d|--decrease) ((val = -step));; 10 | esac 11 | 12 | if !((val)); then 13 | echo "Increase or decrease screen brightness" 14 | echo "Usage: ${0##*/} --increase | --decrease" 15 | exit 16 | fi 17 | 18 | read -r cur < "$file" 19 | ((val = cur + val)) 20 | 21 | if ((val < 0)); then ((val = 0)); fi 22 | if ((val > max)); then ((val = max)); fi 23 | 24 | printf '%d' "$val" > "$file" 25 | 26 | printf 'Before: %3d\n' "$cur" 27 | printf 'After : %3d\n' "$val" 28 | -------------------------------------------------------------------------------- /.config/fish/config.fish: -------------------------------------------------------------------------------- 1 | # Path to Oh My Fish install. 2 | set -q XDG_DATA_HOME 3 | and set -gx OMF_PATH "$XDG_DATA_HOME/omf" 4 | or set -gx OMF_PATH "$HOME/.local/share/omf" 5 | 6 | # Customize Oh My Fish configuration path. 7 | #set -gx OMF_CONFIG "/home/raphael/.config/omf" 8 | 9 | # Load oh-my-fish configuration. 10 | source $OMF_PATH/init.fish 11 | 12 | set fish_greeting "" 13 | 14 | # emacs ansi-term support 15 | if test -n "$EMACS" 16 | function fish_title 17 | true 18 | end 19 | set -x TERM eterm-color 20 | end 21 | 22 | # bobthefish setup 23 | set -g theme_color_scheme gruvbox 24 | 25 | alias vi=nvim 26 | alias pbcopy='xclip -selection clipboard' 27 | alias pbpaste='xclip -selection clipboard -o' 28 | alias dots='git --git-dir=$HOME/.dots.git/ --work-tree=$HOME' 29 | 30 | set -gx GOPATH /home/raphael/go 31 | set -gx PATH $PATH $GOPATH/bin $HOME/scripts 32 | set -gx EDITOR nvim 33 | 34 | function cdg 35 | cd (gcd $argv) 36 | end 37 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-nova/fish_title.fish: -------------------------------------------------------------------------------- 1 | # You can override some default title options in your config.fish: 2 | # set -g theme_title_display_process no 3 | # set -g theme_title_display_path no 4 | # set -g theme_title_display_user yes 5 | # set -g theme_title_use_abbreviated_path no 6 | 7 | function __bobthefish_title_user -S -d 'Display actual user if different from $default_user' 8 | if [ "$theme_title_display_user" = 'yes' ] 9 | if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ] 10 | set -l IFS . 11 | hostname | read -l hostname __ 12 | echo -ns (whoami) '@' $hostname ' ' 13 | end 14 | end 15 | end 16 | 17 | function fish_title 18 | __bobthefish_title_user 19 | 20 | if [ "$theme_title_display_process" = 'yes' ] 21 | echo $_ 22 | 23 | [ "$theme_title_display_path" != 'no' ] 24 | and echo ' ' 25 | end 26 | 27 | if [ "$theme_title_display_path" != 'no' ] 28 | if [ "$theme_title_use_abbreviated_path" = 'no' ] 29 | echo $PWD 30 | else 31 | prompt_pwd 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-bobthefish/fish_title.fish: -------------------------------------------------------------------------------- 1 | # You can override some default title options in your config.fish: 2 | # set -g theme_title_display_process no 3 | # set -g theme_title_display_path no 4 | # set -g theme_title_display_user yes 5 | # set -g theme_title_use_abbreviated_path no 6 | 7 | function __bobthefish_title_user -S -d 'Display actual user if different from $default_user' 8 | if [ "$theme_title_display_user" = 'yes' ] 9 | if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ] 10 | set -l IFS . 11 | hostname | read -l hostname __ 12 | echo -ns (whoami) '@' $hostname ' ' 13 | end 14 | end 15 | end 16 | 17 | function fish_title 18 | __bobthefish_title_user 19 | 20 | if [ "$theme_title_display_process" = 'yes' ] 21 | echo $_ 22 | 23 | [ "$theme_title_display_path" != 'no' ] 24 | and echo ' ' 25 | end 26 | 27 | if [ "$theme_title_display_path" != 'no' ] 28 | if [ "$theme_title_use_abbreviated_path" = 'no' ] 29 | echo $PWD 30 | else 31 | prompt_pwd 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-nova/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2014 Justin Hileman 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-bobthefish/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2014 Justin Hileman 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 21 | OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /usr/lib/systemd/system/docker.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker Application Container Engine 3 | Documentation=https://docs.docker.com 4 | After=network-online.target docker.socket firewalld.service 5 | Wants=network-online.target 6 | Requires=docker.socket 7 | 8 | [Service] 9 | Type=notify 10 | # the default is not to use systemd for cgroups because the delegate issues still 11 | # exists and systemd currently does not support the cgroup feature set required 12 | # for containers run by docker 13 | ExecStart=/usr/bin/dockerd -H fd:// -s overlay2 -g /mnt/docker 14 | ExecReload=/bin/kill -s HUP $MAINPID 15 | LimitNOFILE=1048576 16 | # Having non-zero Limit*s causes performance problems due to accounting overhead 17 | # in the kernel. We recommend using cgroups to do container-local accounting. 18 | LimitNPROC=infinity 19 | LimitCORE=infinity 20 | # Uncomment TasksMax if your systemd version supports it. 21 | # Only systemd 226 and above support this version. 22 | #TasksMax=infinity 23 | TimeoutStartSec=0 24 | # set delegate yes so that systemd does not reset the cgroups of docker containers 25 | Delegate=yes 26 | # kill only the docker process, not all processes in the cgroup 27 | KillMode=process 28 | # restart the docker process if it exits prematurely 29 | Restart=on-failure 30 | StartLimitBurst=3 31 | StartLimitInterval=60s 32 | 33 | [Install] 34 | WantedBy=multi-user.target 35 | -------------------------------------------------------------------------------- /packages.txt: -------------------------------------------------------------------------------- 1 | acpid 2 | adobe-source-code-pro-fonts 3 | adobe-source-han-sans-jp-fonts 4 | arc-gtk-theme 5 | aspell-en 6 | autoconf 7 | automake 8 | baobab 9 | bind-tools 10 | bison 11 | blueman 12 | bluez-utils 13 | cmake 14 | ctags 15 | cups 16 | dconf-editor 17 | docker-compose 18 | elfutils 19 | emacs 20 | eog 21 | exfat-utils 22 | feh 23 | file-roller 24 | firefox 25 | fish 26 | flex 27 | gdm 28 | gendesk 29 | gimp 30 | git 31 | gksu 32 | glide 33 | gnome-calculator 34 | gnome-dictionary 35 | gnome-disk-utility 36 | gnome-font-viewer 37 | gnome-screenshot 38 | gnome-shell-extensions 39 | gnome-system-log 40 | gnome-system-monitor 41 | gnome-terminal 42 | gnome-tweak-tool 43 | gnome-user-docs 44 | go 45 | go-tools 46 | gobject-introspection 47 | gperf 48 | grub 49 | gtk-doc 50 | gtkspell 51 | gucharmap 52 | httpie 53 | i3blocks 54 | iputils 55 | iw 56 | jfsutils 57 | libconfig 58 | libreoffice-fresh 59 | licenses 60 | linux-samus4 61 | logrotate 62 | macchanger 63 | maim 64 | make 65 | man-db 66 | man-pages 67 | mercurial 68 | mousetweaks 69 | mpg123 70 | nano 71 | netcdf 72 | netctl 73 | numix-gtk-theme 74 | opendesktop-fonts 75 | patch 76 | pavucontrol 77 | pkg-config 78 | pkgbuild-introspection 79 | python-virtualenv 80 | python2-babel 81 | python2-nautilus 82 | redshift 83 | sudo 84 | synergy 85 | tamsyn-font 86 | termite-terminfo 87 | the_silver_searcher 88 | tmux 89 | totem 90 | tree 91 | ttf-symbola 92 | usbutils 93 | vi 94 | vlc 95 | wget 96 | xdg-user-dirs-gtk 97 | xdotool 98 | xf86-video-intel 99 | xmlto 100 | xorg-util-macros 101 | xorg-xdpyinfo 102 | xorg-xev 103 | xorg-xinput 104 | xorg-xmodmap 105 | xorg-xwininfo 106 | xterm 107 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-nova/fish_right_prompt.fish: -------------------------------------------------------------------------------- 1 | # You can override some default right prompt options in your config.fish: 2 | # set -g theme_date_format "+%a %H:%M" 3 | 4 | function __bobthefish_cmd_duration -S -d 'Show command duration' 5 | [ "$theme_display_cmd_duration" = "no" ]; and return 6 | [ -z "$CMD_DURATION" -o "$CMD_DURATION" -lt 100 ]; and return 7 | 8 | if [ "$CMD_DURATION" -lt 5000 ] 9 | echo -ns $CMD_DURATION 'ms' 10 | else if [ "$CMD_DURATION" -lt 60000 ] 11 | math "scale=1;$CMD_DURATION/1000" | string replace -r '\\.0$' '' 12 | echo -n 's' 13 | else if [ "$CMD_DURATION" -lt 3600000 ] 14 | set_color $fish_color_error 15 | math "scale=1;$CMD_DURATION/60000" | string replace -r '\\.0$' '' 16 | echo -n 'm' 17 | else 18 | set_color $fish_color_error 19 | math "scale=2;$CMD_DURATION/3600000" | string replace -r '\\.0$' '' 20 | echo -n 'h' 21 | end 22 | 23 | set_color $fish_color_normal 24 | set_color $fish_color_autosuggestion 25 | 26 | [ "$theme_display_date" = "no" ] 27 | or echo -ns ' ' $__bobthefish_left_arrow_glyph 28 | end 29 | 30 | function __bobthefish_timestamp -S -d 'Show the current timestamp' 31 | [ "$theme_display_date" = "no" ]; and return 32 | set -q theme_date_format 33 | or set -l theme_date_format "+%c" 34 | 35 | echo -n ' ' 36 | date $theme_date_format 37 | end 38 | 39 | function fish_right_prompt -d 'bobthefish is all about the right prompt' 40 | set -l __bobthefish_left_arrow_glyph \uE0B3 41 | if [ "$theme_powerline_fonts" = "no" ] 42 | set __bobthefish_left_arrow_glyph '<' 43 | end 44 | 45 | set_color $fish_color_autosuggestion 46 | 47 | __bobthefish_cmd_duration 48 | __bobthefish_timestamp 49 | set_color normal 50 | end 51 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-bobthefish/fish_right_prompt.fish: -------------------------------------------------------------------------------- 1 | # You can override some default right prompt options in your config.fish: 2 | # set -g theme_date_format "+%a %H:%M" 3 | 4 | function __bobthefish_cmd_duration -S -d 'Show command duration' 5 | [ "$theme_display_cmd_duration" = "no" ]; and return 6 | [ -z "$CMD_DURATION" -o "$CMD_DURATION" -lt 100 ]; and return 7 | 8 | if [ "$CMD_DURATION" -lt 5000 ] 9 | echo -ns $CMD_DURATION 'ms' 10 | else if [ "$CMD_DURATION" -lt 60000 ] 11 | math "scale=1;$CMD_DURATION/1000" | string replace -r '\\.0$' '' 12 | echo -n 's' 13 | else if [ "$CMD_DURATION" -lt 3600000 ] 14 | set_color $fish_color_error 15 | math "scale=1;$CMD_DURATION/60000" | string replace -r '\\.0$' '' 16 | echo -n 'm' 17 | else 18 | set_color $fish_color_error 19 | math "scale=2;$CMD_DURATION/3600000" | string replace -r '\\.0$' '' 20 | echo -n 'h' 21 | end 22 | 23 | set_color $fish_color_normal 24 | set_color $fish_color_autosuggestion 25 | 26 | [ "$theme_display_date" = "no" ] 27 | or echo -ns ' ' $__bobthefish_left_arrow_glyph 28 | end 29 | 30 | function __bobthefish_timestamp -S -d 'Show the current timestamp' 31 | [ "$theme_display_date" = "no" ]; and return 32 | set -q theme_date_format 33 | or set -l theme_date_format "+%c" 34 | 35 | echo -n ' ' 36 | date $theme_date_format 37 | end 38 | 39 | function fish_right_prompt -d 'bobthefish is all about the right prompt' 40 | set -l __bobthefish_left_arrow_glyph \uE0B3 41 | if [ "$theme_powerline_fonts" = "no" ] 42 | set __bobthefish_left_arrow_glyph '<' 43 | end 44 | 45 | set_color $fish_color_autosuggestion 46 | 47 | __bobthefish_cmd_duration 48 | __bobthefish_timestamp 49 | set_color normal 50 | end 51 | -------------------------------------------------------------------------------- /scripts/i3blocks/wifi: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (C) 2014 Alexander Keller 3 | 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | 17 | #------------------------------------------------------------------------ 18 | 19 | INTERFACE="wlp1s0" 20 | 21 | #------------------------------------------------------------------------ 22 | 23 | # As per #36 -- It is transparent: e.g. if the machine has no battery or wireless 24 | # connection (think desktop), the corresponding block should not be displayed. 25 | [[ ! -d /sys/class/net/${INTERFACE}/wireless ]] || 26 | [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit 27 | 28 | #------------------------------------------------------------------------ 29 | 30 | QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }') 31 | 32 | #------------------------------------------------------------------------ 33 | 34 | echo $QUALITY% # full text 35 | echo $QUALITY% # short text 36 | 37 | # color 38 | if [[ $QUALITY -ge 80 ]]; then 39 | echo "#00FF00" 40 | elif [[ $QUALITY -lt 80 ]]; then 41 | echo "#FFF600" 42 | elif [[ $QUALITY -lt 60 ]]; then 43 | echo "#FFAE00" 44 | elif [[ $QUALITY -lt 40 ]]; then 45 | echo "#FF0000" 46 | fi 47 | 48 | -------------------------------------------------------------------------------- /.config/autostart/redshift-gtk.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name[es]=Redshift 3 | GenericName[es]=Ajuste de la temperatura de color 4 | GenericName[pl]=Dostosowanie temperatury barwowej 5 | Comment[lt]=Spalvos temperatūros reguliavimo įrankis 6 | Name[it]=Redshift 7 | Comment=Color temperature adjustment tool 8 | Name[tr]=Redshift 9 | Comment[es]=Herramienta para el ajuste de la temperatura de color 10 | Comment[fr]=Outil de réglage de la température de couleur 11 | Type=Application 12 | Comment[tr]=Renk sıcaklığı ayarlama aracı 13 | Comment[de]=Farbtemperatur Anpassungswerkzeug 14 | GenericName[nl]=Kleurtemperatuur aanpassing 15 | Terminal=false 16 | GenericName[hu]=Szín hőmérséklet beállítás 17 | Comment[pl]=Narzędzie do dostosowywania temperatury barwowej 18 | Name[zh_CN]=红移 19 | GenericName=Color temperature adjustment 20 | GenericName[fr]=Réglage de la température de couleur 21 | Comment[zh_CN]=色温调节工具 22 | Name[hu]=Redshift 23 | GenericName[it]=Regolazione della temperatura del colore 24 | Name[lt]=Redshift 25 | GenericName[zh_CN]=色温调节 26 | Comment[cs]=Nástroj pro přizpůsobení barevné teploty 27 | Comment[nl]=Kleurtemperatuur aanpassingsprogramma 28 | Comment[it]=Strumento per la regolazione della temperatura del colore 29 | StartupNotify=true 30 | Name[pl]=Redshift 31 | Name[ru]=Redshift 32 | Comment[ru]=Инструмент регулирования цветовой температуры 33 | Comment[da]=Justeringsværktøj for farvetemperatur 34 | GenericName[de]=Farbtemperatur Anpassung 35 | GenericName[da]=Justering af farvetemperatur 36 | Name[pt_BR]=Redshift 37 | Comment[hu]=Színhőmérséklet beállító eszköz 38 | Icon=redshift 39 | GenericName[ru]=Настройка цветовой температуры 40 | Exec=redshift-gtk 41 | Categories=Utility; 42 | Name[fr]=Redshift 43 | Version=1.0 44 | Name[de]=Redshift 45 | Hidden=true 46 | GenericName[tr]=Renk sıcaklığı ayarı 47 | Name=Redshift 48 | X-GNOME-Autostart-enabled=false 49 | GenericName[lt]=Spalvos temperatūros reguliavimas 50 | GenericName[cs]=Přizpůsobení barevné teploty 51 | 52 | -------------------------------------------------------------------------------- /.config/i3blocks/i3blocks.conf: -------------------------------------------------------------------------------- 1 | # i3blocks config file 2 | # 3 | # Please see man i3blocks for a complete reference! 4 | # The man page is also hosted at http://vivien.github.io/i3blocks 5 | # 6 | # List of valid properties: 7 | # 8 | # align 9 | # color 10 | # command 11 | # full_text 12 | # instance 13 | # interval 14 | # label 15 | # min_width 16 | # name 17 | # separator 18 | # separator_block_width 19 | # short_text 20 | # signal 21 | # urgent 22 | 23 | # Global properties 24 | # 25 | # The top properties below are applied to every block, but can be overridden. 26 | # Each block command defaults to the script name to avoid boilerplate. 27 | command=~/.config/i3blocks/scripts/$BLOCK_NAME 28 | separator=false 29 | separator_block_width=15 30 | markup=none 31 | #border_top=0 32 | #border_right=0 33 | #border_left=0 34 | #border_bottom=0 35 | #border=#e6e1dc 36 | 37 | # music 38 | # 39 | #[music] 40 | #interval=5 41 | 42 | # Used / 43 | # 44 | #[disk_space_used] 45 | #label=Root 46 | #instance=/ 47 | #interval=300 48 | 49 | #[wireless-config] 50 | #full_text= 51 | #command=echo  ;nm-connection-editor 52 | 53 | #[wireless] 54 | #command=/home/raphael/scripts/i3blocks/wifi 55 | #interval=10 56 | 57 | # volume 58 | # 59 | [volume] 60 | command=/home/raphael/scripts/i3blocks/volume -f3 61 | interval=once 62 | signal=1 63 | 64 | # CPU 65 | [cpu] 66 | label= 67 | #command=ps -A -o pcpu | tail -n+2 | paste -sd+ | bc | xargs printf '%s%%' 68 | command=NUMCPUS=`grep ^proc /proc/cpuinfo | wc -l`; FIRST=`cat /proc/stat | awk '/^cpu / {print $5}'`; sleep 1; SECOND=`cat /proc/stat | awk '/^cpu / {print $5}'`; USED=`echo 2 k 100 $SECOND $FIRST - $NUMCPUS / - p | dc | xargs printf '%03d' `; echo ${USED}% 69 | interval=3 70 | 71 | # Battery 72 | # 73 | [battery] 74 | command=/home/raphael/scripts/i3blocks/battery 75 | interval=5 76 | 77 | # Date 78 | # 79 | [date] 80 | label= 81 | command=date '+%a %b %d' 82 | interval=1000 83 | 84 | # Time 85 | # 86 | [time] 87 | label= 88 | command=date '+%H:%M' 89 | interval=5 90 | 91 | [shutdown] 92 | full_text= 93 | command=echo " "; /home/raphael/scripts/i3blocks/shutdown 94 | 95 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 4 | 5 | echo Setting up configs 6 | 7 | # SSH (first to fail fast if /mnt is not mounted) 8 | mkdir -p $HOME/.ssh 9 | cp /mnt/src/id_rsa $HOME/.ssh 10 | cp /mnt/src/id_rsa.pub $HOME/.ssh 11 | 12 | # Fonts 13 | mkdir -p $HOME/.config/fontconfig/conf.d 14 | rm -f $HOME/.config/fontconfig/conf.d/10-powerline-symbols.conf 15 | ln -s -r $DIR/.config/fontconfig/conf.d/10-powerline-symbols.conf $HOME/.config/fontconfig/conf.d 16 | 17 | # git setup 18 | rm -f $HOME/.gitconfig 19 | ln -s $DIR/.gitconfig $HOME/.gitconfig 20 | 21 | # docker 22 | sudo systemctl enable docker.service 23 | sudo cp $DIR/etc/systemd/system/docker.service /etc/systemd/system/docker.service 24 | 25 | # .Xresources (DPI + rofi) 26 | rm -f $HOME/.Xresources 27 | ln -s $DIR/.Xresources $HOME/.Xresources 28 | 29 | # Scripts 30 | rm -rf $HOME/scripts 31 | ln -s $DIR/scripts $HOME/scripts 32 | 33 | # Fish 34 | mkdir -p $HOME/.config/fish 35 | mv $HOME/.config/fish/config.fish $HOME/.config/fish/config.fish.bak > /dev/null || true 36 | ln -s $DIR/.config/fish/config.fish $HOME/.config/fish/config.fish 37 | 38 | # tmux.conf 39 | mv $HOME/.tmux.conf $HOME/.tmux.conf.bak > /dev/null || true 40 | ln -s $DIR/.tmux.conf $HOME/.tmux.conf 41 | 42 | # Enable italics in tmux 43 | tic $DIR/xterm-256color-italic.terminfo 44 | 45 | # i3 46 | mkdir -p $HOME/.config/i3 47 | mv $HOME/.config/i3/config $HOME/.config/i3/config.bak > /dev/null || true 48 | ln -s $DIR/.config/i3/config $HOME/.config/i3/config 49 | mkdir -p $HOME/.config/i3blocks 50 | mv $HOME/.config/i3blocks/i3blocks.conf $HOME/.config/i3blocks/i3blocks.conf.bak > /dev/null || true 51 | ln -s $DIR/.config/i3blocks/i3blocks.conf $HOME/.config/i3blocks/i3blocks.conf 52 | 53 | # Screen hotplug setup 54 | sudo cp $DIR/etc/systemd/system/hotplug.service /etc/systemd/system/hotplug.service 55 | sudo cp $DIR/etc/systemd/system/synergyc.service /etc/systemd/system/synergyc.service 56 | sudo cp $DIR/etc/udev/rules.d/95-monitor-hotplug.rules /etc/udev/rules.d 57 | sudo cp $DIR/etc/udev/rules.d/95-monitor-hotplug2.rules /etc/udev/rules.d 58 | sudo udevadm control --reload-rules 59 | -------------------------------------------------------------------------------- /scripts/i3blocks/battery: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -CS 2 | # 3 | # Copyright 2014 Pierre Mavro 4 | # Copyright 2014 Vivien Didelot 5 | # 6 | # Licensed under the terms of the GNU GPL v3, or any later version. 7 | # 8 | # This script is meant to use with i3blocks. It parses the output of the "acpi" 9 | # command (often provided by a package of the same name) to read the status of 10 | # the battery, and eventually its remaining time (to full charge or discharge). 11 | # 12 | # The color will gradually change for a percentage below 85%, and the urgency 13 | # (exit code 33) is set if there is less that 5% remaining. 14 | 15 | use strict; 16 | use warnings; 17 | use utf8; 18 | 19 | my $acpi; 20 | my $status; 21 | my $percent; 22 | my $full_text; 23 | my $short_text; 24 | my $bat_number = $ENV{BLOCK_INSTANCE} || 0; 25 | 26 | # read the first line of the "acpi" command output 27 | open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die; 28 | $acpi = ; 29 | close(ACPI); 30 | 31 | # fail on unexpected output 32 | if ($acpi !~ /: (\w+), (\d+)%/) { 33 | die "$acpi\n"; 34 | } 35 | 36 | $status = $1; 37 | $percent = $2; 38 | 39 | if ($status eq 'Discharging') { 40 | if ($percent < 10) { 41 | $full_text = ' '; 42 | } elsif ($percent < 25) { 43 | $full_text = ' '; 44 | } elsif ($percent < 50) { 45 | $full_text = ' '; 46 | } elsif ($percent < 75) { 47 | $full_text = ' '; 48 | } elsif ($percent < 100) { 49 | $full_text = ' '; 50 | } 51 | } elsif ($status eq 'Charging') { 52 | $full_text = ' '; 53 | } 54 | 55 | $full_text .= "$percent%"; 56 | $short_text = $full_text; 57 | 58 | if ($acpi =~ /(\d\d:\d\d):/) { 59 | $full_text .= " ($1)"; 60 | } 61 | 62 | # print text 63 | print "$full_text\n"; 64 | print "$short_text\n"; 65 | 66 | # consider color and urgent flag only on discharge 67 | if ($status eq 'Discharging') { 68 | 69 | if ($percent < 20) { 70 | print "#fb4934\n"; 71 | } elsif ($percent < 40) { 72 | print "#d65d0e\n"; 73 | } elsif ($percent < 60) { 74 | print "#d79921\n"; 75 | } elsif ($percent < 85) { 76 | print "#98971a\n"; 77 | } 78 | 79 | if ($percent < 5) { 80 | exit(33); 81 | } 82 | } 83 | 84 | exit(0); 85 | -------------------------------------------------------------------------------- /.config/fontconfig/conf.d/10-powerline-symbols.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | monospace 7 | PowerlineSymbols 8 | 9 | 10 | Droid Sans Mono 11 | PowerlineSymbols 12 | 13 | 14 | Droid Sans Mono Slashed 15 | PowerlineSymbols 16 | 17 | 18 | Droid Sans Mono Dotted 19 | PowerlineSymbols 20 | 21 | 22 | DejaVu Sans Mono 23 | PowerlineSymbols 24 | 25 | 26 | DejaVu Sans Mono 27 | PowerlineSymbols 28 | 29 | 30 | Envy Code R 31 | PowerlineSymbols 32 | 33 | 34 | Inconsolata 35 | PowerlineSymbols 36 | 37 | 38 | Lucida Console 39 | PowerlineSymbols 40 | 41 | 42 | Monaco 43 | PowerlineSymbols 44 | 45 | 46 | Pragmata 47 | PowerlineSymbols 48 | 49 | 50 | PragmataPro 51 | PowerlineSymbols 52 | 53 | 54 | Menlo 55 | PowerlineSymbols 56 | 57 | 58 | Source Code Pro 59 | PowerlineSymbols 60 | 61 | 62 | Consolas 63 | PowerlineSymbols 64 | 65 | 66 | Anonymous pro 67 | PowerlineSymbols 68 | 69 | 70 | Bitstream Vera Sans Mono 71 | PowerlineSymbols 72 | 73 | 74 | Liberation Mono 75 | PowerlineSymbols 76 | 77 | 78 | Ubuntu Mono 79 | PowerlineSymbols 80 | 81 | 82 | Meslo LG L 83 | PowerlineSymbols 84 | 85 | 86 | Meslo LG L DZ 87 | PowerlineSymbols 88 | 89 | 90 | Meslo LG M 91 | PowerlineSymbols 92 | 93 | 94 | Meslo LG M DZ 95 | PowerlineSymbols 96 | 97 | 98 | Meslo LG S 99 | PowerlineSymbols 100 | 101 | 102 | Meslo LG S DZ 103 | PowerlineSymbols 104 | 105 | 106 | -------------------------------------------------------------------------------- /scripts/i3blocks/volume: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Displays the default device, volume, and mute status for i3blocks 3 | 4 | AUDIO_HIGH_SYMBOL=' ' 5 | 6 | AUDIO_MED_THRESH=50 7 | AUDIO_MED_SYMBOL=' ' 8 | 9 | AUDIO_LOW_THRESH=0 10 | AUDIO_LOW_SYMBOL=' ' 11 | 12 | AUDIO_MUTED_SYMBOL=' ' 13 | 14 | DEFAULT_COLOR="#a89984" 15 | MUTED_COLOR="#7c6f64" 16 | 17 | LONG_FORMAT=0 18 | SHORT_FORMAT=2 19 | USE_PERCENT=1 20 | 21 | while getopts F:f:pH:M:L:T:t:C:c:h opt; do 22 | case "$opt" in 23 | F) LONG_FORMAT="$OPTARG" ;; 24 | f) SHORT_FORMAT="$OPTARG" ;; 25 | p) USE_PERCENT=0 ;; 26 | H) AUDIO_HIGH_SYMBOL="$OPTARG" ;; 27 | M) AUDIO_MED_SYMBOL="$OPTARG" ;; 28 | L) AUDIO_LOW_SYMBOL="$OPTARG" ;; 29 | X) AUDIO_MUTED_SYMBOL="$OPTARG" ;; 30 | T) AUDIO_MED_THRESH="$OPTARG" ;; 31 | t) AUDIO_LOW_THRESH="$OPTARG" ;; 32 | C) DEFAULT_COLOR="$OPTARG" ;; 33 | c) MUTED_COLOR="$OPTARG" ;; 34 | h) printf \ 35 | "Usage: volume-pulseaudio [-F format] [-f format] [-p] [-H symb] [-M symb] 36 | [-L symb] [-X symb] [-T thresh] [-t thresh] [-C color] [-c color] [-h] 37 | Options: 38 | -F, -f\tOutput format (-F long format, -f short format) to use, amonst: 39 | \t0\t symb vol [index:name]\t (default long) 40 | \t1\t symb vol [name] 41 | \t2\t symb vol [index]\t (default short) 42 | \t3\t symb vol 43 | -p\tOmit the percent sign (%%) in volume 44 | -H\tSymbol to use when audio level is high. Default: '$AUDIO_HIGH_SYMBOL' 45 | -M\tSymbol to use when audio level is medium. Default: '$AUDIO_MED_SYMBOL' 46 | -L\tSymbol to use when audio level is low. Default: '$AUDIO_LOW_SYMBOL' 47 | -X\tSymbol to use when audio is muted. Default: '$AUDIO_MUTED_SYMBOL' 48 | -T\tThreshold for medium audio level. Default: $AUDIO_MED_THRESH 49 | -t\tThreshold for low audio level. Default: $AUDIO_LOW_THRESH 50 | -C\tColor for non-muted audio. Default: $DEFAULT_COLOR 51 | -c\tColor for muted audio. Default: $MUTED_COLOR 52 | -h\tShow this help text 53 | " && exit 0;; 54 | esac 55 | done 56 | 57 | function set_default_playback_device_next { 58 | inc=${1:-1} 59 | num_devices=$(pacmd list-sinks | grep -c index:) 60 | sink_arr=($(pacmd list-sinks | grep index: | grep -o '[0-9]\+')) 61 | default_sink_index=$(( $(pacmd list-sinks | grep index: | grep -no '*' | grep -o '^[0-9]\+') - 1 )) 62 | default_sink_index=$(( ($default_sink_index + $num_devices + $inc) % $num_devices )) 63 | default_sink=${sink_arr[$default_sink_index]} 64 | pacmd set-default-sink $default_sink 65 | } 66 | 67 | case "$BLOCK_BUTTON" in 68 | 1) set_default_playback_device_next ;; 69 | 2) amixer -q -D pulse sset Master toggle ;; 70 | 3) set_default_playback_device_next -1 ;; 71 | 4) amixer -q -D pulse sset Master 5%+ ;; 72 | 5) amixer -q -D pulse sset Master 5%- ;; 73 | esac 74 | 75 | for name in INDEX NAME VOL MUTED; do 76 | read $name 77 | done < <(pacmd list-sinks | grep "index:\|name:\|volume: front\|muted:" | grep -A3 '*') 78 | INDEX=$(echo "$INDEX" | grep -o '[0-9]\+') 79 | VOL=$(echo "$VOL" | grep -o "[0-9]*%" | head -1 ) 80 | VOL="${VOL%?}" 81 | NAME=$(echo "$NAME" | sed 's/.*\.\(.*\)>/\1/') 82 | if [[ $MUTED =~ "no" ]] ; then 83 | SYMBOL=$AUDIO_HIGH_SYMBOL 84 | [[ $VOL -le $AUDIO_MED_THRESH ]] && SYMBOL=$AUDIO_MED_SYMBOL 85 | [[ $VOL -le $AUDIO_LOW_THRESH ]] && SYMBOL=$AUDIO_LOW_SYMBOL 86 | COLOR=$DEFAULT_COLOR 87 | else 88 | SYMBOL=$AUDIO_MUTED_SYMBOL 89 | COLOR=$MUTED_COLOR 90 | fi 91 | 92 | function print_format { 93 | PERCENT="%" 94 | [[ $USE_PERCENT == 0 ]] && PERCENT="" 95 | case "$1" in 96 | 1) echo "$SYMBOL$VOL$PERCENT [$NAME]" ;; 97 | 2) echo "$SYMBOL$VOL$PERCENT [$INDEX]";; 98 | 3) echo "$SYMBOL$VOL$PERCENT" ;; 99 | *) echo "$SYMBOL$VOL$PERCENT [$INDEX:$NAME]" ;; 100 | esac 101 | } 102 | 103 | print_format "$SHORT_FORMAT" 104 | print_format "$LONG_FORMAT" 105 | echo "$COLOR" 106 | -------------------------------------------------------------------------------- /scripts/i3blocks/shutdown: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Use rofi/zenity to change system runstate thanks to systemd. 4 | # 5 | # Note: this currently relies on associative array support in the shell. 6 | # 7 | # Inspired from i3pystatus wiki: 8 | # https://github.com/enkore/i3pystatus/wiki/Shutdown-Menu 9 | # 10 | # Copyright 2015 Benjamin Chrétien 11 | # 12 | # This program is free software: you can redistribute it and/or modify 13 | # it under the terms of the GNU General Public License as published by 14 | # the Free Software Foundation, either version 3 of the License, or 15 | # (at your option) any later version. 16 | 17 | # This program is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | # GNU General Public License for more details. 21 | 22 | # You should have received a copy of the GNU General Public License 23 | # along with this program. If not, see . 24 | 25 | ####################################################################### 26 | # BEGIN CONFIG # 27 | ####################################################################### 28 | 29 | # Use a custom lock script 30 | #LOCKSCRIPT="i3lock-extra -m pixelize" 31 | 32 | # Colors: FG (foreground), BG (background), HL (highlighted) 33 | FG_COLOR="#bbbbbb" 34 | BG_COLOR="#111111" 35 | HLFG_COLOR="#111111" 36 | HLBG_COLOR="#bbbbbb" 37 | BORDER_COLOR="#222222" 38 | 39 | # Options not related to colors 40 | ROFI_TEXT="Menu:" 41 | ROFI_OPTIONS="-width -11 -location 3 -hide-scrollbar -bw 2" 42 | 43 | # Zenity options 44 | ZENITY_TITLE="Menu" 45 | ZENITY_TEXT="Action:" 46 | ZENITY_OPTIONS="--column= --hide-header" 47 | 48 | ####################################################################### 49 | # END CONFIG # 50 | ####################################################################### 51 | 52 | # Whether to ask for user's confirmation 53 | enable_confirmation=false 54 | 55 | # Preferred launcher if both are available 56 | preferred_launcher="rofi" 57 | 58 | usage="$(basename "$0") [-h] [-c] [-p name] -- display a menu for shutdown, reboot, lock etc. 59 | 60 | where: 61 | -h show this help text 62 | -c ask for user confirmation 63 | -p preferred launcher (rofi or zenity) 64 | 65 | This script depends on: 66 | - systemd, 67 | - i3, 68 | - rofi or zenity." 69 | 70 | # Check whether the user-defined launcher is valid 71 | launcher_list=(rofi zenity) 72 | function check_launcher() { 73 | if [[ ! "${launcher_list[@]}" =~ (^|[[:space:]])"$1"($|[[:space:]]) ]]; then 74 | echo "Supported launchers: ${launcher_list[*]}" 75 | exit 1 76 | else 77 | # Get array with unique elements and preferred launcher first 78 | # Note: uniq expects a sorted list, so we cannot use it 79 | i=1 80 | launcher_list=($(for l in "$1" "${launcher_list[@]}"; do printf "%i %s\n" "$i" "$l"; let i+=1; done \ 81 | | sort -uk2 | sort -nk1 | cut -d' ' -f2- | tr '\n' ' ')) 82 | fi 83 | } 84 | 85 | # Parse CLI arguments 86 | while getopts "hcp:" option; do 87 | case "${option}" in 88 | h) echo "${usage}" 89 | exit 0 90 | ;; 91 | c) enable_confirmation=true 92 | ;; 93 | p) preferred_launcher="${OPTARG}" 94 | check_launcher "${preferred_launcher}" 95 | ;; 96 | *) exit 1 97 | ;; 98 | esac 99 | done 100 | 101 | # Check whether a command exists 102 | function command_exists() { 103 | command -v "$1" &> /dev/null 2>&1 104 | } 105 | 106 | # systemctl required 107 | if ! command_exists systemctl ; then 108 | exit 1 109 | fi 110 | 111 | # menu defined as an associative array 112 | typeset -A menu 113 | 114 | # Menu with keys/commands 115 | menu=( 116 | [Shutdown]="systemctl poweroff" 117 | [Reboot]="systemctl reboot" 118 | [Hibernate]="systemctl hibernate" 119 | [Suspend]="systemctl suspend" 120 | [Halt]="systemctl halt" 121 | [Lock]="${LOCKSCRIPT:-i3lock --color=${BG_COLOR#"#"}}" 122 | [Logout]="i3-msg exit" 123 | [Cancel]="" 124 | ) 125 | menu_nrows=${#menu[@]} 126 | 127 | # Menu entries that may trigger a confirmation message 128 | menu_confirm="Shutdown Reboot Hibernate Suspend Halt Logout" 129 | 130 | launcher_exe="" 131 | launcher_options="" 132 | rofi_colors="" 133 | 134 | function prepare_launcher() { 135 | if [[ "$1" == "rofi" ]]; then 136 | rofi_colors="-bc ${BORDER_COLOR} -bg ${BG_COLOR} -fg ${FG_COLOR} \ 137 | -hlfg ${HLFG_COLOR} -hlbg ${HLBG_COLOR}" 138 | launcher_exe="rofi" 139 | launcher_options="-dmenu -i -lines ${menu_nrows} -p ${ROFI_TEXT} \ 140 | ${rofi_colors} ${ROFI_OPTIONS}" 141 | elif [[ "$1" == "zenity" ]]; then 142 | launcher_exe="zenity" 143 | launcher_options="--list --title=${ZENITY_TITLE} --text=${ZENITY_TEXT} \ 144 | ${ZENITY_OPTIONS}" 145 | fi 146 | } 147 | 148 | for l in "${launcher_list[@]}"; do 149 | if command_exists "${l}" ; then 150 | prepare_launcher "${l}" 151 | break 152 | fi 153 | done 154 | 155 | # No launcher available 156 | if [[ -z "${launcher_exe}" ]]; then 157 | exit 1 158 | fi 159 | 160 | launcher="${launcher_exe} ${launcher_options}" 161 | selection="$(printf '%s\n' "${!menu[@]}" | sort | ${launcher})" 162 | 163 | function ask_confirmation() { 164 | if [ "${launcher_exe}" == "rofi" ]; then 165 | confirmed=$(echo -e "Yes\nNo" | rofi -dmenu -i -lines 2 -p "${selection}?" \ 166 | ${rofi_colors} ${ROFI_OPTIONS}) 167 | [ "${confirmed}" == "Yes" ] && confirmed=0 168 | elif [ "${launcher_exe}" == "zenity" ]; then 169 | zenity --question --text "Are you sure you want to ${selection,,}?" 170 | confirmed=$? 171 | fi 172 | 173 | if [ "${confirmed}" == 0 ]; then 174 | i3-msg -q "exec ${menu[${selection}]}" 175 | fi 176 | } 177 | 178 | if [[ $? -eq 0 && ! -z ${selection} ]]; then 179 | if [[ "${enable_confirmation}" = true && \ 180 | ${menu_confirm} =~ (^|[[:space:]])"${selection}"($|[[:space:]]) ]]; then 181 | ask_confirmation 182 | else 183 | i3-msg -q "exec ${menu[${selection}]}" 184 | fi 185 | fi 186 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | # 0 is too far from ` ;) 2 | set -g base-index 1 3 | 4 | # Automatically set window title 5 | set-window-option -g automatic-rename on 6 | set-option -g set-titles on 7 | # Add truecolor support 8 | set-option -ga terminal-overrides ",xterm-256color:Tc" 9 | 10 | # Add italics support 11 | set -g default-terminal "xterm-256color-italic" 12 | 13 | setw -g mode-keys vi 14 | # emacs key bindings in tmux command prompt (prefix + :) are better than 15 | # vi keys, even for vim users 16 | #set -g status-keys emacs 17 | 18 | # remap prefix from 'C-b' to 'M-a' 19 | unbind C-b 20 | set-option -g prefix M-a 21 | bind-key M-a send-prefix 22 | 23 | # address vim mode switching delay (http://superuser.com/a/252717/65504) 24 | set -s escape-time 0 25 | 26 | # Update status every second 27 | set -g status-interval 1 28 | 29 | # increase scrollback buffer size 30 | set -g history-limit 50000 31 | 32 | # focus events enabled for terminals that support them 33 | set -g focus-events on 34 | 35 | # super useful when using "grouped sessions" and multi-monitor setup 36 | setw -g aggressive-resize on 37 | 38 | # easier and faster switching between next/prev window 39 | bind -n M-left previous-window 40 | bind -n M-right next-window 41 | 42 | bind-key v split-window -h 43 | bind-key s split-window -v 44 | 45 | bind-key -n M-S-Left swap-window -t -1 46 | bind-key -n M-S-Right swap-window -t +1 47 | 48 | # copy/paste vi style 49 | # bind-key -T copy-mode-vi v send-keys -X begin-selection 50 | # bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel 51 | # bind-key -T copy-mode-vi c send-keys -X copy-pipe "xclip -se c -i" 52 | 53 | # switch panes using Ctrl-arrow without prefix 54 | bind -n C-Left select-pane -L 55 | bind -n C-Right select-pane -R 56 | bind -n C-Up select-pane -U 57 | bind -n C-Down select-pane -D 58 | bind -n M-h select-pane -L 59 | bind -n M-l select-pane -R 60 | bind -n M-k select-pane -U 61 | bind -n M-j select-pane -D 62 | 63 | # reload config file (change file location to your the tmux.conf you want to use) 64 | bind R source-file ~/.tmux.conf 65 | 66 | # clear history 67 | bind -n C-k clear-history 68 | 69 | # Mouse mode 70 | set -g mouse on 71 | 72 | # Plugins 73 | set -g @plugin 'tmux-plugins/tpm' 74 | set -g @plugin 'tmux-plugins/tmux-prefix-highlight' 75 | set -g @prefix_highlight_show_copy_mode 'on' 76 | set -g @plugin 'tmux-plugins/tmux-copycat' 77 | set -g @plugin 'tmux-plugins/tmux-cpu' 78 | set -g @plugin 'tmux-plugins/tmux-open' 79 | set -g @plugin 'tmux-plugins/tmux-yank' 80 | 81 | set -g @prefix_highlight_fg 'black' 82 | set -g @prefix_highlight_bg 'yellow' 83 | 84 | # Disable bar entirely 85 | set -g status "off" 86 | 87 | #set -g status-justify "left" 88 | #set -g status-left-length "100" 89 | #set -g status-right-length "100" 90 | #set -g status-right-attr "none" 91 | #set -g status-attr "none" 92 | #set -g status-left-attr "none" 93 | #setw -g window-status-separator "" 94 | 95 | # DARK 96 | #set -g pane-active-border-fg "colour248" 97 | #set -g pane-border-fg "colour238" 98 | #set -g status-bg "colour237" 99 | #set -g message-fg "colour237" 100 | #set -g message-bg "colour248" 101 | #set -g message-command-fg "colour237" 102 | #set -g message-command-bg "colour248" 103 | #setw -g window-status-fg "colour237" 104 | #setw -g window-status-bg "colour142" 105 | #setw -g window-status-attr "none" 106 | #setw -g window-status-activity-bg "colour237" 107 | #setw -g window-status-activity-attr "none" 108 | #setw -g window-status-activity-fg "colour248" 109 | 110 | #set -g status-left "#[fg=colour248,bg=colour241] #S #[fg=colour241,bg=colour237,nobold,nounderscore,noitalics]" 111 | #set -g status-right "#[fg=colour239,bg=colour237,nobold,nounderscore,noitalics]#[fg=colour246,bg=colour239] %m/%d #[fg=colour248,bg=colour239,nobold,nounderscore,noitalics]#[fg=colour237,bg=colour248] %H:%M " 112 | #setw -g window-status-format "#[fg=colour237,bg=colour239,noitalics]#[fg=colour223,bg=colour239] #I #[fg=colour223,bg=colour239] #W #[fg=colour239,bg=colour237,noitalics]" 113 | #setw -g window-status-current-format "#[fg=colour239,bg=colour248,:nobold,nounderscore,noitalics]#[fg=colour239,bg=colour142] #I #[fg=colour239,bg=colour142,bold] #W #[fg=colour142,bg=colour237,nobold,nounderscore,noitalics]" 114 | 115 | # DARK -> LIGHT s# 116 | # 142 -> 100 1 117 | # 223 -> 237 x5 118 | # 237 -> 223 x5 119 | # 238 -> 251 2 120 | # 239 -> 250 3 121 | # 241 -> 248 x6 122 | # 246 -> 243 4 123 | # 248 -> 241 x6 124 | 125 | # LIGHT 126 | #set -g pane-active-border-fg "colour241" 127 | #set -g pane-border-fg "colour251" 128 | #set -g status-bg "colour223" 129 | #set -g message-fg "colour223" 130 | #set -g message-bg "colour241" 131 | #set -g message-command-fg "colour223" 132 | #set -g message-command-bg "colour241" 133 | #setw -g window-status-fg "colour223" 134 | #setw -g window-status-bg "colour100" 135 | #setw -g window-status-attr "none" 136 | #setw -g window-status-activity-bg "colour223" 137 | #setw -g window-status-activity-attr "none" 138 | #setw -g window-status-activity-fg "colour241" 139 | 140 | #set -g status-left "#[fg=colour241,bg=colour248] #S #[fg=colour248,bg=colour223,nobold,nounderscore,noitalics]" 141 | #set -g status-right "#[fg=colour250,bg=colour223,nobold,nounderscore,noitalics]#[fg=colour243,bg=colour250] %m/%d #[fg=colour241,bg=colour250,nobold,nounderscore,noitalics]#[fg=colour223,bg=colour241] %H:%M " 142 | #setw -g window-status-format "#[fg=colour223,bg=colour250,noitalics]#[fg=colour237,bg=colour250] #I #[fg=colour237,bg=colour250] #W #[fg=colour250,bg=colour223,noitalics]" 143 | #setw -g window-status-current-format "#[fg=colour250,bg=colour241,:nobold,nounderscore,noitalics]#[fg=colour250,bg=colour100] #I #[fg=colour250,bg=colour100,bold] #W #[fg=colour100,bg=colour223,nobold,nounderscore,noitalics]" 144 | 145 | # PAPER 146 | #set -g status-bg 'colour235' 147 | #set -g message-command-fg 'colour222' 148 | #set -g status-justify 'centre' 149 | #set -g status-left-length '100' 150 | #set -g status 'on' 151 | #set -g pane-active-border-fg 'colour154' 152 | #set -g message-bg 'colour238' 153 | #set -g status-right-length '100' 154 | #set -g status-right-attr 'none' 155 | #set -g message-fg 'colour222' 156 | #set -g message-command-bg 'colour238' 157 | #set -g status-attr 'none' 158 | #set -g pane-border-fg 'colour238' 159 | #set -g status-left-attr 'none' 160 | #setw -g window-status-fg 'colour121' 161 | #setw -g window-status-attr 'none' 162 | #setw -g window-status-activity-bg 'colour235' 163 | #setw -g window-status-activity-attr 'none' 164 | #setw -g window-status-activity-fg 'colour154' 165 | #setw -g window-status-separator '' 166 | #setw -g window-status-bg 'colour235' 167 | #set -g status-left '#[fg=colour232,bg=colour154] #S #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #W #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] #(whoami)  #(uptime | cut -d " " -f 1,2,3) #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]' 168 | #set -g status-right '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour121,bg=colour235] %r  %a  %Y #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #H #[fg=colour154,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour232,bg=colour154] #(rainbarf --battery --remaining --no-rgb) ' 169 | #setw -g window-status-format '#[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]#[default] #I  #W #[fg=colour235,bg=colour235,nobold,nounderscore,noitalics]' 170 | #setw -g window-status-current-format '#[fg=colour235,bg=colour238,nobold,nounderscore,noitalics]#[fg=colour222,bg=colour238] #I  #W  #F #[fg=colour238,bg=colour235,nobold,nounderscore,noitalics]' 171 | # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) 172 | run '~/.tmux/plugins/tpm/tpm' 173 | 174 | -------------------------------------------------------------------------------- /.config/i3/config: -------------------------------------------------------------------------------- 1 | # i3 config file (v4) 2 | # Windows key on most keyboards 3 | set $mod Mod1 4 | 5 | font pango:Myriad Pro Regular 12 6 | 7 | # gaps 8 | #smart_gaps on 9 | #gaps inner 0 10 | #gaps outer 0 11 | 12 | # Meta key bindings 13 | # Move window with mod+mouse drag 14 | floating_modifier $mod 15 | 16 | # Let popup on top of fullscreen windows 17 | popup_during_fullscreen leave_fullscreen 18 | 19 | # Kill focused window with mod+shift+q 20 | bindsym $mod+Shift+q kill 21 | 22 | # Toggle fullscreen with mod+f 23 | bindsym $mod+f fullscreen 24 | 25 | # change focus with mod+hjkl 26 | bindsym $mod+h focus left 27 | bindsym $mod+j focus down 28 | bindsym $mod+k focus up 29 | bindsym $mod+l focus right 30 | 31 | # move with mod+shift+hjkl 32 | bindsym $mod+Shift+h move left 33 | bindsym $mod+Shift+j move down 34 | bindsym $mod+Shift+k move up 35 | bindsym $mod+Shift+l move right 36 | 37 | # switch to workspace with mod+12345678 38 | bindsym $mod+1 workspace 1 39 | bindsym $mod+2 workspace 2 40 | bindsym $mod+3 workspace 3 41 | bindsym $mod+4 workspace 4 42 | bindsym $mod+5 workspace 5 43 | bindsym $mod+6 workspace 6 44 | bindsym $mod+7 workspace 7 45 | bindsym $mod+8 workspace 8 46 | 47 | # move container to workspace with meta+shift+12345678 48 | bindsym $mod+Shift+1 move container to workspace 1 49 | bindsym $mod+Shift+2 move container to workspace 2 50 | bindsym $mod+Shift+3 move container to workspace 3 51 | bindsym $mod+Shift+4 move container to workspace 4 52 | bindsym $mod+Shift+5 move container to workspace 5 53 | bindsym $mod+Shift+6 move container to workspace 6 54 | bindsym $mod+Shift+7 move container to workspace 7 55 | bindsym $mod+Shift+8 move container to workspace 8 56 | 57 | # move workspace to output with $mod+[] 58 | bindsym $mod+bracketleft move workspace to output left 59 | bindsym $mod+bracketright move workspace to output right 60 | 61 | # brightness 62 | bindsym Shift+F6 exec brightness --decrease 63 | bindsym Shift+F7 exec brightness --increase 64 | bindsym $mod+F6 exec keyboard_led --decrease 65 | bindsym $mod+F7 exec keyboard_led --increase 66 | 67 | # Change layouts with mod+,./ 68 | bindsym $mod+comma layout stacking 69 | bindsym $mod+period layout tabbed 70 | bindsym $mod+slash layout toggle split 71 | # split in horizontal orientation 72 | bindsym $mod+shift+v split h 73 | # split in vertical orientation 74 | bindsym $mod+v split v 75 | # Toggle floating with mod+shift+space 76 | bindsym $mod+Shift+space floating toggle 77 | # Swap focus between tiling windows and floating windows 78 | bindsym $mod+space focus mode_toggle 79 | # Move windows in and out of the scratchpad with mod+(shift)+t 80 | bindsym $mod+Shift+t move scratchpad 81 | bindsym $mod+t scratchpad show 82 | # Cycle through border styles with mod+b 83 | bindsym $mod+b border toggle 84 | # restart i3 inplace with mod+shift+r 85 | bindsym $mod+Shift+r restart 86 | # Focus parent container 87 | bindsym $mod+p focus parent 88 | 89 | ## Apps 90 | #bindsym $mod+Return exec gnome-terminal 91 | bindsym $mod+Return exec terminator 92 | #bindsym $mod+Shift+Return exec gnome-terminal --window-with-profile=HiDPI 93 | bindsym $mod+Shift+Return exec terminator -l HiDPI 94 | bindsym $mod+Ctrl+s exec gnome-screenshot 95 | bindsym $mod+e exec emacs 96 | bindsym $mod+c exec google-chrome-stable 97 | bindsym $mod+n exec nautilus 98 | 99 | # Window switcher / App launcher 100 | bindsym $mod+Tab exec rofi -show window 101 | bindsym $mod+shift+d exec rofi -show drun 102 | bindsym $mod+d exec rofi -show run 103 | 104 | # Volume 105 | bindsym Shift+F8 exec amixer -q -D pulse sset Master toggle && pkill -RTMIN+1 i3blocks 106 | bindsym Shift+F9 exec amixer -q -D pulse sset Master 5%- && pkill -RTMIN+1 i3blocks 107 | bindsym Shift+F10 exec amixer -q -D pulse sset Master 5%+ && pkill -RTMIN+1 i3blocks 108 | bindsym $mod+F8 exec "pactl set-source-mute 0 toggle; /home/raphael/scripts/volnot --mic" 109 | bindsym $mod+F9 exec "pactl set-source-volume 0 -2%; /home/raphael/scripts/volnot --mic" 110 | bindsym $mod+F10 exec "pactl set-source-volume 0 +2%; /home/raphael/scripts/volnot --mic" 111 | 112 | # volume controls (special keys on keyboard) 113 | bindsym XF86AudioMute exec pa-adjust mute 114 | bindsym XF86AudioLowerVolume exec pa-adjust minus 115 | bindsym XF86AudioRaiseVolume exec pa-adjust plus 116 | bindsym $mod+XF86AudioLowerVolume exec pa-adjust seekb 117 | bindsym $mod+XF86AudioRaiseVolume exec pa-adjust seekf 118 | bindsym $mod+Shift+XF86AudioLowerVolume exec pa-adjust seekbb 119 | bindsym $mod+Shift+XF86AudioRaiseVolume exec pa-adjust seekff 120 | 121 | # music controls (special keys on keyboard) 122 | bindsym XF86AudioNext exec stewdio skip 123 | bindsym XF86AudioPlay exec stewdio play 124 | bindsym XF86AudioPrev exec stewdio dmenu-search 125 | bindsym $mod+XF86AudioPlay exec stewdio qfav 126 | bindsym $mod+XF86AudioNext exec stewdio dmenu-queue 127 | 128 | # Set primary output for applets 129 | exec --no-startup-id xrandr --output eDP1 --primary 130 | exec --no-startup-id xrandr --output DP2 --auto --left-of eDP1 131 | 132 | # COMPTON!!! 133 | # exec --no-startup-id compton 134 | 135 | # Enable touchpad tap 136 | exec --no-startup-id xinput set-prop 9 276 1 137 | 138 | # Accel 139 | exec --no-startup-id xinput set-prop 9 284 0.6 140 | 141 | # Enable natural scrolling 142 | exec --no-startup-id xinput set-prop 9 286 1 143 | 144 | # Enable middle emulation 145 | exec --no-startup-id xinput set-prop 9 296 1 146 | 147 | # Make sure laptop screen is primary output (for hidpi) 148 | exec --no-startup-id xrandr --output eDP1 --primary 149 | 150 | # Redshift 151 | exec --no-startup-id redshift 152 | 153 | # Background 154 | exec --no-startup-id sh ~/.fehbg 155 | 156 | # Background 157 | exec --no-startup-id nm-applet 158 | 159 | # Init volume indicator 160 | exec --no-startup-id pkill -RTMIN+1 i3blocks 161 | 162 | # CPU usage 163 | exec --no-startup-id nc-indicators 164 | 165 | # Synergy 166 | exec --no-startup-id syne 167 | 168 | # Slim border 169 | #new_window pixel 0 170 | 171 | # Lock 172 | bindsym Mod4+l exec "i3lock" 173 | 174 | # Gaps 175 | #set $mode_gaps Gaps: (o) outer, (i) inner 176 | #set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global) 177 | #set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global) 178 | #bindsym $mod+Shift+g mode "$mode_gaps" 179 | 180 | #mode --pango_markup "$mode_gaps" { 181 | # bindsym o mode "$mode_gaps_outer" 182 | # bindsym i mode "$mode_gaps_inner" 183 | # bindsym Return mode "default" 184 | # bindsym Escape mode "default" 185 | #} 186 | 187 | #mode "$mode_gaps_inner" { 188 | # bindsym plus gaps inner current plus 5 189 | # bindsym minus gaps inner current minus 5 190 | # bindsym 0 gaps inner current set 0 191 | # 192 | # bindsym Shift+plus gaps inner all plus 5 193 | # bindsym Shift+minus gaps inner all minus 5 194 | # bindsym Shift+0 gaps inner all set 0 195 | # 196 | # bindsym Return mode "default" 197 | # bindsym Escape mode "default" 198 | #} 199 | #mode "$mode_gaps_outer" { 200 | # bindsym plus gaps outer current plus 5 201 | # bindsym minus gaps outer current minus 5 202 | # bindsym 0 gaps outer current set 0 203 | # 204 | # bindsym Shift+plus gaps outer all plus 5 205 | # bindsym Shift+minus gaps outer all minus 5 206 | # bindsym Shift+0 gaps outer all set 0 207 | # 208 | # bindsym Return mode "default" 209 | # bindsym Escape mode "default" 210 | #} 211 | 212 | # bar 213 | # workspace_auto_back_and_forth yes 214 | #hide_edge_borders both 215 | 216 | for_window [class="^.*"] border pixel 1 217 | for_window [window_role="pop-up"] floating enable 218 | for_window [window_role="task_dialog"] floating enable 219 | 220 | # Blueman 221 | for_window [class="Blueman-manager"] floating enable 222 | exec --no-startup-id /usr/bin/blueman-applet # Bluetooth Manager 223 | 224 | # Colors 225 | set $fg #ebdbb2 226 | set $bold #fbf1c7 227 | set $bg #282828 228 | set $black #1d2021 229 | set $red #cc241d 230 | set $green #98971a 231 | set $bright_green #b8bb26 232 | set $yellow #d79921 233 | set $blue #458588 234 | set $magenta #b16286 235 | set $cyan #689d6a 236 | set $white #a89984 237 | set $muted #7c6f64 238 | 239 | set $primary $fg 240 | set $secondary $green 241 | set $tertiary $cyan 242 | set $bar_bg $cyan 243 | 244 | # Border Background Text Indicator Child 245 | client.focused $green $green $bold $green $green 246 | client.focused_inactive $bg $black $white $green $muted 247 | client.unfocused $bg $black $white $green $bg 248 | client.urgent $bg $black $white $white $red 249 | 250 | #bar { 251 | #strip_workspace_numbers yes 252 | #status_command i3blocks -c ~/.config/i3blocks/i3blocks.conf 253 | #i3bar_command i3bar 254 | #colors { 255 | #background $bar_bg 256 | #statusline $white 257 | ## Border Background Text 258 | #focused_workspace $bar_bg $bar_bg $bright_green 259 | #active_workspace $bar_bg $bar_bg $yellow 260 | #inactive_workspace $bar_bg $bar_bg $muted 261 | #} 262 | #tray_output none 263 | #position top 264 | #output DP2 265 | ##mode hide 266 | ##font pango:Myriad Pro Regular Condensed 6.5 267 | #font pango:Myriad Pro Regular Condensed 12 268 | #} 269 | 270 | #bar { 271 | #strip_workspace_numbers yes 272 | #status_command i3blocks -c ~/.config/i3blocks/i3blocks.conf 273 | #i3bar_command i3bar 274 | #colors { 275 | #background $bar_bg 276 | #statusline $white 277 | ## Border Background Text 278 | #focused_workspace $bar_bg $bar_bg $bright_green 279 | #active_workspace $bar_bg $bar_bg $yellow 280 | #inactive_workspace $bar_bg $bar_bg $muted 281 | #} 282 | #tray_output primary 283 | #position top 284 | #output eDP1 285 | ##mode hide 286 | ##font pango:Myriad Pro Regular Condensed 10 287 | #font pango:Myriad Pro Regular Condensed 20 288 | #} 289 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-nova/README.md: -------------------------------------------------------------------------------- 1 | # bobthefish 2 | 3 | `bobthefish` is a Powerline-style, Git-aware [fish][fish] theme optimized for awesome. 4 | 5 | [![Oh My Fish](https://img.shields.io/badge/Framework-Oh_My_Fish-blue.svg?style=flat)](https://github.com/oh-my-fish/oh-my-fish) [![MIT License](https://img.shields.io/github/license/oh-my-fish/theme-bobthefish.svg?style=flat)](/LICENSE.md) 6 | 7 | ![bobthefish][screencast] 8 | 9 | 10 | ### Installation 11 | 12 | Be sure to have Oh My Fish installed. Then just: 13 | 14 | omf install bobthefish 15 | 16 | You will need a [Powerline-patched font][patching] for this to work, unless you enable the compatibility fallback option: 17 | 18 | set -g theme_powerline_fonts no 19 | 20 | [I recommend picking one of these][fonts]. For more advanced awesome, install a [nerd fonts patched font][nerd-fonts], and enable nerd fonts support: 21 | 22 | set -g theme_nerd_fonts yes 23 | 24 | This theme is based loosely on [agnoster][agnoster]. 25 | 26 | 27 | ### Features 28 | 29 | * A helpful, but not too distracting, greeting. 30 | * A subtle timestamp hanging out off to the right. 31 | * Powerline-style visual hotness. 32 | * More colors than you know what to do with. 33 | * An abbreviated path which doesn't abbreviate the name of the current project. 34 | * All the things you need to know about Git in a glance. 35 | * Visual indication that you can't write to the current directory. 36 | 37 | 38 | ### The Prompt 39 | 40 | * Flags: 41 | * Previous command failed (**`!`**) 42 | * Background jobs (**`%`**) 43 | * You currently have superpowers (**`$`**) 44 | * Current vi mode 45 | * `User@Host` (unless you're the default user) 46 | * Current RVM, rbenv or chruby (Ruby) version 47 | * Current virtualenv (Python) version 48 | * _If you use virtualenv, you will probably need to disable the default virtualenv prompt, since it doesn't play nice with fish: `set -x VIRTUAL_ENV_DISABLE_PROMPT 1`_ 49 | * Abbreviated parent directory 50 | * Current directory, or Git or Mercurial project name 51 | * Current project's repo branch (branch-glyph master) or detached head (`➦` d0dfd9b) 52 | * Git or Mercurial status, via colors and flags: 53 | * Dirty working directory (**`*`**) 54 | * Untracked files (**`…`**) 55 | * Staged changes (**`~`**) 56 | * Stashed changes (**`$`**) 57 | * Unpulled commits (**`-`**) 58 | * Unpushed commits (**`+`**) 59 | * Unpulled _and_ unpushed commits (**`±`**) 60 | * _Note that not all of these have been implemented for hg yet :)_ 61 | * Abbreviated project-relative path 62 | 63 | 64 | ### Configuration 65 | 66 | You can override some of the following default options in your `config.fish`: 67 | 68 | ```fish 69 | set -g theme_display_git no 70 | set -g theme_display_git_untracked no 71 | set -g theme_display_git_ahead_verbose yes 72 | set -g theme_git_worktree_support yes 73 | set -g theme_display_vagrant yes 74 | set -g theme_display_docker_machine no 75 | set -g theme_display_hg yes 76 | set -g theme_display_virtualenv no 77 | set -g theme_display_ruby no 78 | set -g theme_display_user yes 79 | set -g theme_display_vi no 80 | set -g theme_display_date no 81 | set -g theme_display_cmd_duration yes 82 | set -g theme_title_display_process yes 83 | set -g theme_title_display_path no 84 | set -g theme_title_display_user yes 85 | set -g theme_title_use_abbreviated_path no 86 | set -g theme_date_format "+%a %H:%M" 87 | set -g theme_avoid_ambiguous_glyphs yes 88 | set -g theme_powerline_fonts no 89 | set -g theme_nerd_fonts yes 90 | set -g theme_show_exit_status yes 91 | set -g default_user your_normal_user 92 | set -g theme_color_scheme dark 93 | set -g fish_prompt_pwd_dir_length 0 94 | set -g theme_project_dir_length 1 95 | ``` 96 | 97 | **Title options** 98 | 99 | - `theme_title_display_process`. By default theme doesn't show current process name in terminal title. If you want to show it, just set to `yes`. 100 | - `theme_title_display_path`. Use `no` to hide current working directory from title. 101 | - `theme_title_display_user`. Set to `yes` to show the current user in the tab title (unless you're the default user). 102 | - `theme_title_use_abbreviated_path`. Default is `yes`. This means your home directory will be displayed as `~` and `/usr/local` as `/u/local`. Set it to `no` if you prefer full paths in title. 103 | 104 | **Prompt options** 105 | 106 | - `theme_display_ruby`. Use `no` to completely hide all information about Ruby version. By default Ruby version displayed if there is the difference from default settings. 107 | - `theme_display_vagrant`. This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported. 108 | - `theme_show_exit_status`. Set this option to yes to have the prompt show the last exit code if it was non_zero instead of just the exclamation mark. 109 | - `theme_git_worktree_support`. If you do any git worktree shenanigans, setting this to `yes` will fix incorrect project-relative path display. If you don't do any git worktree shenanigans, leave it disabled. It's faster this way :) 110 | - `fish_prompt_pwd_dir_length`. bobthefish respects the Fish `$fish_prompt_pwd_dir_length` setting to abbreviate the prompt path. Set to `0` to show the full path, `1` (default) to show only the first character of each parent directory name, or any other number to show up to that many characters. 111 | - `theme_project_dir_length`. The same as `$fish_prompt_pwd_dir_length`, but for the path relative to the current project root. Defaults to `0`; set to any other number to show an abbreviated path. 112 | 113 | **Color scheme options** 114 | 115 | | ![dark][dark] | ![light][light] | 116 | |-------------------------|-------------------------------------| 117 | | ![solarized][solarized] | ![solarized-light][solarized-light] | 118 | | ![base16][base16] | ![base16-light][base16-light] | 119 | | ![zenburn][zenburn] | ![terminal-dark][terminal-dark] | 120 | 121 | You can use the function `__bobthefish_display_colors` to preview the prompts in 122 | the current theme. 123 | 124 | Set `theme_color_scheme` in a terminal session or in your fish startup files to 125 | one of the following options to change the prompt colors. 126 | 127 | - `dark`. The default bobthefish theme. 128 | - `light`. A lighter version of the default theme. 129 | - `solarized` (or `solarized-dark`), `solarized-light`. Dark and light variants 130 | of Solarized. 131 | - `base16` (or `base16-dark`), `base16-light`. Dark and light variants of the 132 | default Base16 theme. 133 | - `zenburn`. An adaptation of Zenburn. 134 | - `gruvbox`. An adaptation of gruvbox. 135 | 136 | Some of these may not look right if your terminal does not support 24 bit color, 137 | in which case you can try one of the `terminal` schemes (below). However, if 138 | you're using Solarized, Base16 (default), or Zenburn in your terminal and the 139 | terminal *does* support 24 bit color, the built in schemes will look nicer. 140 | 141 | There are several scheme that use whichever colors you currently have loaded 142 | into your terminal. The advantage of using the schemes that fall through to the 143 | terminal colors is that they automatically adapt to something acceptable 144 | whenever you change the 16 colors in your terminal profile. 145 | - `terminal` (or `terminal-dark` or `terminal-dark-black`) 146 | - `terminal-dark-white`. Same as `terminal`, but use white as the foreground 147 | color on top of colored segments (in case your colors are very dark). 148 | - `terminal-light` (or `terminal-light-white`) 149 | - `terminal-light-black`. Same as `terminal-light`, but use black as the 150 | foreground color on top of colored segments (in case your colors are very 151 | bright). 152 | 153 | For some terminal themes, like dark base16 themes, the path segments in the 154 | prompt will be indistinguishable from the background. In those cases, try one of 155 | the following variations; they are identical to the `terminal` schemes except 156 | for using bright black (`brgrey`) and dull white (`grey`) in the place of black 157 | and bright white. 158 | - `terminal2` (or `terminal2-dark` or `terminal2-dark-black`) 159 | - `terminal2-dark-white` 160 | - `terminal2-light` (or `terminal2-light-white`) 161 | - `terminal2-light-black` 162 | 163 | Finally, you can specify your very own color scheme by setting 164 | `theme_color_scheme` to `user`. In that case, you also need to define some 165 | variables to set the colors of the prompt. See the "Colors" section of 166 | `fish_prompt.fish` for details. 167 | 168 | 169 | ### Overrides 170 | 171 | You can disable the theme default greeting, vi mode prompt, right prompt, or title entirely — or override with your own — by adding custom functions to `~/.config/fish/functions`: 172 | 173 | - `~/.config/fish/functions/fish_greeting.fish` 174 | - `~/.config/fish/functions/fish_mode_prompt.fish` 175 | - `~/.config/fish/functions/fish_right_prompt.fish` 176 | - `~/.config/fish/functions/fish_title.fish` 177 | 178 | To disable them completely, use an empty function: 179 | 180 | ```fish 181 | function fish_right_prompt; end 182 | ``` 183 | 184 | … Or copy one from your favorite theme, make up something of your own, or copy/paste a bobthefish default function and modify it to your taste! 185 | 186 | ```fish 187 | function fish_greeting 188 | set_color $fish_color_autosuggestion 189 | echo "I'm completely operational, and all my circuits are functioning perfectly." 190 | set_color normal 191 | end 192 | ``` 193 | 194 | 195 | [fish]: https://github.com/fish-shell/fish-shell 196 | [screencast]: https://cloud.githubusercontent.com/assets/53660/18028510/f16f6b2c-6c35-11e6-8eb9-9f23ea3cce2e.gif 197 | [patching]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts 198 | [fonts]: https://github.com/Lokaltog/powerline-fonts 199 | [nerd-fonts]: https://github.com/ryanoasis/nerd-fonts 200 | [agnoster]: https://gist.github.com/agnoster/3712874 201 | 202 | [dark]: https://cloud.githubusercontent.com/assets/53660/16141569/ee2bbe4a-3411-11e6-85dc-3d9b0226e833.png "dark" 203 | [light]: https://cloud.githubusercontent.com/assets/53660/16141570/f106afc6-3411-11e6-877d-fc2a8f6d3175.png "light" 204 | [solarized]: https://cloud.githubusercontent.com/assets/53660/16141572/f7724032-3411-11e6-8771-b43769e7afec.png "solarized" 205 | [solarized-light]: https://cloud.githubusercontent.com/assets/53660/16141575/fbed8036-3411-11e6-92e9-90da6d45f94b.png "solarized-light" 206 | [base16]: https://cloud.githubusercontent.com/assets/53660/16141577/0134763a-3412-11e6-9cca-6040d39c8fd4.png "base16" 207 | [base16-light]: https://cloud.githubusercontent.com/assets/53660/16141579/02f7245e-3412-11e6-97c6-5f3cecffb73c.png "base16-light" 208 | [zenburn]: https://cloud.githubusercontent.com/assets/53660/16141580/06229dd4-3412-11e6-84aa-a48de127b6da.png "zenburn" 209 | [terminal-dark]: https://cloud.githubusercontent.com/assets/53660/16141583/0b3e8eea-3412-11e6-8068-617c5371f6ea.png "terminal-dark" 210 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-bobthefish/README.md: -------------------------------------------------------------------------------- 1 | # bobthefish 2 | 3 | `bobthefish` is a Powerline-style, Git-aware [fish][fish] theme optimized for awesome. 4 | 5 | [![Oh My Fish](https://img.shields.io/badge/Framework-Oh_My_Fish-blue.svg?style=flat)](https://github.com/oh-my-fish/oh-my-fish) [![MIT License](https://img.shields.io/github/license/oh-my-fish/theme-bobthefish.svg?style=flat)](/LICENSE.md) 6 | 7 | ![bobthefish][screencast] 8 | 9 | 10 | ### Installation 11 | 12 | Be sure to have Oh My Fish installed. Then just: 13 | 14 | omf install bobthefish 15 | 16 | You will need a [Powerline-patched font][patching] for this to work, unless you enable the compatibility fallback option: 17 | 18 | set -g theme_powerline_fonts no 19 | 20 | [I recommend picking one of these][fonts]. For more advanced awesome, install a [nerd fonts patched font][nerd-fonts], and enable nerd fonts support: 21 | 22 | set -g theme_nerd_fonts yes 23 | 24 | This theme is based loosely on [agnoster][agnoster]. 25 | 26 | 27 | ### Features 28 | 29 | * A helpful, but not too distracting, greeting. 30 | * A subtle timestamp hanging out off to the right. 31 | * Powerline-style visual hotness. 32 | * More colors than you know what to do with. 33 | * An abbreviated path which doesn't abbreviate the name of the current project. 34 | * All the things you need to know about Git in a glance. 35 | * Visual indication that you can't write to the current directory. 36 | 37 | 38 | ### The Prompt 39 | 40 | * Flags: 41 | * Previous command failed (**`!`**) 42 | * Background jobs (**`%`**) 43 | * You currently have superpowers (**`$`**) 44 | * Current vi mode 45 | * `User@Host` (unless you're the default user) 46 | * Current RVM, rbenv or chruby (Ruby) version 47 | * Current virtualenv (Python) version 48 | * _If you use virtualenv, you will probably need to disable the default virtualenv prompt, since it doesn't play nice with fish: `set -x VIRTUAL_ENV_DISABLE_PROMPT 1`_ 49 | * Abbreviated parent directory 50 | * Current directory, or Git or Mercurial project name 51 | * Current project's repo branch (branch-glyph master) or detached head (`➦` d0dfd9b) 52 | * Git or Mercurial status, via colors and flags: 53 | * Dirty working directory (**`*`**) 54 | * Untracked files (**`…`**) 55 | * Staged changes (**`~`**) 56 | * Stashed changes (**`$`**) 57 | * Unpulled commits (**`-`**) 58 | * Unpushed commits (**`+`**) 59 | * Unpulled _and_ unpushed commits (**`±`**) 60 | * _Note that not all of these have been implemented for hg yet :)_ 61 | * Abbreviated project-relative path 62 | 63 | 64 | ### Configuration 65 | 66 | You can override some of the following default options in your `config.fish`: 67 | 68 | ```fish 69 | set -g theme_display_git no 70 | set -g theme_display_git_untracked no 71 | set -g theme_display_git_ahead_verbose yes 72 | set -g theme_git_worktree_support yes 73 | set -g theme_display_vagrant yes 74 | set -g theme_display_docker_machine no 75 | set -g theme_display_hg yes 76 | set -g theme_display_virtualenv no 77 | set -g theme_display_ruby no 78 | set -g theme_display_user yes 79 | set -g theme_display_vi no 80 | set -g theme_display_date no 81 | set -g theme_display_cmd_duration yes 82 | set -g theme_title_display_process yes 83 | set -g theme_title_display_path no 84 | set -g theme_title_display_user yes 85 | set -g theme_title_use_abbreviated_path no 86 | set -g theme_date_format "+%a %H:%M" 87 | set -g theme_avoid_ambiguous_glyphs yes 88 | set -g theme_powerline_fonts no 89 | set -g theme_nerd_fonts yes 90 | set -g theme_show_exit_status yes 91 | set -g default_user your_normal_user 92 | set -g theme_color_scheme dark 93 | set -g fish_prompt_pwd_dir_length 0 94 | set -g theme_project_dir_length 1 95 | ``` 96 | 97 | **Title options** 98 | 99 | - `theme_title_display_process`. By default theme doesn't show current process name in terminal title. If you want to show it, just set to `yes`. 100 | - `theme_title_display_path`. Use `no` to hide current working directory from title. 101 | - `theme_title_display_user`. Set to `yes` to show the current user in the tab title (unless you're the default user). 102 | - `theme_title_use_abbreviated_path`. Default is `yes`. This means your home directory will be displayed as `~` and `/usr/local` as `/u/local`. Set it to `no` if you prefer full paths in title. 103 | 104 | **Prompt options** 105 | 106 | - `theme_display_ruby`. Use `no` to completely hide all information about Ruby version. By default Ruby version displayed if there is the difference from default settings. 107 | - `theme_display_vagrant`. This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported. 108 | - `theme_show_exit_status`. Set this option to yes to have the prompt show the last exit code if it was non_zero instead of just the exclamation mark. 109 | - `theme_git_worktree_support`. If you do any git worktree shenanigans, setting this to `yes` will fix incorrect project-relative path display. If you don't do any git worktree shenanigans, leave it disabled. It's faster this way :) 110 | - `fish_prompt_pwd_dir_length`. bobthefish respects the Fish `$fish_prompt_pwd_dir_length` setting to abbreviate the prompt path. Set to `0` to show the full path, `1` (default) to show only the first character of each parent directory name, or any other number to show up to that many characters. 111 | - `theme_project_dir_length`. The same as `$fish_prompt_pwd_dir_length`, but for the path relative to the current project root. Defaults to `0`; set to any other number to show an abbreviated path. 112 | 113 | **Color scheme options** 114 | 115 | | ![dark][dark] | ![light][light] | 116 | |-------------------------|-------------------------------------| 117 | | ![solarized][solarized] | ![solarized-light][solarized-light] | 118 | | ![base16][base16] | ![base16-light][base16-light] | 119 | | ![zenburn][zenburn] | ![terminal-dark][terminal-dark] | 120 | 121 | You can use the function `__bobthefish_display_colors` to preview the prompts in 122 | the current theme. 123 | 124 | Set `theme_color_scheme` in a terminal session or in your fish startup files to 125 | one of the following options to change the prompt colors. 126 | 127 | - `dark`. The default bobthefish theme. 128 | - `light`. A lighter version of the default theme. 129 | - `solarized` (or `solarized-dark`), `solarized-light`. Dark and light variants 130 | of Solarized. 131 | - `base16` (or `base16-dark`), `base16-light`. Dark and light variants of the 132 | default Base16 theme. 133 | - `zenburn`. An adaptation of Zenburn. 134 | - `gruvbox`. An adaptation of gruvbox. 135 | 136 | Some of these may not look right if your terminal does not support 24 bit color, 137 | in which case you can try one of the `terminal` schemes (below). However, if 138 | you're using Solarized, Base16 (default), or Zenburn in your terminal and the 139 | terminal *does* support 24 bit color, the built in schemes will look nicer. 140 | 141 | There are several scheme that use whichever colors you currently have loaded 142 | into your terminal. The advantage of using the schemes that fall through to the 143 | terminal colors is that they automatically adapt to something acceptable 144 | whenever you change the 16 colors in your terminal profile. 145 | - `terminal` (or `terminal-dark` or `terminal-dark-black`) 146 | - `terminal-dark-white`. Same as `terminal`, but use white as the foreground 147 | color on top of colored segments (in case your colors are very dark). 148 | - `terminal-light` (or `terminal-light-white`) 149 | - `terminal-light-black`. Same as `terminal-light`, but use black as the 150 | foreground color on top of colored segments (in case your colors are very 151 | bright). 152 | 153 | For some terminal themes, like dark base16 themes, the path segments in the 154 | prompt will be indistinguishable from the background. In those cases, try one of 155 | the following variations; they are identical to the `terminal` schemes except 156 | for using bright black (`brgrey`) and dull white (`grey`) in the place of black 157 | and bright white. 158 | - `terminal2` (or `terminal2-dark` or `terminal2-dark-black`) 159 | - `terminal2-dark-white` 160 | - `terminal2-light` (or `terminal2-light-white`) 161 | - `terminal2-light-black` 162 | 163 | Finally, you can specify your very own color scheme by setting 164 | `theme_color_scheme` to `user`. In that case, you also need to define some 165 | variables to set the colors of the prompt. See the "Colors" section of 166 | `fish_prompt.fish` for details. 167 | 168 | 169 | ### Overrides 170 | 171 | You can disable the theme default greeting, vi mode prompt, right prompt, or title entirely — or override with your own — by adding custom functions to `~/.config/fish/functions`: 172 | 173 | - `~/.config/fish/functions/fish_greeting.fish` 174 | - `~/.config/fish/functions/fish_mode_prompt.fish` 175 | - `~/.config/fish/functions/fish_right_prompt.fish` 176 | - `~/.config/fish/functions/fish_title.fish` 177 | 178 | To disable them completely, use an empty function: 179 | 180 | ```fish 181 | function fish_right_prompt; end 182 | ``` 183 | 184 | … Or copy one from your favorite theme, make up something of your own, or copy/paste a bobthefish default function and modify it to your taste! 185 | 186 | ```fish 187 | function fish_greeting 188 | set_color $fish_color_autosuggestion 189 | echo "I'm completely operational, and all my circuits are functioning perfectly." 190 | set_color normal 191 | end 192 | ``` 193 | 194 | 195 | [fish]: https://github.com/fish-shell/fish-shell 196 | [screencast]: https://cloud.githubusercontent.com/assets/53660/18028510/f16f6b2c-6c35-11e6-8eb9-9f23ea3cce2e.gif 197 | [patching]: https://powerline.readthedocs.org/en/master/installation.html#patched-fonts 198 | [fonts]: https://github.com/Lokaltog/powerline-fonts 199 | [nerd-fonts]: https://github.com/ryanoasis/nerd-fonts 200 | [agnoster]: https://gist.github.com/agnoster/3712874 201 | 202 | [dark]: https://cloud.githubusercontent.com/assets/53660/16141569/ee2bbe4a-3411-11e6-85dc-3d9b0226e833.png "dark" 203 | [light]: https://cloud.githubusercontent.com/assets/53660/16141570/f106afc6-3411-11e6-877d-fc2a8f6d3175.png "light" 204 | [solarized]: https://cloud.githubusercontent.com/assets/53660/16141572/f7724032-3411-11e6-8771-b43769e7afec.png "solarized" 205 | [solarized-light]: https://cloud.githubusercontent.com/assets/53660/16141575/fbed8036-3411-11e6-92e9-90da6d45f94b.png "solarized-light" 206 | [base16]: https://cloud.githubusercontent.com/assets/53660/16141577/0134763a-3412-11e6-9cca-6040d39c8fd4.png "base16" 207 | [base16-light]: https://cloud.githubusercontent.com/assets/53660/16141579/02f7245e-3412-11e6-97c6-5f3cecffb73c.png "base16-light" 208 | [zenburn]: https://cloud.githubusercontent.com/assets/53660/16141580/06229dd4-3412-11e6-84aa-a48de127b6da.png "zenburn" 209 | [terminal-dark]: https://cloud.githubusercontent.com/assets/53660/16141583/0b3e8eea-3412-11e6-8068-617c5371f6ea.png "terminal-dark" 210 | -------------------------------------------------------------------------------- /.spacemacs: -------------------------------------------------------------------------------- 1 | ;; -*- mode: emacs-lisp -*- 2 | ;; This file is loaded by Spacemacs at startup. 3 | ;; It must be stored in your home directory. 4 | 5 | ;; Font 6 | (defun font-name () 7 | ;; "PragmataPro") 8 | "Iosevka") 9 | ;; "Go Mono") 10 | ;; "Hack") 11 | ;; "Monokai") 12 | ;; "Hasklig") 13 | 14 | (defun font-scale-hidpi () 15 | 1.3) 16 | 17 | (defun font-scale-lodpi () 18 | 1.0) 19 | 20 | (defun font-size-hidpi () 21 | 25) 22 | 23 | (defun font-size-lodpi () 24 | 15) 25 | 26 | (defun modeline-font () 27 | "Source Code Pro") 28 | 29 | (defun font-size () 30 | (if (equal (shell-command-to-string "/home/raphael/scripts/emacs_screen.sh") "0\n") 31 | (font-size-hidpi) 32 | (font-size-lodpi))) 33 | 34 | (defun modeline-font-height () 35 | (if (equal (shell-command-to-string "/home/raphael/scripts/emacs_screen.sh") "0\n") 36 | 100 37 | 50)) 38 | 39 | (defun font-scale () 40 | (if (equal (shell-command-to-string "/home/raphael/scripts/emacs_screen.sh") "0\n") 41 | (font-scale-hidpi) 42 | (font-scale-lodpi))) 43 | 44 | (defun dotspacemacs/layers () 45 | "Configuration Layers declaration. 46 | You should not put any user code in this function besides modifying the variable 47 | values." 48 | (setq-default 49 | ;; Base distribution to use. This is a layer contained in the directory 50 | ;; `+distribution'. For now available distributions are `spacemacs-base' 51 | ;; or `spacemacs'. (default 'spacemacs) 52 | dotspacemacs-distribution 'spacemacs 53 | ;; Lazy installation of layers (i.e. layers are installed only when a file 54 | ;; with a supported type is opened). Possible values are `all', `unused' 55 | ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers 56 | ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will 57 | ;; lazy install any layer that support lazy installation even the layers 58 | ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy 59 | ;; installation feature and you have to explicitly list a layer in the 60 | ;; variable `dotspacemacs-configuration-layers' to install it. 61 | ;; (default 'unused) 62 | dotspacemacs-enable-lazy-installation 'unused 63 | ;; If non-nil then Spacemacs will ask for confirmation before installing 64 | ;; a layer lazily. (default t) 65 | dotspacemacs-ask-for-lazy-installation t 66 | ;; If non-nil layers with lazy install support are lazy installed. 67 | ;; List of additional paths where to look for configuration layers. 68 | ;; Paths must have a trailing slash (i.e. `~/.mycontribs/') 69 | dotspacemacs-configuration-layer-path '() 70 | ;; List of configuration layers to load. 71 | dotspacemacs-configuration-layers 72 | '( 73 | html 74 | javascript 75 | ruby 76 | go 77 | docker 78 | shell-scripts 79 | vimscript 80 | ;; ---------------------------------------------------------------- 81 | ;; Example of useful layers you may want to use right away. 82 | ;; Uncomment some layer names and press (Vim style) or 83 | ;; (Emacs style) to install them. 84 | ;; ---------------------------------------------------------------- 85 | ivy 86 | auto-completion 87 | ;; better-defaults 88 | emacs-lisp 89 | git 90 | markdown 91 | org 92 | (shell :variables 93 | shell-default-height 30 94 | shell-default-position 'bottom) 95 | spell-checking 96 | syntax-checking 97 | version-control 98 | yaml 99 | ) 100 | ;; List of additional packages that will be installed without being 101 | ;; wrapped in a layer. If you need some configuration for these 102 | ;; packages, then consider creating a layer. You can also put the 103 | ;; configuration in `dotspacemacs/user-config'. 104 | dotspacemacs-additional-packages '() 105 | ;; A list of packages that cannot be updated. 106 | dotspacemacs-frozen-packages '() 107 | ;; A list of packages that will not be installed and loaded. 108 | dotspacemacs-excluded-packages '() 109 | ;; Defines the behaviour of Spacemacs when installing packages. 110 | ;; Possible values are `used-only', `used-but-keep-unused' and `all'. 111 | ;; `used-only' installs only explicitly used packages and uninstall any 112 | ;; unused packages as well as their unused dependencies. 113 | ;; `used-but-keep-unused' installs only the used packages but won't uninstall 114 | ;; them if they become unused. `all' installs *all* packages supported by 115 | ;; Spacemacs and never uninstall them. (default is `used-only') 116 | dotspacemacs-install-packages 'used-only)) 117 | 118 | (defun dotspacemacs/init () 119 | "Initialization function. 120 | This function is called at the very startup of Spacemacs initialization 121 | before layers configuration. 122 | You should not put any user code in there besides modifying the variable 123 | values." 124 | ;; This setq-default sexp is an exhaustive list of all the supported 125 | ;; spacemacs settings. 126 | (setq-default 127 | ;; Font size detection 128 | dotspacemacs-default-font (list (font-name) :size (font-size) :weight 'normal :width 'normal :powerline-scale (font-scale)) 129 | ;; If non nil ELPA repositories are contacted via HTTPS whenever it's 130 | ;; possible. Set it to nil if you have no way to use HTTPS in your 131 | ;; environment, otherwise it is strongly recommended to let it set to t. 132 | ;; This variable has no effect if Emacs is launched with the parameter 133 | ;; `--insecure' which forces the value of this variable to nil. 134 | ;; (default t) 135 | dotspacemacs-elpa-https t 136 | ;; Maximum allowed time in seconds to contact an ELPA repository. 137 | dotspacemacs-elpa-timeout 5 138 | ;; If non nil then spacemacs will check for updates at startup 139 | ;; when the current branch is not `develop'. Note that checking for 140 | ;; new versions works via git commands, thus it calls GitHub services 141 | ;; whenever you start Emacs. (default nil) 142 | dotspacemacs-check-for-update t 143 | ;; If non-nil, a form that evaluates to a package directory. For example, to 144 | ;; use different package directories for different Emacs versions, set this 145 | ;; to `emacs-version'. 146 | dotspacemacs-elpa-subdirectory nil 147 | ;; One of `vim', `emacs' or `hybrid'. 148 | ;; `hybrid' is like `vim' except that `insert state' is replaced by the 149 | ;; `hybrid state' with `emacs' key bindings. The value can also be a list 150 | ;; with `:variables' keyword (similar to layers). Check the editing styles 151 | ;; section of the documentation for details on available variables. 152 | ;; (default 'vim) 153 | dotspacemacs-editing-style 'vim 154 | ;; If non nil output loading progress in `*Messages*' buffer. (default nil) 155 | dotspacemacs-verbose-loading t 156 | ;; Specify the startup banner. Default value is `official', it displays 157 | ;; the official spacemacs logo. An integer value is the index of text 158 | ;; banner, `random' chooses a random text banner in `core/banners' 159 | ;; directory. A string value must be a path to an image format supported 160 | ;; by your Emacs build. 161 | ;; If the value is nil then no banner is displayed. (default 'official) 162 | dotspacemacs-startup-banner 'official 163 | ;; List of items to show in startup buffer or an association list of 164 | ;; the form `(list-type . list-size)`. If nil then it is disabled. 165 | ;; Possible values for list-type are: 166 | ;; `recents' `bookmarks' `projects' `agenda' `todos'." 167 | ;; List sizes may be nil, in which case 168 | ;; `spacemacs-buffer-startup-lists-length' takes effect. 169 | dotspacemacs-startup-lists '((recents . 5) 170 | (projects . 7)) 171 | ;; True if the home buffer should respond to resize events. 172 | dotspacemacs-startup-buffer-responsive t 173 | ;; Default major mode of the scratch buffer (default `text-mode') 174 | dotspacemacs-scratch-mode 'text-mode 175 | ;; List of themes, the first of the list is loaded when spacemacs starts. 176 | ;; Press T n to cycle to the next theme in the list (works great 177 | ;; with 2 themes variants, one dark and one light) 178 | dotspacemacs-themes '(gruvbox 179 | material 180 | spacemacs-dark 181 | spacemacs-light) 182 | ;; If non nil the cursor color matches the state color in GUI Emacs. 183 | dotspacemacs-colorize-cursor-according-to-state t 184 | ;; Default font, or prioritized list of fonts. `powerline-scale' allows to 185 | ;; quickly tweak the mode-line size to make separators look not too crappy. 186 | ;; dotspacemacs-default-font '("Source Code Pro" 187 | ;; :size 13 188 | ;; :weight normal 189 | ;; :width normal 190 | ;; :powerline-scale 1.1) 191 | ;; The leader key 192 | dotspacemacs-leader-key "SPC" 193 | ;; The key used for Emacs commands (M-x) (after pressing on the leader key). 194 | ;; (default "SPC") 195 | dotspacemacs-emacs-command-key "SPC" 196 | ;; The key used for Vim Ex commands (default ":") 197 | dotspacemacs-ex-command-key ":" 198 | ;; The leader key accessible in `emacs state' and `insert state' 199 | ;; (default "M-m") 200 | dotspacemacs-emacs-leader-key "M-m" 201 | ;; Major mode leader key is a shortcut key which is the equivalent of 202 | ;; pressing ` m`. Set it to `nil` to disable it. (default ",") 203 | dotspacemacs-major-mode-leader-key "," 204 | ;; Major mode leader key accessible in `emacs state' and `insert state'. 205 | ;; (default "C-M-m") 206 | dotspacemacs-major-mode-emacs-leader-key "C-M-m" 207 | ;; These variables control whether separate commands are bound in the GUI to 208 | ;; the key pairs C-i, TAB and C-m, RET. 209 | ;; Setting it to a non-nil value, allows for separate commands under 210 | ;; and TAB or and RET. 211 | ;; In the terminal, these pairs are generally indistinguishable, so this only 212 | ;; works in the GUI. (default nil) 213 | dotspacemacs-distinguish-gui-tab t 214 | ;; If non nil `Y' is remapped to `y$' in Evil states. (default nil) 215 | dotspacemacs-remap-Y-to-y$ t 216 | ;; If non-nil, the shift mappings `<' and `>' retain visual state if used 217 | ;; there. (default t) 218 | dotspacemacs-retain-visual-state-on-shift t 219 | ;; If non-nil, J and K move lines up and down when in visual mode. 220 | ;; (default nil) 221 | dotspacemacs-visual-line-move-text nil 222 | ;; If non nil, inverse the meaning of `g' in `:substitute' Evil ex-command. 223 | ;; (default nil) 224 | dotspacemacs-ex-substitute-global nil 225 | ;; Name of the default layout (default "Default") 226 | dotspacemacs-default-layout-name "Default" 227 | ;; If non nil the default layout name is displayed in the mode-line. 228 | ;; (default nil) 229 | dotspacemacs-display-default-layout nil 230 | ;; If non nil then the last auto saved layouts are resume automatically upon 231 | ;; start. (default nil) 232 | dotspacemacs-auto-resume-layouts nil 233 | ;; Size (in MB) above which spacemacs will prompt to open the large file 234 | ;; literally to avoid performance issues. Opening a file literally means that 235 | ;; no major mode or minor modes are active. (default is 1) 236 | dotspacemacs-large-file-size 10 237 | ;; Location where to auto-save files. Possible values are `original' to 238 | ;; auto-save the file in-place, `cache' to auto-save the file to another 239 | ;; file stored in the cache directory and `nil' to disable auto-saving. 240 | ;; (default 'cache) 241 | dotspacemacs-auto-save-file-location 'cache 242 | ;; Maximum number of rollback slots to keep in the cache. (default 5) 243 | dotspacemacs-max-rollback-slots 5 244 | ;; If non nil, `helm' will try to minimize the space it uses. (default nil) 245 | dotspacemacs-helm-resize nil 246 | ;; if non nil, the helm header is hidden when there is only one source. 247 | ;; (default nil) 248 | dotspacemacs-helm-no-header nil 249 | ;; define the position to display `helm', options are `bottom', `top', 250 | ;; `left', or `right'. (default 'bottom) 251 | dotspacemacs-helm-position 'bottom 252 | ;; Controls fuzzy matching in helm. If set to `always', force fuzzy matching 253 | ;; in all non-asynchronous sources. If set to `source', preserve individual 254 | ;; source settings. Else, disable fuzzy matching in all sources. 255 | ;; (default 'always) 256 | dotspacemacs-helm-use-fuzzy 'always 257 | ;; If non nil the paste micro-state is enabled. When enabled pressing `p` 258 | ;; several times cycle between the kill ring content. (default nil) 259 | dotspacemacs-enable-paste-transient-state nil 260 | ;; Which-key delay in seconds. The which-key buffer is the popup listing 261 | ;; the commands bound to the current keystroke sequence. (default 0.4) 262 | dotspacemacs-which-key-delay 0.4 263 | ;; Which-key frame position. Possible values are `right', `bottom' and 264 | ;; `right-then-bottom'. right-then-bottom tries to display the frame to the 265 | ;; right; if there is insufficient space it displays it at the bottom. 266 | ;; (default 'bottom) 267 | dotspacemacs-which-key-position 'bottom 268 | ;; If non nil a progress bar is displayed when spacemacs is loading. This 269 | ;; may increase the boot time on some systems and emacs builds, set it to 270 | ;; nil to boost the loading time. (default t) 271 | dotspacemacs-loading-progress-bar nil 272 | ;; If non nil the frame is fullscreen when Emacs starts up. (default nil) 273 | ;; (Emacs 24.4+ only) 274 | dotspacemacs-fullscreen-at-startup nil 275 | ;; If non nil `spacemacs/toggle-fullscreen' will not use native fullscreen. 276 | ;; Use to disable fullscreen animations in OSX. (default nil) 277 | dotspacemacs-fullscreen-use-non-native nil 278 | ;; If non nil the frame is maximized when Emacs starts up. 279 | ;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil. 280 | ;; (default nil) (Emacs 24.4+ only) 281 | dotspacemacs-maximized-at-startup nil 282 | ;; A value from the range (0..100), in increasing opacity, which describes 283 | ;; the transparency level of a frame when it's active or selected. 284 | ;; Transparency can be toggled through `toggle-transparency'. (default 90) 285 | dotspacemacs-active-transparency 90 286 | ;; A value from the range (0..100), in increasing opacity, which describes 287 | ;; the transparency level of a frame when it's inactive or deselected. 288 | ;; Transparency can be toggled through `toggle-transparency'. (default 90) 289 | dotspacemacs-inactive-transparency 90 290 | ;; If non nil show the titles of transient states. (default t) 291 | dotspacemacs-show-transient-state-title t 292 | ;; If non nil show the color guide hint for transient state keys. (default t) 293 | dotspacemacs-show-transient-state-color-guide t 294 | ;; If non nil unicode symbols are displayed in the mode line. (default t) 295 | dotspacemacs-mode-line-unicode-symbols t 296 | ;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth 297 | ;; scrolling overrides the default behavior of Emacs which recenters point 298 | ;; when it reaches the top or bottom of the screen. (default t) 299 | dotspacemacs-smooth-scrolling t 300 | ;; Control line numbers activation. 301 | ;; If set to `t' or `relative' line numbers are turned on in all `prog-mode' and 302 | ;; `text-mode' derivatives. If set to `relative', line numbers are relative. 303 | ;; This variable can also be set to a property list for finer control: 304 | ;; '(:relative nil 305 | ;; :disabled-for-modes dired-mode 306 | ;; doc-view-mode 307 | ;; markdown-mode 308 | ;; org-mode 309 | ;; pdf-view-mode 310 | ;; text-mode 311 | ;; :size-limit-kb 1000) 312 | ;; (default nil) 313 | dotspacemacs-line-numbers 'relative 314 | ;; Code folding method. Possible values are `evil' and `origami'. 315 | ;; (default 'evil) 316 | dotspacemacs-folding-method 'evil 317 | ;; If non-nil smartparens-strict-mode will be enabled in programming modes. 318 | ;; (default nil) 319 | dotspacemacs-smartparens-strict-mode nil 320 | ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes 321 | ;; over any automatically added closing parenthesis, bracket, quote, etc… 322 | ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil) 323 | dotspacemacs-smart-closing-parenthesis nil 324 | ;; Select a scope to highlight delimiters. Possible values are `any', 325 | ;; `current', `all' or `nil'. Default is `all' (highlight any scope and 326 | ;; emphasis the current one). (default 'all) 327 | dotspacemacs-highlight-delimiters 'all 328 | ;; If non nil, advise quit functions to keep server open when quitting. 329 | ;; (default nil) 330 | dotspacemacs-persistent-server nil 331 | ;; List of search tool executable names. Spacemacs uses the first installed 332 | ;; tool of the list. Supported tools are `ag', `pt', `ack' and `grep'. 333 | ;; (default '("ag" "pt" "ack" "grep")) 334 | dotspacemacs-search-tools '("ag" "pt" "ack" "grep") 335 | ;; The default package repository used if no explicit repository has been 336 | ;; specified with an installed package. 337 | ;; Not used for now. (default nil) 338 | dotspacemacs-default-package-repository nil 339 | ;; Delete whitespace while saving buffer. Possible values are `all' 340 | ;; to aggressively delete empty line and long sequences of whitespace, 341 | ;; `trailing' to delete only the whitespace at end of lines, `changed'to 342 | ;; delete only whitespace for changed lines or `nil' to disable cleanup. 343 | ;; (default nil) 344 | dotspacemacs-whitespace-cleanup "trailing" 345 | )) 346 | 347 | (defun dotspacemacs/user-init () 348 | "Initialization function for user code. 349 | It is called immediately after `dotspacemacs/init', before layer configuration 350 | executes. 351 | This function is mostly useful for variables that need to be set 352 | before packages are loaded. If you are unsure, you should try in setting them in 353 | `dotspacemacs/user-config' first." 354 | (load-file "~/spacemacs/dash.el") 355 | (load-file "~/spacemacs/autothemer.el") 356 | (setq go-guru-debug t) 357 | ) 358 | 359 | (defun dotspacemacs/user-config () 360 | "Configuration function for user code. 361 | This function is called at the very end of Spacemacs initialization after 362 | layers configuration. 363 | This is the place where most of your configurations should be done. Unless it is 364 | explicitly specified that a variable should be set before a package is loaded, 365 | you should place your code here." 366 | ;; inc/dec at point 367 | (define-key evil-normal-state-map (kbd "C-a") 'spacemacs/evil-numbers-transient-state/evil-numbers/inc-at-pt) 368 | (define-key evil-normal-state-map (kbd "C-S-a") 'spacemacs/evil-numbers-transient-state/evil-numbers/dec-at-pt) 369 | 370 | ;; C-] 371 | (evil-define-key '(normal insert) go-mode-map (kbd "C-]") 'go-guru-definition) 372 | 373 | ;; Save 374 | (define-key evil-normal-state-map (kbd "C-s") 'save-buffer) 375 | 376 | ;; auto-fill 377 | (auto-fill-mode 1) 378 | (set-fill-column 80) 379 | (setq fci-rule-color "#3c3836") 380 | (setq fci-rule-width 5) 381 | (add-hook 'prog-mode-hook #'fci-mode) 382 | 383 | ;; git-gutter 384 | (custom-set-variables 385 | '(git-gutter+-modified-sign "~") 386 | '(git-gutter+-added-sign "+") 387 | '(git-gutter+-deleted-sign "-")) 388 | (set-face-foreground 'git-gutter+-modified "#d79921") 389 | (set-face-background 'git-gutter+-modified "#d79921") 390 | (set-face-foreground 'git-gutter+-added "#98971a") 391 | (set-face-background 'git-gutter+-added "#98971a") 392 | (set-face-foreground 'git-gutter+-deleted "#cc241d") 393 | (set-face-background 'git-gutter+-deleted "#cc241d") 394 | 395 | ;; Go 396 | (setq gofmt-command "goimports") 397 | 398 | ;; modeline 399 | (let ((faces '(mode-line 400 | mode-line-buffer-id 401 | mode-line-emphasis 402 | mode-line-highlight 403 | mode-line-inactive))) 404 | (mapc 405 | (lambda (face) (set-face-attribute face nil :font (modeline-font) :height (modeline-font-height))) 406 | faces)) 407 | (setq powerline-default-separator 'arrow) 408 | ) 409 | 410 | ;; Do not write anything past this comment. This is where Emacs will 411 | ;; auto-generate custom variable definitions. 412 | (custom-set-variables 413 | ;; custom-set-variables was added by Custom. 414 | ;; If you edit it by hand, you could mess it up, so be careful. 415 | ;; Your init file should contain only one such instance. 416 | ;; If there is more than one, they won't work right. 417 | '(git-gutter+-added-sign "+") 418 | '(git-gutter+-deleted-sign "-") 419 | '(git-gutter+-modified-sign "~") 420 | '(package-selected-packages 421 | (quote 422 | (powerline undo-tree highlight web-mode tagedit slim-mode scss-mode sass-mode pug-mode less-css-mode haml-mode emmet-mode company-web web-completion-data web-beautify livid-mode skewer-mode simple-httpd js2-refactor multiple-cursors js2-mode js-doc company-tern dash-functional tern coffee-mode dockerfile-mode docker json-mode tablist docker-tramp json-snatcher json-reformat swiper dash rvm ruby-tools ruby-test-mode rubocop rspec-mode robe rbenv rake minitest chruby bundler inf-ruby async s insert-shebang fish-mode company-shell vimrc-mode dactyl-mode evil diminish smartparens projectile helm helm-core counsel avy ivy yaml-mode xterm-color smeargle shell-pop orgit org-projectile org-present org-pomodoro alert log4e gntp org-download multi-term mmm-mode markdown-toc markdown-mode magit-gitflow htmlize go-guru go-eldoc gnuplot gitignore-mode gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe+ git-gutter-fringe fringe-helper git-gutter+ git-gutter gh-md fuzzy flyspell-correct-ivy flyspell-correct flycheck-pos-tip pos-tip flycheck evil-magit magit magit-popup git-commit with-editor eshell-z eshell-prompt-extras esh-help diff-hl company-statistics company-go go-mode company auto-yasnippet yasnippet auto-dictionary ac-ispell auto-complete ws-butler winum which-key wgrep volatile-highlights vi-tilde-fringe uuidgen use-package toc-org spaceline smex restart-emacs request rainbow-delimiters popwin persp-mode pcre2el paradox org-plus-contrib org-bullets open-junk-file neotree move-text macrostep lorem-ipsum linum-relative link-hint ivy-hydra info+ indent-guide hungry-delete hl-todo highlight-parentheses highlight-numbers highlight-indentation hide-comnt help-fns+ helm-make google-translate golden-ratio flx-ido fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-surround evil-search-highlight-persist evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-lisp-state evil-indent-plus evil-iedit-state evil-exchange evil-escape evil-ediff evil-args evil-anzu eval-sexp-fu elisp-slime-nav dumb-jump define-word counsel-projectile column-enforce-mode clean-aindent-mode auto-highlight-symbol auto-compile aggressive-indent adaptive-wrap ace-window ace-link)))) 423 | (custom-set-faces 424 | ;; custom-set-faces was added by Custom. 425 | ;; If you edit it by hand, you could mess it up, so be careful. 426 | ;; Your init file should contain only one such instance. 427 | ;; If there is more than one, they won't work right. 428 | '(default ((((class color) (min-colors 16777215)) (:background "#282828" :foreground "#fdf4c1")) (((class color) (min-colors 255)) (:background "#262626" :foreground "#ffffaf"))))) 429 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-nova/fish_prompt.fish: -------------------------------------------------------------------------------- 1 | # name: bobthefish 2 | # 3 | # bobthefish is a Powerline-style, Git-aware fish theme optimized for awesome. 4 | # 5 | # You will need a Powerline-patched font for this to work: 6 | # 7 | # https://powerline.readthedocs.org/en/master/installation.html#patched-fonts 8 | # 9 | # I recommend picking one of these: 10 | # 11 | # https://github.com/Lokaltog/powerline-fonts 12 | # 13 | # For more advanced awesome, install a nerd fonts patched font (and be sure to 14 | # enable nerd fonts support with `set -g theme_nerd_fonts yes`): 15 | # 16 | # https://github.com/ryanoasis/nerd-fonts 17 | # 18 | # You can override some default prompt options in your config.fish: 19 | # 20 | # set -g theme_display_git no 21 | # set -g theme_display_git_untracked no 22 | # set -g theme_display_git_ahead_verbose yes 23 | # set -g theme_git_worktree_support yes 24 | # set -g theme_display_vagrant yes 25 | # set -g theme_display_docker_machine no 26 | # set -g theme_display_hg yes 27 | # set -g theme_display_virtualenv no 28 | # set -g theme_display_ruby no 29 | # set -g theme_display_user yes 30 | # set -g theme_display_vi no 31 | # set -g theme_avoid_ambiguous_glyphs yes 32 | # set -g theme_powerline_fonts no 33 | # set -g theme_nerd_fonts yes 34 | # set -g theme_show_exit_status yes 35 | # set -g default_user your_normal_user 36 | # set -g theme_color_scheme dark 37 | # set -g fish_prompt_pwd_dir_length 0 38 | # set -g theme_project_dir_length 1 39 | 40 | # =========================== 41 | # Helper methods 42 | # =========================== 43 | 44 | # function __bobthefish_in_git -S -d 'Check whether pwd is inside a git repo' 45 | # command which git > /dev/null ^&1 46 | # and command git rev-parse --is-inside-work-tree >/dev/null ^&1 47 | # end 48 | 49 | # function __bobthefish_in_hg -S -d 'Check whether pwd is inside a hg repo' 50 | # command which hg > /dev/null ^&1 51 | # and command hg stat > /dev/null ^&1 52 | # end 53 | 54 | function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)' 55 | set -l ref (command git symbolic-ref HEAD ^/dev/null) 56 | and string replace 'refs/heads/' "$__bobthefish_branch_glyph " $ref 57 | and return 58 | 59 | set -l tag (command git describe --tags --exact-match ^/dev/null) 60 | and echo "$__bobthefish_tag_glyph $tag" 61 | and return 62 | 63 | set -l branch (command git show-ref --head -s --abbrev | head -n1 ^/dev/null) 64 | echo "$__bobthefish_detached_glyph $branch" 65 | end 66 | 67 | function __bobthefish_hg_branch -S -d 'Get the current hg branch' 68 | set -l branch (command hg branch ^/dev/null) 69 | set -l book (command hg book | command grep \* | cut -d\ -f3) 70 | echo "$__bobthefish_branch_glyph $branch @ $book" 71 | end 72 | 73 | function __bobthefish_pretty_parent -S -a current_dir -d 'Print a parent directory, shortened to fit the prompt' 74 | set -q fish_prompt_pwd_dir_length 75 | or set -l fish_prompt_pwd_dir_length 1 76 | 77 | # Replace $HOME with ~ 78 | set -l real_home ~ 79 | set -l parent_dir (string replace -r '^'"$real_home"'($|/)' '~$1' (dirname $current_dir)) 80 | 81 | if [ $parent_dir = "/" ] 82 | echo -n / 83 | return 84 | end 85 | 86 | if [ $fish_prompt_pwd_dir_length -eq 0 ] 87 | echo -n "$parent_dir/" 88 | return 89 | end 90 | 91 | string replace -ar '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' "$parent_dir/" 92 | end 93 | 94 | function __bobthefish_git_project_dir -S -d 'Print the current git project base directory' 95 | [ "$theme_display_git" = 'no' ]; and return 96 | if [ "$theme_git_worktree_support" != 'yes' ] 97 | command git rev-parse --show-toplevel ^/dev/null 98 | return 99 | end 100 | 101 | set -l git_dir (command git rev-parse --git-dir ^/dev/null); or return 102 | 103 | pushd $git_dir 104 | set git_dir $PWD 105 | popd 106 | 107 | switch $PWD/ 108 | case $git_dir/\* 109 | # Nothing works quite right if we're inside the git dir 110 | # TODO: fix the underlying issues then re-enable the stuff below 111 | 112 | # # if we're inside the git dir, sweet. just return that. 113 | # set -l toplevel (command git rev-parse --show-toplevel ^/dev/null) 114 | # if [ "$toplevel" ] 115 | # switch $git_dir/ 116 | # case $toplevel/\* 117 | # echo $git_dir 118 | # end 119 | # end 120 | return 121 | end 122 | 123 | set -l project_dir (dirname $git_dir) 124 | 125 | switch $PWD/ 126 | case $project_dir/\* 127 | echo $project_dir 128 | return 129 | end 130 | 131 | set project_dir (command git rev-parse --show-toplevel ^/dev/null) 132 | switch $PWD/ 133 | case $project_dir/\* 134 | echo $project_dir 135 | end 136 | end 137 | 138 | function __bobthefish_hg_project_dir -S -d 'Print the current hg project base directory' 139 | [ "$theme_display_hg" = 'yes' ]; or return 140 | set -l d $PWD 141 | while not [ $d = / ] 142 | if [ -e $d/.hg ] 143 | command hg root --cwd "$d" ^/dev/null 144 | return 145 | end 146 | set d (dirname $d) 147 | end 148 | end 149 | 150 | function __bobthefish_project_pwd -S -a current_dir -d 'Print the working directory relative to project root' 151 | set -q theme_project_dir_length 152 | or set -l theme_project_dir_length 0 153 | 154 | set -l project_dir (string replace -r '^'"$current_dir"'($|/)' '' $PWD) 155 | 156 | if [ $theme_project_dir_length -eq 0 ] 157 | echo -n $project_dir 158 | return 159 | end 160 | 161 | string replace -ar '(\.?[^/]{'"$theme_project_dir_length"'})[^/]*/' '$1/' $project_dir 162 | end 163 | 164 | function __bobthefish_git_ahead -S -d 'Print the ahead/behind state for the current branch' 165 | if [ "$theme_display_git_ahead_verbose" = 'yes' ] 166 | __bobthefish_git_ahead_verbose 167 | return 168 | end 169 | 170 | set -l ahead 0 171 | set -l behind 0 172 | for line in (command git rev-list --left-right '@{upstream}...HEAD' ^/dev/null) 173 | switch "$line" 174 | case '>*' 175 | if [ $behind -eq 1 ] 176 | echo '±' 177 | return 178 | end 179 | set ahead 1 180 | case '<*' 181 | if [ $ahead -eq 1 ] 182 | echo '±' 183 | return 184 | end 185 | set behind 1 186 | end 187 | end 188 | 189 | if [ $ahead -eq 1 ] 190 | echo '+' 191 | else if [ $behind -eq 1 ] 192 | echo '-' 193 | end 194 | end 195 | 196 | function __bobthefish_git_ahead_verbose -S -d 'Print a more verbose ahead/behind state for the current branch' 197 | set -l commits (command git rev-list --left-right '@{upstream}...HEAD' ^/dev/null) 198 | [ $status != 0 ]; and return 199 | 200 | set -l behind (count (for arg in $commits; echo $arg; end | command grep '^<')) 201 | set -l ahead (count (for arg in $commits; echo $arg; end | command grep -v '^<')) 202 | 203 | switch "$ahead $behind" 204 | case '' # no upstream 205 | case '0 0' # equal to upstream 206 | return 207 | case '* 0' # ahead of upstream 208 | echo "↑$ahead" 209 | case '0 *' # behind upstream 210 | echo "↓$behind" 211 | case '*' # diverged from upstream 212 | echo "↑$ahead↓$behind" 213 | end 214 | end 215 | 216 | # =========================== 217 | # Segment functions 218 | # =========================== 219 | 220 | function __bobthefish_start_segment -S -d 'Start a prompt segment' 221 | set -l bg $argv[1] 222 | set -e argv[1] 223 | set -l fg $argv[1] 224 | set -e argv[1] 225 | 226 | set_color normal # clear out anything bold or underline... 227 | set_color -b $bg $fg $argv 228 | 229 | switch "$__bobthefish_current_bg" 230 | case '' 231 | # If there's no background, just start one 232 | echo -n ' ' 233 | case "$bg" 234 | # If the background is already the same color, draw a separator 235 | echo -ns $__bobthefish_right_arrow_glyph ' ' 236 | case '*' 237 | # otherwise, draw the end of the previous segment and the start of the next 238 | set_color $__bobthefish_current_bg 239 | echo -ns $__bobthefish_right_black_arrow_glyph ' ' 240 | set_color $fg $argv 241 | end 242 | 243 | set __bobthefish_current_bg $bg 244 | end 245 | 246 | function __bobthefish_path_segment -S -a current_dir -d 'Display a shortened form of a directory' 247 | set -l segment_color $__color_path 248 | set -l segment_basename_color $__color_path_basename 249 | 250 | if not [ -w "$current_dir" ] 251 | set segment_color $__color_path_nowrite 252 | set segment_basename_color $__color_path_nowrite_basename 253 | end 254 | 255 | __bobthefish_start_segment $segment_color 256 | 257 | set -l directory 258 | set -l parent 259 | 260 | switch "$current_dir" 261 | case / 262 | set directory '/' 263 | case "$HOME" 264 | set directory '~' 265 | case '*' 266 | set parent (__bobthefish_pretty_parent "$current_dir") 267 | set directory (basename "$current_dir") 268 | end 269 | 270 | echo -n $parent 271 | set_color -b $segment_basename_color 272 | echo -ns $directory ' ' 273 | end 274 | 275 | function __bobthefish_finish_segments -S -d 'Close open prompt segments' 276 | if [ "$__bobthefish_current_bg" != '' ] 277 | set_color normal 278 | set_color $__bobthefish_current_bg 279 | echo -ns $__bobthefish_right_black_arrow_glyph ' ' 280 | end 281 | 282 | set_color normal 283 | set __bobthefish_current_bg 284 | end 285 | 286 | 287 | # =========================== 288 | # Theme components 289 | # =========================== 290 | 291 | function __bobthefish_prompt_vagrant -S -d 'Display Vagrant status' 292 | [ "$theme_display_vagrant" = 'yes' -a -f Vagrantfile ]; or return 293 | 294 | # .vagrant/machines/$machine/$provider/id 295 | for file in .vagrant/machines/*/*/id 296 | read -l id <$file 297 | 298 | if [ ! -z "$id" ] 299 | switch "$file" 300 | case '*/virtualbox/id' 301 | __bobthefish_prompt_vagrant_vbox $id 302 | case '*/vmware_fusion/id' 303 | __bobthefish_prompt_vagrant_vmware $id 304 | case '*/parallels/id' 305 | __bobthefish_prompt_vagrant_parallels $id 306 | end 307 | end 308 | end 309 | end 310 | 311 | function __bobthefish_prompt_vagrant_vbox -S -a id -d 'Display VirtualBox Vagrant status' 312 | set -l vagrant_status 313 | set -l vm_status (VBoxManage showvminfo --machinereadable $id ^/dev/null | command grep 'VMState=' | tr -d '"' | cut -d '=' -f 2) 314 | switch "$vm_status" 315 | case 'running' 316 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_running_glyph" 317 | case 'poweroff' 318 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_poweroff_glyph" 319 | case 'aborted' 320 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_aborted_glyph" 321 | case 'saved' 322 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_saved_glyph" 323 | case 'stopping' 324 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_stopping_glyph" 325 | case '' 326 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_unknown_glyph" 327 | end 328 | [ -z "$vagrant_status" ]; and return 329 | 330 | __bobthefish_start_segment $__color_vagrant 331 | echo -ns $vagrant_status ' ' 332 | end 333 | 334 | function __bobthefish_prompt_vagrant_vmware -S -a id -d 'Display VMWare Vagrant status' 335 | set -l vagrant_status 336 | if [ (pgrep -f "$id") ] 337 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_running_glyph" 338 | else 339 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_poweroff_glyph" 340 | end 341 | [ -z "$vagrant_status" ]; and return 342 | 343 | __bobthefish_start_segment $__color_vagrant 344 | echo -ns $vagrant_status ' ' 345 | end 346 | 347 | function __bobthefish_prompt_vagrant_parallels -S -d 'Display Parallels Vagrant status' 348 | set -l vagrant_status 349 | set -l vm_status (prlctl list $id -o status ^/dev/null | command tail -1) 350 | switch "$vm_status" 351 | case 'running' 352 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_running_glyph" 353 | case 'stopped' 354 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_poweroff_glyph" 355 | case 'paused' 356 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_saved_glyph" 357 | case 'suspended' 358 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_saved_glyph" 359 | case 'stopping' 360 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_stopping_glyph" 361 | case '' 362 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_unknown_glyph" 363 | end 364 | [ -z "$vagrant_status" ]; and return 365 | 366 | __bobthefish_start_segment $__color_vagrant 367 | echo -ns $vagrant_status ' ' 368 | end 369 | 370 | function __bobthefish_prompt_docker -S -d 'Show docker machine name' 371 | [ "$theme_display_docker_machine" = 'no' -o -z "$DOCKER_MACHINE_NAME" ]; and return 372 | __bobthefish_start_segment $__color_vagrant 373 | echo -ns $DOCKER_MACHINE_NAME ' ' 374 | end 375 | 376 | function __bobthefish_prompt_status -S -a last_status -d 'Display symbols for a non zero exit status, root and background jobs' 377 | set -l nonzero 378 | set -l superuser 379 | set -l bg_jobs 380 | 381 | # Last exit was nonzero 382 | [ $last_status -ne 0 ] 383 | and set nonzero $__bobthefish_nonzero_exit_glyph 384 | 385 | # if superuser (uid == 0) 386 | [ (id -u) -eq 0 ] 387 | and set superuser $__bobthefish_superuser_glyph 388 | 389 | # Jobs display 390 | [ (jobs -l | wc -l) -gt 0 ] 391 | and set bg_jobs $__bobthefish_bg_job_glyph 392 | 393 | if [ "$nonzero" -o "$superuser" -o "$bg_jobs" ] 394 | __bobthefish_start_segment $__color_initial_segment_exit 395 | if [ "$nonzero" ] 396 | set_color normal 397 | set_color -b $__color_initial_segment_exit 398 | if [ "$theme_show_exit_status" = 'yes' ] 399 | echo -ns $last_status ' ' 400 | else 401 | echo -n $__bobthefish_nonzero_exit_glyph 402 | end 403 | end 404 | 405 | if [ "$superuser" ] 406 | set_color normal 407 | if [ -z "$FAKEROOTKEY" ] 408 | set_color -b $__color_initial_segment_su 409 | else 410 | set_color -b $__color_initial_segment_exit 411 | end 412 | 413 | echo -n $__bobthefish_superuser_glyph 414 | end 415 | 416 | if [ "$bg_jobs" ] 417 | set_color normal 418 | set_color -b $__color_initial_segment_jobs 419 | echo -n $__bobthefish_bg_job_glyph 420 | end 421 | end 422 | end 423 | 424 | function __bobthefish_prompt_user -S -d 'Display actual user if different from $default_user in a prompt segment' 425 | if [ "$theme_display_user" = 'yes' ] 426 | if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ] 427 | __bobthefish_start_segment $__color_username 428 | set -l IFS . 429 | hostname | read -l hostname __ 430 | echo -ns (whoami) '@' $hostname ' ' 431 | end 432 | end 433 | end 434 | 435 | function __bobthefish_prompt_hg -S -a current_dir -d 'Display the actual hg state' 436 | set -l dirty (command hg stat; or echo -n '*') 437 | 438 | set -l flags "$dirty" 439 | [ "$flags" ] 440 | and set flags "" 441 | 442 | set -l flag_colors $__color_repo 443 | if [ "$dirty" ] 444 | set flag_colors $__color_repo_dirty 445 | end 446 | 447 | __bobthefish_path_segment $current_dir 448 | 449 | __bobthefish_start_segment $flag_colors 450 | echo -ns $__bobthefish_hg_glyph ' ' 451 | 452 | __bobthefish_start_segment $flag_colors 453 | echo -ns (__bobthefish_hg_branch) $flags ' ' 454 | set_color normal 455 | 456 | set -l project_pwd (__bobthefish_project_pwd $current_dir) 457 | if [ "$project_pwd" ] 458 | if [ -w "$PWD" ] 459 | __bobthefish_start_segment $__color_path 460 | else 461 | __bobthefish_start_segment $__color_path_nowrite 462 | end 463 | 464 | echo -ns $project_pwd ' ' 465 | end 466 | end 467 | 468 | function __bobthefish_prompt_git -S -a current_dir -d 'Display the actual git state' 469 | set -l dirty (command git diff --no-ext-diff --quiet --exit-code; or echo -n '*') 470 | set -l staged (command git diff --cached --no-ext-diff --quiet --exit-code; or echo -n '~') 471 | set -l stashed (command git rev-parse --verify --quiet refs/stash >/dev/null; and echo -n '$') 472 | set -l ahead (__bobthefish_git_ahead) 473 | 474 | set -l new '' 475 | set -l show_untracked (command git config --bool bash.showUntrackedFiles) 476 | if [ "$theme_display_git_untracked" != 'no' -a "$show_untracked" != 'false' ] 477 | set new (command git ls-files --other --exclude-standard --directory --no-empty-directory) 478 | if [ "$new" ] 479 | if [ "$theme_avoid_ambiguous_glyphs" = 'yes' ] 480 | set new '...' 481 | else 482 | set new '…' 483 | end 484 | end 485 | end 486 | 487 | set -l flags "$dirty$staged$stashed$ahead$new" 488 | [ "$flags" ] 489 | and set flags " $flags" 490 | 491 | set -l flag_colors $__color_repo 492 | if [ "$dirty" ] 493 | set flag_colors $__color_repo_dirty 494 | else if [ "$staged" ] 495 | set flag_colors $__color_repo_staged 496 | end 497 | 498 | __bobthefish_path_segment $current_dir 499 | 500 | __bobthefish_start_segment $flag_colors 501 | echo -ns (__bobthefish_git_branch) $flags ' ' 502 | set_color normal 503 | 504 | if [ "$theme_git_worktree_support" != 'yes' ] 505 | set -l project_pwd (__bobthefish_project_pwd $current_dir) 506 | if [ "$project_pwd" ] 507 | if [ -w "$PWD" ] 508 | __bobthefish_start_segment $__color_path 509 | else 510 | __bobthefish_start_segment $__color_path_nowrite 511 | end 512 | 513 | echo -ns $project_pwd ' ' 514 | end 515 | return 516 | end 517 | 518 | set -l project_pwd (command git rev-parse --show-prefix ^/dev/null | string replace -r '/$' '') 519 | set -l work_dir (command git rev-parse --show-toplevel ^/dev/null) 520 | 521 | # only show work dir if it's a parent… 522 | if [ "$work_dir" ] 523 | switch $PWD/ 524 | case $work_dir/\* 525 | string match "$current_dir*" $work_dir >/dev/null 526 | and set work_dir (string sub -s (math 1 + (string length $current_dir)) $work_dir) 527 | case \* 528 | set -e work_dir 529 | end 530 | end 531 | 532 | if [ "$project_pwd" -o "$work_dir" ] 533 | set -l colors $__color_path 534 | if not [ -w "$PWD" ] 535 | set colors $__color_path_nowrite 536 | end 537 | 538 | __bobthefish_start_segment $colors 539 | 540 | # handle work_dir != project dir 541 | if [ "$work_dir" ] 542 | set -l work_parent (dirname $work_dir | string replace -r '^/' '') 543 | if [ "$work_parent" ] 544 | echo -n "$work_parent/" 545 | end 546 | set_color normal 547 | set_color -b $__color_repo_work_tree 548 | echo -n (basename $work_dir) 549 | set_color normal 550 | set_color -b $colors 551 | [ "$project_pwd" ] 552 | and echo -n '/' 553 | end 554 | 555 | echo -ns $project_pwd ' ' 556 | else 557 | set project_pwd $PWD 558 | string match "$current_dir*" $project_pwd >/dev/null 559 | and set project_pwd (string sub -s (math 1 + (string length $current_dir)) $project_pwd) 560 | set project_pwd (string replace -r '^/' '' $project_pwd) 561 | 562 | if [ "$project_pwd" ] 563 | set -l colors $__color_path 564 | if not [ -w "$PWD" ] 565 | set colors $__color_path_nowrite 566 | end 567 | 568 | __bobthefish_start_segment $colors 569 | 570 | echo -ns $project_pwd ' ' 571 | end 572 | end 573 | end 574 | 575 | function __bobthefish_prompt_dir -S -d 'Display a shortened form of the current directory' 576 | __bobthefish_path_segment "$PWD" 577 | end 578 | 579 | function __bobthefish_prompt_vi -S -d 'Display vi mode' 580 | [ "$theme_display_vi" != 'no' ]; or return 581 | [ "$fish_key_bindings" = 'fish_hybrid_key_bindings' -o "$fish_key_bindings" = 'fish_vi_key_bindings' ]; or return 582 | switch $fish_bind_mode 583 | case default 584 | __bobthefish_start_segment $__color_vi_mode_default 585 | echo -n 'N ' 586 | case insert 587 | __bobthefish_start_segment $__color_vi_mode_insert 588 | echo -n 'I ' 589 | case replace-one 590 | __bobthefish_start_segment $__color_vi_mode_insert 591 | echo -n 'R ' 592 | case visual 593 | __bobthefish_start_segment $__color_vi_mode_visual 594 | echo -n 'V ' 595 | end 596 | end 597 | 598 | function __bobthefish_virtualenv_python_version -S -d 'Get current python version' 599 | switch (python --version ^| tr '\n' ' ') 600 | case 'Python 2*PyPy*' 601 | echo $__bobthefish_pypy_glyph 602 | case 'Python 3*PyPy*' 603 | echo -s $__bobthefish_pypy_glyph $__bobthefish_superscript_glyph[3] 604 | case 'Python 2*' 605 | echo $__bobthefish_superscript_glyph[2] 606 | case 'Python 3*' 607 | echo $__bobthefish_superscript_glyph[3] 608 | end 609 | end 610 | 611 | function __bobthefish_prompt_virtualfish -S -d "Display activated virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself)" 612 | [ "$theme_display_virtualenv" = 'no' -o -z "$VIRTUAL_ENV" ]; and return 613 | set -l version_glyph (__bobthefish_virtualenv_python_version) 614 | if [ "$version_glyph" ] 615 | __bobthefish_start_segment $__color_virtualfish 616 | echo -ns $__bobthefish_virtualenv_glyph $version_glyph ' ' 617 | end 618 | echo -ns (basename "$VIRTUAL_ENV") ' ' 619 | end 620 | 621 | function __bobthefish_rvm_parse_ruby -S -a ruby_string scope -d 'Parse RVM Ruby string' 622 | # Function arguments: 623 | # - 'ruby-2.2.3@rails', 'jruby-1.7.19'... 624 | # - 'default' or 'current' 625 | set -l IFS @ 626 | echo "$ruby_string" | read __ruby __rvm_{$scope}_ruby_gemset __ 627 | set IFS - 628 | echo "$__ruby" | read __rvm_{$scope}_ruby_interpreter __rvm_{$scope}_ruby_version __ 629 | set -e __ruby 630 | set -e __ 631 | end 632 | 633 | function __bobthefish_rvm_info -S -d 'Current Ruby information from RVM' 634 | # More `sed`/`grep`/`cut` magic... 635 | set -l __rvm_default_ruby (grep GEM_HOME ~/.rvm/environments/default | sed -e"s/'//g" | sed -e's/.*\///') 636 | set -l __rvm_current_ruby (rvm-prompt i v g) 637 | [ "$__rvm_default_ruby" = "$__rvm_current_ruby" ]; and return 638 | 639 | set -l __rvm_default_ruby_gemset 640 | set -l __rvm_default_ruby_interpreter 641 | set -l __rvm_default_ruby_version 642 | set -l __rvm_current_ruby_gemset 643 | set -l __rvm_current_ruby_interpreter 644 | set -l __rvm_current_ruby_version 645 | 646 | # Parse default and current Rubies to global variables 647 | __bobthefish_rvm_parse_ruby $__rvm_default_ruby default 648 | __bobthefish_rvm_parse_ruby $__rvm_current_ruby current 649 | # Show unobtrusive RVM prompt 650 | 651 | # If interpreter differs form default interpreter, show everything: 652 | if [ "$__rvm_default_ruby_interpreter" != "$__rvm_current_ruby_interpreter" ] 653 | if [ "$__rvm_current_ruby_gemset" = 'global' ] 654 | rvm-prompt i v 655 | else 656 | rvm-prompt i v g 657 | end 658 | # If version differs form default version 659 | else if [ "$__rvm_default_ruby_version" != "$__rvm_current_ruby_version" ] 660 | if [ "$__rvm_current_ruby_gemset" = 'global' ] 661 | rvm-prompt v 662 | else 663 | rvm-prompt v g 664 | end 665 | # If gemset differs form default or 'global' gemset, just show it 666 | else if [ "$__rvm_default_ruby_gemset" != "$__rvm_current_ruby_gemset" ] 667 | rvm-prompt g 668 | end 669 | end 670 | 671 | function __bobthefish_show_ruby -S -d 'Current Ruby (rvm/rbenv)' 672 | set -l ruby_version 673 | if type -q rvm-prompt 674 | set ruby_version (__bobthefish_rvm_info) 675 | else if type -q rbenv 676 | set ruby_version (rbenv version-name) 677 | # Don't show global ruby version... 678 | set -q RBENV_ROOT 679 | or set -l RBENV_ROOT $HOME/.rbenv 680 | 681 | [ -e "$RBENV_ROOT/version" ] 682 | and read -l global_ruby_version <"$RBENV_ROOT/version" 683 | 684 | [ "$global_ruby_version" ] 685 | or set -l global_ruby_version system 686 | 687 | [ "$ruby_version" = "$global_ruby_version" ]; and return 688 | else if type -q chruby 689 | set ruby_version $RUBY_VERSION 690 | end 691 | [ -z "$ruby_version" ]; and return 692 | __bobthefish_start_segment $__color_rvm 693 | echo -ns $__bobthefish_ruby_glyph $ruby_version ' ' 694 | end 695 | 696 | function __bobthefish_prompt_rubies -S -d 'Display current Ruby information' 697 | [ "$theme_display_ruby" = 'no' ]; and return 698 | __bobthefish_show_ruby 699 | end 700 | 701 | # =========================== 702 | # Debugging functions 703 | # =========================== 704 | 705 | function __bobthefish_display_colors -d 'Print example prompts using the current color scheme' 706 | set -g __bobthefish_display_colors 707 | end 708 | 709 | function __bobthefish_maybe_display_colors -S 710 | if not set -q __bobthefish_display_colors 711 | return 712 | end 713 | 714 | set -e __bobthefish_display_colors 715 | 716 | echo 717 | set_color normal 718 | 719 | __bobthefish_start_segment $__color_initial_segment_exit 720 | echo -n exit '! ' 721 | set_color -b $__color_initial_segment_su 722 | echo -n su '$ ' 723 | set_color -b $__color_initial_segment_jobs 724 | echo -n jobs '% ' 725 | __bobthefish_finish_segments 726 | set_color normal 727 | echo -n "(<- color_initial_segment)" 728 | echo 729 | 730 | __bobthefish_start_segment $__color_path 731 | echo -n /color/path/ 732 | set_color -b $__color_path_basename 733 | echo -ns basename ' ' 734 | __bobthefish_finish_segments 735 | echo 736 | 737 | __bobthefish_start_segment $__color_path_nowrite 738 | echo -n /color/path/nowrite/ 739 | set_color -b $__color_path_nowrite_basename 740 | echo -ns basename ' ' 741 | __bobthefish_finish_segments 742 | echo 743 | 744 | __bobthefish_start_segment $__color_path 745 | echo -n /color/path/ 746 | set_color -b $__color_path_basename 747 | echo -ns basename ' ' 748 | __bobthefish_start_segment $__color_repo 749 | echo -ns $__bobthefish_branch_glyph ' ' 750 | echo -n "color-repo " 751 | __bobthefish_finish_segments 752 | echo 753 | 754 | __bobthefish_start_segment $__color_path 755 | echo -n /color/path/ 756 | set_color -b $__color_path_basename 757 | echo -ns basename ' ' 758 | __bobthefish_start_segment $__color_repo_dirty 759 | echo -ns $__bobthefish_branch_glyph ' ' 760 | echo -n "color-repo-dirty " 761 | __bobthefish_finish_segments 762 | echo 763 | 764 | __bobthefish_start_segment $__color_path 765 | echo -n /color/path/ 766 | set_color -b $__color_path_basename 767 | echo -ns basename ' ' 768 | __bobthefish_start_segment $__color_repo_staged 769 | echo -ns $__bobthefish_branch_glyph ' ' 770 | echo -n "color-repo-staged " 771 | __bobthefish_finish_segments 772 | echo 773 | 774 | __bobthefish_start_segment $__color_vi_mode_default 775 | echo -ns vi_mode_default ' ' 776 | __bobthefish_finish_segments 777 | __bobthefish_start_segment $__color_vi_mode_insert 778 | echo -ns vi_mode_insert ' ' 779 | __bobthefish_finish_segments 780 | __bobthefish_start_segment $__color_vi_mode_visual 781 | echo -ns vi_mode_visual ' ' 782 | __bobthefish_finish_segments 783 | echo 784 | 785 | __bobthefish_start_segment $__color_vagrant 786 | echo -n color_vagrant ' ' 787 | __bobthefish_finish_segments 788 | echo 789 | 790 | __bobthefish_start_segment $__color_username 791 | echo -n color_username ' ' 792 | __bobthefish_finish_segments 793 | echo 794 | 795 | __bobthefish_start_segment $__color_rvm 796 | echo -n color_rvm ' ' 797 | __bobthefish_finish_segments 798 | __bobthefish_start_segment $__color_virtualfish 799 | echo -ns color_virtualfish ' ' 800 | __bobthefish_finish_segments 801 | echo -e "\n" 802 | 803 | end 804 | 805 | # =========================== 806 | # Apply theme 807 | # =========================== 808 | 809 | function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' 810 | # Save the last status for later (do this before the `set` calls below) 811 | set -l last_status $status 812 | 813 | # Powerline glyphs 814 | set -l __bobthefish_branch_glyph \uE0A0 815 | set -l __bobthefish_right_black_arrow_glyph \uE0B0 816 | set -l __bobthefish_right_arrow_glyph \uE0B1 817 | set -l __bobthefish_left_black_arrow_glyph \uE0B2 818 | set -l __bobthefish_left_arrow_glyph \uE0B3 819 | 820 | # Additional glyphs 821 | set -l __bobthefish_detached_glyph \u27A6 822 | set -l __bobthefish_tag_glyph \u2302 823 | set -l __bobthefish_nonzero_exit_glyph '! ' 824 | set -l __bobthefish_superuser_glyph '$ ' 825 | set -l __bobthefish_bg_job_glyph '% ' 826 | set -l __bobthefish_hg_glyph \u263F 827 | 828 | # Python glyphs 829 | set -l __bobthefish_superscript_glyph \u00B9 \u00B2 \u00B3 830 | set -l __bobthefish_virtualenv_glyph \u25F0 831 | set -l __bobthefish_pypy_glyph \u1D56 832 | 833 | set -l __bobthefish_ruby_glyph '' 834 | 835 | # Vagrant glyphs 836 | set -l __bobthefish_vagrant_running_glyph \u2191 # ↑ 'running' 837 | set -l __bobthefish_vagrant_poweroff_glyph \u2193 # ↓ 'poweroff' 838 | set -l __bobthefish_vagrant_aborted_glyph \u2715 # ✕ 'aborted' 839 | set -l __bobthefish_vagrant_saved_glyph \u21E1 # ⇡ 'saved' 840 | set -l __bobthefish_vagrant_stopping_glyph \u21E3 # ⇣ 'stopping' 841 | set -l __bobthefish_vagrant_unknown_glyph '!' # strange cases 842 | 843 | # Disable Powerline fonts 844 | if [ "$theme_powerline_fonts" = "no" ] 845 | set __bobthefish_branch_glyph \u2387 846 | set __bobthefish_right_black_arrow_glyph '' 847 | set __bobthefish_right_arrow_glyph '' 848 | set __bobthefish_left_black_arrow_glyph '' 849 | set __bobthefish_left_arrow_glyph '' 850 | end 851 | 852 | # Use prettier Nerd Fonts glyphs 853 | if [ "$theme_nerd_fonts" = "yes" ] 854 | set __bobthefish_branch_glyph \uF418 855 | set __bobthefish_detached_glyph \uF417 856 | set __bobthefish_tag_glyph \uF412 857 | 858 | set __bobthefish_virtualenv_glyph \uE73C ' ' 859 | set __bobthefish_ruby_glyph \uE791 ' ' 860 | 861 | set __bobthefish_vagrant_running_glyph \uF431 # ↑ 'running' 862 | set __bobthefish_vagrant_poweroff_glyph \uF433 # ↓ 'poweroff' 863 | set __bobthefish_vagrant_aborted_glyph \uF468 # ✕ 'aborted' 864 | set __bobthefish_vagrant_unknown_glyph \uF421 # strange cases 865 | end 866 | 867 | 868 | # Colors 869 | 870 | switch "$theme_color_scheme" 871 | case 'user' 872 | # Do not set any variables in this section. 873 | 874 | # If you want to create your own color scheme, set `theme_color_scheme` to 875 | # `user` and define the `__color_*` variables listed below in your fish 876 | # startup file (`$OMF_CONFIG/init.fish`, or similar). 877 | 878 | # The value for each variable is an argument to pass to `set_color -b`. 879 | # You can copy the commented code below as a base for your custom colors. 880 | # Use `__bobthefish_display_colors` at the command line to easily see what 881 | # these variables are used for. 882 | 883 | # See the built-in color schemes below for more examples. 884 | 885 | # # Example bobthefish color scheme: 886 | # set -g theme_color_scheme user 887 | # 888 | # set -g __color_initial_segment_exit ffffff ce000f --bold 889 | # set -g __color_initial_segment_su ffffff 189303 --bold 890 | # set -g __color_initial_segment_jobs ffffff 255e87 --bold 891 | # 892 | # set -g __color_path 333333 999999 893 | # set -g __color_path_basename 333333 ffffff --bold 894 | # set -g __color_path_nowrite 660000 cc9999 895 | # set -g __color_path_nowrite_basename 660000 cc9999 --bold 896 | # 897 | # set -g __color_repo addc10 0c4801 898 | # set -g __color_repo_work_tree 333333 ffffff --bold 899 | # set -g __color_repo_dirty ce000f ffffff 900 | # set -g __color_repo_staged f6b117 3a2a03 901 | # 902 | # set -g __color_vi_mode_default 999999 333333 --bold 903 | # set -g __color_vi_mode_insert 189303 333333 --bold 904 | # set -g __color_vi_mode_visual f6b117 3a2a03 --bold 905 | # 906 | # set -g __color_vagrant 48b4fb ffffff --bold 907 | # set -g __color_username cccccc 255e87 908 | # set -g __color_rvm af0000 cccccc --bold 909 | # set -g __color_virtualfish 005faf cccccc --bold 910 | 911 | case 'terminal' 'terminal-dark*' 912 | set -l colorfg black 913 | [ $theme_color_scheme = 'terminal-dark-white' ]; and set colorfg white 914 | set __color_initial_segment_exit white red --bold 915 | set __color_initial_segment_su white green --bold 916 | set __color_initial_segment_jobs white blue --bold 917 | 918 | set __color_path black white 919 | set __color_path_basename black white --bold 920 | set __color_path_nowrite magenta $colorfg 921 | set __color_path_nowrite_basename magenta $colorfg --bold 922 | 923 | set __color_repo green $colorfg 924 | set __color_repo_work_tree black $colorfg --bold 925 | set __color_repo_dirty brred $colorfg 926 | set __color_repo_staged yellow $colorfg 927 | 928 | set __color_vi_mode_default brblue $colorfg --bold 929 | set __color_vi_mode_insert brgreen $colorfg --bold 930 | set __color_vi_mode_visual bryellow $colorfg --bold 931 | 932 | set __color_vagrant brcyan $colorfg 933 | set __color_username white black 934 | set __color_rvm brmagenta $colorfg --bold 935 | set __color_virtualfish brblue $colorfg --bold 936 | 937 | case 'terminal-light*' 938 | set -l colorfg white 939 | [ $theme_color_scheme = 'terminal-light-black' ]; and set colorfg black 940 | set __color_initial_segment_exit black red --bold 941 | set __color_initial_segment_su black green --bold 942 | set __color_initial_segment_jobs black blue --bold 943 | 944 | set __color_path white black 945 | set __color_path_basename white black --bold 946 | set __color_path_nowrite magenta $colorfg 947 | set __color_path_nowrite_basename magenta $colorfg --bold 948 | 949 | set __color_repo green $colorfg 950 | set __color_repo_work_tree white $colorfg --bold 951 | set __color_repo_dirty brred $colorfg 952 | set __color_repo_staged yellow $colorfg 953 | 954 | set __color_vi_mode_default brblue $colorfg --bold 955 | set __color_vi_mode_insert brgreen $colorfg --bold 956 | set __color_vi_mode_visual bryellow $colorfg --bold 957 | 958 | set __color_vagrant brcyan $colorfg 959 | set __color_username black white 960 | set __color_rvm brmagenta $colorfg --bold 961 | set __color_virtualfish brblue $colorfg --bold 962 | 963 | case 'terminal2' 'terminal2-dark*' 964 | set -l colorfg black 965 | [ $theme_color_scheme = 'terminal2-dark-white' ]; and set colorfg white 966 | set __color_initial_segment_exit grey red --bold 967 | set __color_initial_segment_su grey green --bold 968 | set __color_initial_segment_jobs grey blue --bold 969 | 970 | set __color_path brgrey white 971 | set __color_path_basename brgrey white --bold 972 | set __color_path_nowrite magenta $colorfg 973 | set __color_path_nowrite_basename magenta $colorfg --bold 974 | 975 | set __color_repo green $colorfg 976 | set __color_repo_work_tree brgrey $colorfg --bold 977 | set __color_repo_dirty brred $colorfg 978 | set __color_repo_staged yellow $colorfg 979 | 980 | set __color_vi_mode_default brblue $colorfg --bold 981 | set __color_vi_mode_insert brgreen $colorfg --bold 982 | set __color_vi_mode_visual bryellow $colorfg --bold 983 | 984 | set __color_vagrant brcyan $colorfg 985 | set __color_username brgrey white 986 | set __color_rvm brmagenta $colorfg --bold 987 | set __color_virtualfish brblue $colorfg --bold 988 | 989 | case 'terminal2-light*' 990 | set -l colorfg white 991 | [ $theme_color_scheme = 'terminal2-light-black' ]; and set colorfg black 992 | set __color_initial_segment_exit brgrey red --bold 993 | set __color_initial_segment_su brgrey green --bold 994 | set __color_initial_segment_jobs brgrey blue --bold 995 | 996 | set __color_path grey black 997 | set __color_path_basename grey black --bold 998 | set __color_path_nowrite magenta $colorfg 999 | set __color_path_nowrite_basename magenta $colorfg --bold 1000 | 1001 | set __color_repo green $colorfg 1002 | set __color_repo_work_tree grey $colorfg --bold 1003 | set __color_repo_dirty brred $colorfg 1004 | set __color_repo_staged yellow $colorfg 1005 | 1006 | set __color_vi_mode_default brblue $colorfg --bold 1007 | set __color_vi_mode_insert brgreen $colorfg --bold 1008 | set __color_vi_mode_visual bryellow $colorfg --bold 1009 | 1010 | set __color_vagrant brcyan $colorfg 1011 | set __color_username grey black 1012 | set __color_rvm brmagenta $colorfg --bold 1013 | set __color_virtualfish brblue $colorfg --bold 1014 | 1015 | case 'zenburn' 1016 | set -l grey 333333 # a bit darker than normal zenburn grey 1017 | set -l red CC9393 1018 | set -l green 7F9F7F 1019 | set -l yellow E3CEAB 1020 | set -l orange DFAF8F 1021 | set -l blue 8CD0D3 1022 | set -l white DCDCCC 1023 | 1024 | set __color_initial_segment_exit $white $red --bold 1025 | set __color_initial_segment_su $white $green --bold 1026 | set __color_initial_segment_jobs $white $blue --bold 1027 | 1028 | set __color_path $grey $white 1029 | set __color_path_basename $grey $white --bold 1030 | set __color_path_nowrite $grey $red 1031 | set __color_path_nowrite_basename $grey $red --bold 1032 | 1033 | set __color_repo $green $grey 1034 | set __color_repo_work_tree $grey $grey --bold 1035 | set __color_repo_dirty $red $grey 1036 | set __color_repo_staged $yellow $grey 1037 | 1038 | set __color_vi_mode_default $grey $yellow --bold 1039 | set __color_vi_mode_insert $green $white --bold 1040 | set __color_vi_mode_visual $yellow $grey --bold 1041 | 1042 | set __color_vagrant $blue $green --bold 1043 | set __color_username $grey $blue 1044 | set __color_rvm $red $grey --bold 1045 | set __color_virtualfish $blue $grey --bold 1046 | 1047 | case 'base16-light' 1048 | set -l base00 181818 1049 | set -l base01 282828 1050 | set -l base02 383838 1051 | set -l base03 585858 1052 | set -l base04 b8b8b8 1053 | set -l base05 d8d8d8 1054 | set -l base06 e8e8e8 1055 | set -l base07 f8f8f8 1056 | set -l base08 ab4642 # red 1057 | set -l base09 dc9656 # orange 1058 | set -l base0A f7ca88 # yellow 1059 | set -l base0B a1b56c # green 1060 | set -l base0C 86c1b9 # cyan 1061 | set -l base0D 7cafc2 # blue 1062 | set -l base0E ba8baf # violet 1063 | set -l base0F a16946 # brown 1064 | 1065 | set -l colorfg $base00 1066 | 1067 | set __color_initial_segment_exit $base02 $base08 --bold 1068 | set __color_initial_segment_su $base02 $base0B --bold 1069 | set __color_initial_segment_jobs $base02 $base0D --bold 1070 | 1071 | set __color_path $base06 $base02 1072 | set __color_path_basename $base06 $base01 --bold 1073 | set __color_path_nowrite $base06 $base08 1074 | set __color_path_nowrite_basename $base06 $base08 --bold 1075 | 1076 | set __color_repo $base0B $colorfg 1077 | set __color_repo_work_tree $base06 $colorfg --bold 1078 | set __color_repo_dirty $base08 $colorfg 1079 | set __color_repo_staged $base09 $colorfg 1080 | 1081 | set __color_vi_mode_default $base04 $colorfg --bold 1082 | set __color_vi_mode_insert $base0B $colorfg --bold 1083 | set __color_vi_mode_visual $base09 $colorfg --bold 1084 | 1085 | set __color_vagrant $base0C $colorfg --bold 1086 | set __color_username $base02 $base0D 1087 | set __color_rvm $base08 $colorfg --bold 1088 | set __color_virtualfish $base0D $colorfg --bold 1089 | 1090 | case 'base16' 'base16-dark' 1091 | set -l base00 181818 1092 | set -l base01 282828 1093 | set -l base02 383838 1094 | set -l base03 585858 1095 | set -l base04 b8b8b8 1096 | set -l base05 d8d8d8 1097 | set -l base06 e8e8e8 1098 | set -l base07 f8f8f8 1099 | set -l base08 ab4642 # red 1100 | set -l base09 dc9656 # orange 1101 | set -l base0A f7ca88 # yellow 1102 | set -l base0B a1b56c # green 1103 | set -l base0C 86c1b9 # cyan 1104 | set -l base0D 7cafc2 # blue 1105 | set -l base0E ba8baf # violet 1106 | set -l base0F a16946 # brown 1107 | 1108 | set -l colorfg $base07 1109 | 1110 | set __color_initial_segment_exit $base05 $base08 --bold 1111 | set __color_initial_segment_su $base05 $base0B --bold 1112 | set __color_initial_segment_jobs $base05 $base0D --bold 1113 | 1114 | set __color_path $base02 $base05 1115 | set __color_path_basename $base02 $base06 --bold 1116 | set __color_path_nowrite $base02 $base08 1117 | set __color_path_nowrite_basename $base02 $base08 --bold 1118 | 1119 | set __color_repo $base0B $colorfg 1120 | set __color_repo_work_tree $base02 $colorfg --bold 1121 | set __color_repo_dirty $base08 $colorfg 1122 | set __color_repo_staged $base09 $colorfg 1123 | 1124 | set __color_vi_mode_default $base03 $colorfg --bold 1125 | set __color_vi_mode_insert $base0B $colorfg --bold 1126 | set __color_vi_mode_visual $base09 $colorfg --bold 1127 | 1128 | set __color_vagrant $base0C $colorfg --bold 1129 | set __color_username $base02 $base0D 1130 | set __color_rvm $base08 $colorfg --bold 1131 | set __color_virtualfish $base0D $colorfg --bold 1132 | 1133 | case 'solarized-light' 1134 | set -l base03 002b36 1135 | set -l base02 073642 1136 | set -l base01 586e75 1137 | set -l base00 657b83 1138 | set -l base0 839496 1139 | set -l base1 93a1a1 1140 | set -l base2 eee8d5 1141 | set -l base3 fdf6e3 1142 | set -l yellow b58900 1143 | set -l orange cb4b16 1144 | set -l red dc322f 1145 | set -l magenta d33682 1146 | set -l violet 6c71c4 1147 | set -l blue 268bd2 1148 | set -l cyan 2aa198 1149 | set -l green 859900 1150 | 1151 | set colorfg $base03 1152 | 1153 | set __color_initial_segment_exit $base02 $red --bold 1154 | set __color_initial_segment_su $base02 $green --bold 1155 | set __color_initial_segment_jobs $base02 $blue --bold 1156 | 1157 | set __color_path $base2 $base00 1158 | set __color_path_basename $base2 $base01 --bold 1159 | set __color_path_nowrite $base2 $orange 1160 | set __color_path_nowrite_basename $base2 $orange --bold 1161 | 1162 | set __color_repo $green $colorfg 1163 | set __color_repo_work_tree $base2 $colorfg --bold 1164 | set __color_repo_dirty $red $colorfg 1165 | set __color_repo_staged $yellow $colorfg 1166 | 1167 | set __color_vi_mode_default $blue $colorfg --bold 1168 | set __color_vi_mode_insert $green $colorfg --bold 1169 | set __color_vi_mode_visual $yellow $colorfg --bold 1170 | 1171 | set __color_vagrant $violet $colorfg --bold 1172 | set __color_username $base2 $blue 1173 | set __color_rvm $red $colorfg --bold 1174 | set __color_virtualfish $cyan $colorfg --bold 1175 | 1176 | case 'solarized' 'solarized-dark' 1177 | set -l base03 002b36 1178 | set -l base02 073642 1179 | set -l base01 586e75 1180 | set -l base00 657b83 1181 | set -l base0 839496 1182 | set -l base1 93a1a1 1183 | set -l base2 eee8d5 1184 | set -l base3 fdf6e3 1185 | set -l yellow b58900 1186 | set -l orange cb4b16 1187 | set -l red dc322f 1188 | set -l magenta d33682 1189 | set -l violet 6c71c4 1190 | set -l blue 268bd2 1191 | set -l cyan 2aa198 1192 | set -l green 859900 1193 | 1194 | set colorfg $base3 1195 | 1196 | set __color_initial_segment_exit $base2 $red --bold 1197 | set __color_initial_segment_su $base2 $green --bold 1198 | set __color_initial_segment_jobs $base2 $blue --bold 1199 | 1200 | set __color_path $base02 $base0 1201 | set __color_path_basename $base02 $base1 --bold 1202 | set __color_path_nowrite $base02 $orange 1203 | set __color_path_nowrite_basename $base02 $orange --bold 1204 | 1205 | set __color_repo $green $colorfg 1206 | set __color_repo_work_tree $base02 $colorfg --bold 1207 | set __color_repo_dirty $red $colorfg 1208 | set __color_repo_staged $yellow $colorfg 1209 | 1210 | set __color_vi_mode_default $blue $colorfg --bold 1211 | set __color_vi_mode_insert $green $colorfg --bold 1212 | set __color_vi_mode_visual $yellow $colorfg --bold 1213 | 1214 | set __color_vagrant $violet $colorfg --bold 1215 | set __color_username $base02 $blue 1216 | set __color_rvm $red $colorfg --bold 1217 | set __color_virtualfish $cyan $colorfg --bold 1218 | 1219 | case 'light' 1220 | # light medium dark 1221 | # ------ ------ ------ 1222 | set -l red cc9999 ce000f 660000 1223 | set -l green addc10 189303 0c4801 1224 | set -l blue 48b4fb 005faf 255e87 1225 | set -l orange f6b117 unused 3a2a03 1226 | set -l brown bf5e00 803f00 4d2600 1227 | set -l grey cccccc 999999 333333 1228 | set -l white ffffff 1229 | set -l black 000000 1230 | set -l ruby_red af0000 1231 | 1232 | set __color_initial_segment_exit $grey[3] $red[2] --bold 1233 | set __color_initial_segment_su $grey[3] $green[2] --bold 1234 | set __color_initial_segment_jobs $grey[3] $blue[3] --bold 1235 | 1236 | set __color_path $grey[1] $grey[2] 1237 | set __color_path_basename $grey[1] $grey[3] --bold 1238 | set __color_path_nowrite $red[1] $red[3] 1239 | set __color_path_nowrite_basename $red[1] $red[3] --bold 1240 | 1241 | set __color_repo $green[1] $green[3] 1242 | set __color_repo_work_tree $grey[1] $white --bold 1243 | set __color_repo_dirty $red[2] $white 1244 | set __color_repo_staged $orange[1] $orange[3] 1245 | 1246 | set __color_vi_mode_default $grey[2] $grey[3] --bold 1247 | set __color_vi_mode_insert $green[2] $grey[3] --bold 1248 | set __color_vi_mode_visual $orange[1] $orange[3] --bold 1249 | 1250 | set __color_vagrant $blue[1] $white --bold 1251 | set __color_username $grey[1] $blue[3] 1252 | set __color_rvm $ruby_red $grey[1] --bold 1253 | set __color_virtualfish $blue[2] $grey[1] --bold 1254 | 1255 | case 'gruvbox' 1256 | # light medium dark darkest 1257 | # ------ ------ ------ ------- 1258 | set -l red fb4934 cc241d 1259 | set -l green b8bb26 98971a 1260 | set -l yellow fabd2f d79921 1261 | set -l aqua 8ec07c 689d6a 1262 | set -l blue 83a598 458588 1263 | set -l grey cccccc 999999 333333 1264 | set -l fg fbf1c7 ebdbb2 d5c4a1 a89984 1265 | set -l bg 504945 282828 1266 | 1267 | set -g __color_initial_segment_exit $fg[1] $red[2] --bold 1268 | set -g __color_initial_segment_su $fg[1] $green[2] --bold 1269 | set -g __color_initial_segment_jobs $fg[1] $aqua[2] --bold 1270 | 1271 | set -g __color_path $bg[1] $fg[2] 1272 | set -g __color_path_basename $bg[1] $fg[2] --bold 1273 | set -g __color_path_nowrite $red[1] $fg[2] 1274 | set -g __color_path_nowrite_basename $red[1] $fg[2] --bold 1275 | 1276 | set -g __color_repo $green[2] $bg[1] 1277 | set -g __color_repo_work_tree $bg[1] $fg[2] --bold 1278 | set -g __color_repo_dirty $red[2] $fg[2] 1279 | set -g __color_repo_staged $yellow[1] $bg[1] 1280 | 1281 | set -g __color_vi_mode_default $fg[4] $bg[2] --bold 1282 | set -g __color_vi_mode_insert $blue[1] $bg[2] --bold 1283 | set -g __color_vi_mode_visual $yellow[1] $bg[2] --bold 1284 | 1285 | set -g __color_vagrant $blue[2] $fg[2] --bold 1286 | set -g __color_username $fg[3] $blue[2] 1287 | set -g __color_rvm $red[2] $fg[2] --bold 1288 | set -g __color_virtualfish $blue[2] $fg[2] --bold 1289 | 1290 | case '*' # default dark theme 1291 | # light medium dark 1292 | # ------ ------ ------ 1293 | set -l red cc9999 ce000f 660000 1294 | set -l green addc10 189303 0c4801 1295 | set -l blue 48b4fb 005faf 255e87 1296 | set -l orange f6b117 unused 3a2a03 1297 | set -l brown bf5e00 803f00 4d2600 1298 | set -l grey cccccc 999999 333333 1299 | set -l white ffffff 1300 | set -l black 000000 1301 | set -l ruby_red af0000 1302 | 1303 | set __color_initial_segment_exit $white $red[2] --bold 1304 | set __color_initial_segment_su $white $green[2] --bold 1305 | set __color_initial_segment_jobs $white $blue[3] --bold 1306 | 1307 | set __color_path $grey[3] $grey[2] 1308 | set __color_path_basename $grey[3] $white --bold 1309 | set __color_path_nowrite $red[3] $red[1] 1310 | set __color_path_nowrite_basename $red[3] $red[1] --bold 1311 | 1312 | set __color_repo $green[1] $green[3] 1313 | set __color_repo_work_tree $grey[3] $white --bold 1314 | set __color_repo_dirty $red[2] $white 1315 | set __color_repo_staged $orange[1] $orange[3] 1316 | 1317 | set __color_vi_mode_default $grey[2] $grey[3] --bold 1318 | set __color_vi_mode_insert $green[2] $grey[3] --bold 1319 | set __color_vi_mode_visual $orange[1] $orange[3] --bold 1320 | 1321 | set __color_vagrant $blue[1] $white --bold 1322 | set __color_username $grey[1] $blue[3] 1323 | set __color_rvm $ruby_red $grey[1] --bold 1324 | set __color_virtualfish $blue[2] $grey[1] --bold 1325 | end 1326 | 1327 | # Start each line with a blank slate 1328 | set -l __bobthefish_current_bg 1329 | 1330 | __bobthefish_maybe_display_colors 1331 | 1332 | __bobthefish_prompt_status $last_status 1333 | __bobthefish_prompt_vi 1334 | __bobthefish_prompt_vagrant 1335 | __bobthefish_prompt_docker 1336 | __bobthefish_prompt_user 1337 | __bobthefish_prompt_rubies 1338 | __bobthefish_prompt_virtualfish 1339 | 1340 | set -l git_root (__bobthefish_git_project_dir) 1341 | set -l hg_root (__bobthefish_hg_project_dir) 1342 | 1343 | if [ "$git_root" -a "$hg_root" ] 1344 | # only show the closest parent 1345 | switch $git_root 1346 | case $hg_root\* 1347 | __bobthefish_prompt_git $git_root 1348 | case \* 1349 | __bobthefish_prompt_hg $hg_root 1350 | end 1351 | else if [ "$git_root" ] 1352 | __bobthefish_prompt_git $git_root 1353 | else if [ "$hg_root" ] 1354 | __bobthefish_prompt_hg $hg_root 1355 | else 1356 | __bobthefish_prompt_dir 1357 | end 1358 | 1359 | __bobthefish_finish_segments 1360 | end 1361 | -------------------------------------------------------------------------------- /.config/omf/themes/theme-bobthefish/fish_prompt.fish: -------------------------------------------------------------------------------- 1 | # name: bobthefish 2 | # 3 | # bobthefish is a Powerline-style, Git-aware fish theme optimized for awesome. 4 | # 5 | # You will need a Powerline-patched font for this to work: 6 | # 7 | # https://powerline.readthedocs.org/en/master/installation.html#patched-fonts 8 | # 9 | # I recommend picking one of these: 10 | # 11 | # https://github.com/Lokaltog/powerline-fonts 12 | # 13 | # For more advanced awesome, install a nerd fonts patched font (and be sure to 14 | # enable nerd fonts support with `set -g theme_nerd_fonts yes`): 15 | # 16 | # https://github.com/ryanoasis/nerd-fonts 17 | # 18 | # You can override some default prompt options in your config.fish: 19 | # 20 | # set -g theme_display_git no 21 | # set -g theme_display_git_untracked no 22 | # set -g theme_display_git_ahead_verbose yes 23 | # set -g theme_git_worktree_support yes 24 | # set -g theme_display_vagrant yes 25 | # set -g theme_display_docker_machine no 26 | # set -g theme_display_hg yes 27 | # set -g theme_display_virtualenv no 28 | # set -g theme_display_ruby no 29 | # set -g theme_display_user yes 30 | # set -g theme_display_vi no 31 | # set -g theme_avoid_ambiguous_glyphs yes 32 | # set -g theme_powerline_fonts no 33 | # set -g theme_nerd_fonts yes 34 | # set -g theme_show_exit_status yes 35 | # set -g default_user your_normal_user 36 | # set -g theme_color_scheme dark 37 | # set -g fish_prompt_pwd_dir_length 0 38 | # set -g theme_project_dir_length 1 39 | 40 | # =========================== 41 | # Helper methods 42 | # =========================== 43 | 44 | # function __bobthefish_in_git -S -d 'Check whether pwd is inside a git repo' 45 | # command which git > /dev/null ^&1 46 | # and command git rev-parse --is-inside-work-tree >/dev/null ^&1 47 | # end 48 | 49 | # function __bobthefish_in_hg -S -d 'Check whether pwd is inside a hg repo' 50 | # command which hg > /dev/null ^&1 51 | # and command hg stat > /dev/null ^&1 52 | # end 53 | 54 | function __bobthefish_git_branch -S -d 'Get the current git branch (or commitish)' 55 | set -l ref (command git symbolic-ref HEAD ^/dev/null) 56 | and string replace 'refs/heads/' "$__bobthefish_branch_glyph " $ref 57 | and return 58 | 59 | set -l tag (command git describe --tags --exact-match ^/dev/null) 60 | and echo "$__bobthefish_tag_glyph $tag" 61 | and return 62 | 63 | set -l branch (command git show-ref --head -s --abbrev | head -n1 ^/dev/null) 64 | echo "$__bobthefish_detached_glyph $branch" 65 | end 66 | 67 | function __bobthefish_hg_branch -S -d 'Get the current hg branch' 68 | set -l branch (command hg branch ^/dev/null) 69 | set -l book (command hg book | command grep \* | cut -d\ -f3) 70 | echo "$__bobthefish_branch_glyph $branch @ $book" 71 | end 72 | 73 | function __bobthefish_pretty_parent -S -a current_dir -d 'Print a parent directory, shortened to fit the prompt' 74 | set -q fish_prompt_pwd_dir_length 75 | or set -l fish_prompt_pwd_dir_length 1 76 | 77 | # Replace $HOME with ~ 78 | set -l real_home ~ 79 | set -l parent_dir (string replace -r '^'"$real_home"'($|/)' '~$1' (dirname $current_dir)) 80 | 81 | if [ $parent_dir = "/" ] 82 | echo -n / 83 | return 84 | end 85 | 86 | if [ $fish_prompt_pwd_dir_length -eq 0 ] 87 | echo -n "$parent_dir/" 88 | return 89 | end 90 | 91 | string replace -ar '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' "$parent_dir/" 92 | end 93 | 94 | function __bobthefish_git_project_dir -S -d 'Print the current git project base directory' 95 | [ "$theme_display_git" = 'no' ]; and return 96 | if [ "$theme_git_worktree_support" != 'yes' ] 97 | command git rev-parse --show-toplevel ^/dev/null 98 | return 99 | end 100 | 101 | set -l git_dir (command git rev-parse --git-dir ^/dev/null); or return 102 | 103 | pushd $git_dir 104 | set git_dir $PWD 105 | popd 106 | 107 | switch $PWD/ 108 | case $git_dir/\* 109 | # Nothing works quite right if we're inside the git dir 110 | # TODO: fix the underlying issues then re-enable the stuff below 111 | 112 | # # if we're inside the git dir, sweet. just return that. 113 | # set -l toplevel (command git rev-parse --show-toplevel ^/dev/null) 114 | # if [ "$toplevel" ] 115 | # switch $git_dir/ 116 | # case $toplevel/\* 117 | # echo $git_dir 118 | # end 119 | # end 120 | return 121 | end 122 | 123 | set -l project_dir (dirname $git_dir) 124 | 125 | switch $PWD/ 126 | case $project_dir/\* 127 | echo $project_dir 128 | return 129 | end 130 | 131 | set project_dir (command git rev-parse --show-toplevel ^/dev/null) 132 | switch $PWD/ 133 | case $project_dir/\* 134 | echo $project_dir 135 | end 136 | end 137 | 138 | function __bobthefish_hg_project_dir -S -d 'Print the current hg project base directory' 139 | [ "$theme_display_hg" = 'yes' ]; or return 140 | set -l d $PWD 141 | while not [ $d = / ] 142 | if [ -e $d/.hg ] 143 | command hg root --cwd "$d" ^/dev/null 144 | return 145 | end 146 | set d (dirname $d) 147 | end 148 | end 149 | 150 | function __bobthefish_project_pwd -S -a current_dir -d 'Print the working directory relative to project root' 151 | set -q theme_project_dir_length 152 | or set -l theme_project_dir_length 0 153 | 154 | set -l project_dir (string replace -r '^'"$current_dir"'($|/)' '' $PWD) 155 | 156 | if [ $theme_project_dir_length -eq 0 ] 157 | echo -n $project_dir 158 | return 159 | end 160 | 161 | string replace -ar '(\.?[^/]{'"$theme_project_dir_length"'})[^/]*/' '$1/' $project_dir 162 | end 163 | 164 | function __bobthefish_git_ahead -S -d 'Print the ahead/behind state for the current branch' 165 | if [ "$theme_display_git_ahead_verbose" = 'yes' ] 166 | __bobthefish_git_ahead_verbose 167 | return 168 | end 169 | 170 | set -l ahead 0 171 | set -l behind 0 172 | for line in (command git rev-list --left-right '@{upstream}...HEAD' ^/dev/null) 173 | switch "$line" 174 | case '>*' 175 | if [ $behind -eq 1 ] 176 | echo '±' 177 | return 178 | end 179 | set ahead 1 180 | case '<*' 181 | if [ $ahead -eq 1 ] 182 | echo '±' 183 | return 184 | end 185 | set behind 1 186 | end 187 | end 188 | 189 | if [ $ahead -eq 1 ] 190 | echo '+' 191 | else if [ $behind -eq 1 ] 192 | echo '-' 193 | end 194 | end 195 | 196 | function __bobthefish_git_ahead_verbose -S -d 'Print a more verbose ahead/behind state for the current branch' 197 | set -l commits (command git rev-list --left-right '@{upstream}...HEAD' ^/dev/null) 198 | [ $status != 0 ]; and return 199 | 200 | set -l behind (count (for arg in $commits; echo $arg; end | command grep '^<')) 201 | set -l ahead (count (for arg in $commits; echo $arg; end | command grep -v '^<')) 202 | 203 | switch "$ahead $behind" 204 | case '' # no upstream 205 | case '0 0' # equal to upstream 206 | return 207 | case '* 0' # ahead of upstream 208 | echo "↑$ahead" 209 | case '0 *' # behind upstream 210 | echo "↓$behind" 211 | case '*' # diverged from upstream 212 | echo "↑$ahead↓$behind" 213 | end 214 | end 215 | 216 | # =========================== 217 | # Segment functions 218 | # =========================== 219 | 220 | function __bobthefish_start_segment -S -d 'Start a prompt segment' 221 | set -l bg $argv[1] 222 | set -e argv[1] 223 | set -l fg $argv[1] 224 | set -e argv[1] 225 | 226 | set_color normal # clear out anything bold or underline... 227 | set_color -b $bg $fg $argv 228 | 229 | switch "$__bobthefish_current_bg" 230 | case '' 231 | # If there's no background, just start one 232 | echo -n ' ' 233 | case "$bg" 234 | # If the background is already the same color, draw a separator 235 | echo -ns $__bobthefish_right_arrow_glyph ' ' 236 | case '*' 237 | # otherwise, draw the end of the previous segment and the start of the next 238 | set_color $__bobthefish_current_bg 239 | echo -ns $__bobthefish_right_black_arrow_glyph ' ' 240 | set_color $fg $argv 241 | end 242 | 243 | set __bobthefish_current_bg $bg 244 | end 245 | 246 | function __bobthefish_path_segment -S -a current_dir -d 'Display a shortened form of a directory' 247 | set -l segment_color $__color_path 248 | set -l segment_basename_color $__color_path_basename 249 | 250 | if not [ -w "$current_dir" ] 251 | set segment_color $__color_path_nowrite 252 | set segment_basename_color $__color_path_nowrite_basename 253 | end 254 | 255 | __bobthefish_start_segment $segment_color 256 | 257 | set -l directory 258 | set -l parent 259 | 260 | switch "$current_dir" 261 | case / 262 | set directory '/' 263 | case "$HOME" 264 | set directory '~' 265 | case '*' 266 | set parent (__bobthefish_pretty_parent "$current_dir") 267 | set directory (basename "$current_dir") 268 | end 269 | 270 | echo -n $parent 271 | set_color -b $segment_basename_color 272 | echo -ns $directory ' ' 273 | end 274 | 275 | function __bobthefish_finish_segments -S -d 'Close open prompt segments' 276 | if [ "$__bobthefish_current_bg" != '' ] 277 | set_color normal 278 | set_color $__bobthefish_current_bg 279 | echo -ns $__bobthefish_right_black_arrow_glyph ' ' 280 | end 281 | 282 | set_color normal 283 | set __bobthefish_current_bg 284 | end 285 | 286 | 287 | # =========================== 288 | # Theme components 289 | # =========================== 290 | 291 | function __bobthefish_prompt_vagrant -S -d 'Display Vagrant status' 292 | [ "$theme_display_vagrant" = 'yes' -a -f Vagrantfile ]; or return 293 | 294 | # .vagrant/machines/$machine/$provider/id 295 | for file in .vagrant/machines/*/*/id 296 | read -l id <$file 297 | 298 | if [ ! -z "$id" ] 299 | switch "$file" 300 | case '*/virtualbox/id' 301 | __bobthefish_prompt_vagrant_vbox $id 302 | case '*/vmware_fusion/id' 303 | __bobthefish_prompt_vagrant_vmware $id 304 | case '*/parallels/id' 305 | __bobthefish_prompt_vagrant_parallels $id 306 | end 307 | end 308 | end 309 | end 310 | 311 | function __bobthefish_prompt_vagrant_vbox -S -a id -d 'Display VirtualBox Vagrant status' 312 | set -l vagrant_status 313 | set -l vm_status (VBoxManage showvminfo --machinereadable $id ^/dev/null | command grep 'VMState=' | tr -d '"' | cut -d '=' -f 2) 314 | switch "$vm_status" 315 | case 'running' 316 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_running_glyph" 317 | case 'poweroff' 318 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_poweroff_glyph" 319 | case 'aborted' 320 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_aborted_glyph" 321 | case 'saved' 322 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_saved_glyph" 323 | case 'stopping' 324 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_stopping_glyph" 325 | case '' 326 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_unknown_glyph" 327 | end 328 | [ -z "$vagrant_status" ]; and return 329 | 330 | __bobthefish_start_segment $__color_vagrant 331 | echo -ns $vagrant_status ' ' 332 | end 333 | 334 | function __bobthefish_prompt_vagrant_vmware -S -a id -d 'Display VMWare Vagrant status' 335 | set -l vagrant_status 336 | if [ (pgrep -f "$id") ] 337 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_running_glyph" 338 | else 339 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_poweroff_glyph" 340 | end 341 | [ -z "$vagrant_status" ]; and return 342 | 343 | __bobthefish_start_segment $__color_vagrant 344 | echo -ns $vagrant_status ' ' 345 | end 346 | 347 | function __bobthefish_prompt_vagrant_parallels -S -d 'Display Parallels Vagrant status' 348 | set -l vagrant_status 349 | set -l vm_status (prlctl list $id -o status ^/dev/null | command tail -1) 350 | switch "$vm_status" 351 | case 'running' 352 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_running_glyph" 353 | case 'stopped' 354 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_poweroff_glyph" 355 | case 'paused' 356 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_saved_glyph" 357 | case 'suspended' 358 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_saved_glyph" 359 | case 'stopping' 360 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_stopping_glyph" 361 | case '' 362 | set vagrant_status "$vagrant_status$__bobthefish_vagrant_unknown_glyph" 363 | end 364 | [ -z "$vagrant_status" ]; and return 365 | 366 | __bobthefish_start_segment $__color_vagrant 367 | echo -ns $vagrant_status ' ' 368 | end 369 | 370 | function __bobthefish_prompt_docker -S -d 'Show docker machine name' 371 | [ "$theme_display_docker_machine" = 'no' -o -z "$DOCKER_MACHINE_NAME" ]; and return 372 | __bobthefish_start_segment $__color_vagrant 373 | echo -ns $DOCKER_MACHINE_NAME ' ' 374 | end 375 | 376 | function __bobthefish_prompt_status -S -a last_status -d 'Display symbols for a non zero exit status, root and background jobs' 377 | set -l nonzero 378 | set -l superuser 379 | set -l bg_jobs 380 | 381 | # Last exit was nonzero 382 | [ $last_status -ne 0 ] 383 | and set nonzero $__bobthefish_nonzero_exit_glyph 384 | 385 | # if superuser (uid == 0) 386 | [ (id -u) -eq 0 ] 387 | and set superuser $__bobthefish_superuser_glyph 388 | 389 | # Jobs display 390 | [ (jobs -l | wc -l) -gt 0 ] 391 | and set bg_jobs $__bobthefish_bg_job_glyph 392 | 393 | if [ "$nonzero" -o "$superuser" -o "$bg_jobs" ] 394 | __bobthefish_start_segment $__color_initial_segment_exit 395 | if [ "$nonzero" ] 396 | set_color normal 397 | set_color -b $__color_initial_segment_exit 398 | if [ "$theme_show_exit_status" = 'yes' ] 399 | echo -ns $last_status ' ' 400 | else 401 | echo -n $__bobthefish_nonzero_exit_glyph 402 | end 403 | end 404 | 405 | if [ "$superuser" ] 406 | set_color normal 407 | if [ -z "$FAKEROOTKEY" ] 408 | set_color -b $__color_initial_segment_su 409 | else 410 | set_color -b $__color_initial_segment_exit 411 | end 412 | 413 | echo -n $__bobthefish_superuser_glyph 414 | end 415 | 416 | if [ "$bg_jobs" ] 417 | set_color normal 418 | set_color -b $__color_initial_segment_jobs 419 | echo -n $__bobthefish_bg_job_glyph 420 | end 421 | end 422 | end 423 | 424 | function __bobthefish_prompt_user -S -d 'Display actual user if different from $default_user in a prompt segment' 425 | if [ "$theme_display_user" = 'yes' ] 426 | if [ "$USER" != "$default_user" -o -n "$SSH_CLIENT" ] 427 | __bobthefish_start_segment $__color_username 428 | set -l IFS . 429 | hostname | read -l hostname __ 430 | echo -ns (whoami) '@' $hostname ' ' 431 | end 432 | end 433 | end 434 | 435 | function __bobthefish_prompt_hg -S -a current_dir -d 'Display the actual hg state' 436 | set -l dirty (command hg stat; or echo -n '*') 437 | 438 | set -l flags "$dirty" 439 | [ "$flags" ] 440 | and set flags "" 441 | 442 | set -l flag_colors $__color_repo 443 | if [ "$dirty" ] 444 | set flag_colors $__color_repo_dirty 445 | end 446 | 447 | __bobthefish_path_segment $current_dir 448 | 449 | __bobthefish_start_segment $flag_colors 450 | echo -ns $__bobthefish_hg_glyph ' ' 451 | 452 | __bobthefish_start_segment $flag_colors 453 | echo -ns (__bobthefish_hg_branch) $flags ' ' 454 | set_color normal 455 | 456 | set -l project_pwd (__bobthefish_project_pwd $current_dir) 457 | if [ "$project_pwd" ] 458 | if [ -w "$PWD" ] 459 | __bobthefish_start_segment $__color_path 460 | else 461 | __bobthefish_start_segment $__color_path_nowrite 462 | end 463 | 464 | echo -ns $project_pwd ' ' 465 | end 466 | end 467 | 468 | function __bobthefish_prompt_git -S -a current_dir -d 'Display the actual git state' 469 | set -l dirty (command git diff --no-ext-diff --quiet --exit-code; or echo -n '*') 470 | set -l staged (command git diff --cached --no-ext-diff --quiet --exit-code; or echo -n '~') 471 | set -l stashed (command git rev-parse --verify --quiet refs/stash >/dev/null; and echo -n '$') 472 | set -l ahead (__bobthefish_git_ahead) 473 | 474 | set -l new '' 475 | set -l show_untracked (command git config --bool bash.showUntrackedFiles) 476 | if [ "$theme_display_git_untracked" != 'no' -a "$show_untracked" != 'false' ] 477 | set new (command git ls-files --other --exclude-standard --directory --no-empty-directory) 478 | if [ "$new" ] 479 | if [ "$theme_avoid_ambiguous_glyphs" = 'yes' ] 480 | set new '...' 481 | else 482 | set new '…' 483 | end 484 | end 485 | end 486 | 487 | set -l flags "$dirty$staged$stashed$ahead$new" 488 | [ "$flags" ] 489 | and set flags " $flags" 490 | 491 | set -l flag_colors $__color_repo 492 | if [ "$dirty" ] 493 | set flag_colors $__color_repo_dirty 494 | else if [ "$staged" ] 495 | set flag_colors $__color_repo_staged 496 | end 497 | 498 | __bobthefish_path_segment $current_dir 499 | 500 | __bobthefish_start_segment $flag_colors 501 | echo -ns (__bobthefish_git_branch) $flags ' ' 502 | set_color normal 503 | 504 | if [ "$theme_git_worktree_support" != 'yes' ] 505 | set -l project_pwd (__bobthefish_project_pwd $current_dir) 506 | if [ "$project_pwd" ] 507 | if [ -w "$PWD" ] 508 | __bobthefish_start_segment $__color_path 509 | else 510 | __bobthefish_start_segment $__color_path_nowrite 511 | end 512 | 513 | echo -ns $project_pwd ' ' 514 | end 515 | return 516 | end 517 | 518 | set -l project_pwd (command git rev-parse --show-prefix ^/dev/null | string replace -r '/$' '') 519 | set -l work_dir (command git rev-parse --show-toplevel ^/dev/null) 520 | 521 | # only show work dir if it's a parent… 522 | if [ "$work_dir" ] 523 | switch $PWD/ 524 | case $work_dir/\* 525 | string match "$current_dir*" $work_dir >/dev/null 526 | and set work_dir (string sub -s (math 1 + (string length $current_dir)) $work_dir) 527 | case \* 528 | set -e work_dir 529 | end 530 | end 531 | 532 | if [ "$project_pwd" -o "$work_dir" ] 533 | set -l colors $__color_path 534 | if not [ -w "$PWD" ] 535 | set colors $__color_path_nowrite 536 | end 537 | 538 | __bobthefish_start_segment $colors 539 | 540 | # handle work_dir != project dir 541 | if [ "$work_dir" ] 542 | set -l work_parent (dirname $work_dir | string replace -r '^/' '') 543 | if [ "$work_parent" ] 544 | echo -n "$work_parent/" 545 | end 546 | set_color normal 547 | set_color -b $__color_repo_work_tree 548 | echo -n (basename $work_dir) 549 | set_color normal 550 | set_color -b $colors 551 | [ "$project_pwd" ] 552 | and echo -n '/' 553 | end 554 | 555 | echo -ns $project_pwd ' ' 556 | else 557 | set project_pwd $PWD 558 | string match "$current_dir*" $project_pwd >/dev/null 559 | and set project_pwd (string sub -s (math 1 + (string length $current_dir)) $project_pwd) 560 | set project_pwd (string replace -r '^/' '' $project_pwd) 561 | 562 | if [ "$project_pwd" ] 563 | set -l colors $__color_path 564 | if not [ -w "$PWD" ] 565 | set colors $__color_path_nowrite 566 | end 567 | 568 | __bobthefish_start_segment $colors 569 | 570 | echo -ns $project_pwd ' ' 571 | end 572 | end 573 | end 574 | 575 | function __bobthefish_prompt_dir -S -d 'Display a shortened form of the current directory' 576 | __bobthefish_path_segment "$PWD" 577 | end 578 | 579 | function __bobthefish_prompt_vi -S -d 'Display vi mode' 580 | [ "$theme_display_vi" != 'no' ]; or return 581 | [ "$fish_key_bindings" = 'fish_hybrid_key_bindings' -o "$fish_key_bindings" = 'fish_vi_key_bindings' ]; or return 582 | switch $fish_bind_mode 583 | case default 584 | __bobthefish_start_segment $__color_vi_mode_default 585 | echo -n 'N ' 586 | case insert 587 | __bobthefish_start_segment $__color_vi_mode_insert 588 | echo -n 'I ' 589 | case replace-one 590 | __bobthefish_start_segment $__color_vi_mode_insert 591 | echo -n 'R ' 592 | case visual 593 | __bobthefish_start_segment $__color_vi_mode_visual 594 | echo -n 'V ' 595 | end 596 | end 597 | 598 | function __bobthefish_virtualenv_python_version -S -d 'Get current python version' 599 | switch (python --version ^| tr '\n' ' ') 600 | case 'Python 2*PyPy*' 601 | echo $__bobthefish_pypy_glyph 602 | case 'Python 3*PyPy*' 603 | echo -s $__bobthefish_pypy_glyph $__bobthefish_superscript_glyph[3] 604 | case 'Python 2*' 605 | echo $__bobthefish_superscript_glyph[2] 606 | case 'Python 3*' 607 | echo $__bobthefish_superscript_glyph[3] 608 | end 609 | end 610 | 611 | function __bobthefish_prompt_virtualfish -S -d "Display activated virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself)" 612 | [ "$theme_display_virtualenv" = 'no' -o -z "$VIRTUAL_ENV" ]; and return 613 | set -l version_glyph (__bobthefish_virtualenv_python_version) 614 | if [ "$version_glyph" ] 615 | __bobthefish_start_segment $__color_virtualfish 616 | echo -ns $__bobthefish_virtualenv_glyph $version_glyph ' ' 617 | end 618 | echo -ns (basename "$VIRTUAL_ENV") ' ' 619 | end 620 | 621 | function __bobthefish_rvm_parse_ruby -S -a ruby_string scope -d 'Parse RVM Ruby string' 622 | # Function arguments: 623 | # - 'ruby-2.2.3@rails', 'jruby-1.7.19'... 624 | # - 'default' or 'current' 625 | set -l IFS @ 626 | echo "$ruby_string" | read __ruby __rvm_{$scope}_ruby_gemset __ 627 | set IFS - 628 | echo "$__ruby" | read __rvm_{$scope}_ruby_interpreter __rvm_{$scope}_ruby_version __ 629 | set -e __ruby 630 | set -e __ 631 | end 632 | 633 | function __bobthefish_rvm_info -S -d 'Current Ruby information from RVM' 634 | # More `sed`/`grep`/`cut` magic... 635 | set -l __rvm_default_ruby (grep GEM_HOME ~/.rvm/environments/default | sed -e"s/'//g" | sed -e's/.*\///') 636 | set -l __rvm_current_ruby (rvm-prompt i v g) 637 | [ "$__rvm_default_ruby" = "$__rvm_current_ruby" ]; and return 638 | 639 | set -l __rvm_default_ruby_gemset 640 | set -l __rvm_default_ruby_interpreter 641 | set -l __rvm_default_ruby_version 642 | set -l __rvm_current_ruby_gemset 643 | set -l __rvm_current_ruby_interpreter 644 | set -l __rvm_current_ruby_version 645 | 646 | # Parse default and current Rubies to global variables 647 | __bobthefish_rvm_parse_ruby $__rvm_default_ruby default 648 | __bobthefish_rvm_parse_ruby $__rvm_current_ruby current 649 | # Show unobtrusive RVM prompt 650 | 651 | # If interpreter differs form default interpreter, show everything: 652 | if [ "$__rvm_default_ruby_interpreter" != "$__rvm_current_ruby_interpreter" ] 653 | if [ "$__rvm_current_ruby_gemset" = 'global' ] 654 | rvm-prompt i v 655 | else 656 | rvm-prompt i v g 657 | end 658 | # If version differs form default version 659 | else if [ "$__rvm_default_ruby_version" != "$__rvm_current_ruby_version" ] 660 | if [ "$__rvm_current_ruby_gemset" = 'global' ] 661 | rvm-prompt v 662 | else 663 | rvm-prompt v g 664 | end 665 | # If gemset differs form default or 'global' gemset, just show it 666 | else if [ "$__rvm_default_ruby_gemset" != "$__rvm_current_ruby_gemset" ] 667 | rvm-prompt g 668 | end 669 | end 670 | 671 | function __bobthefish_show_ruby -S -d 'Current Ruby (rvm/rbenv)' 672 | set -l ruby_version 673 | if type -q rvm-prompt 674 | set ruby_version (__bobthefish_rvm_info) 675 | else if type -q rbenv 676 | set ruby_version (rbenv version-name) 677 | # Don't show global ruby version... 678 | set -q RBENV_ROOT 679 | or set -l RBENV_ROOT $HOME/.rbenv 680 | 681 | [ -e "$RBENV_ROOT/version" ] 682 | and read -l global_ruby_version <"$RBENV_ROOT/version" 683 | 684 | [ "$global_ruby_version" ] 685 | or set -l global_ruby_version system 686 | 687 | [ "$ruby_version" = "$global_ruby_version" ]; and return 688 | else if type -q chruby 689 | set ruby_version $RUBY_VERSION 690 | end 691 | [ -z "$ruby_version" ]; and return 692 | __bobthefish_start_segment $__color_rvm 693 | echo -ns $__bobthefish_ruby_glyph $ruby_version ' ' 694 | end 695 | 696 | function __bobthefish_prompt_rubies -S -d 'Display current Ruby information' 697 | [ "$theme_display_ruby" = 'no' ]; and return 698 | __bobthefish_show_ruby 699 | end 700 | 701 | # =========================== 702 | # Debugging functions 703 | # =========================== 704 | 705 | function __bobthefish_display_colors -d 'Print example prompts using the current color scheme' 706 | set -g __bobthefish_display_colors 707 | end 708 | 709 | function __bobthefish_maybe_display_colors -S 710 | if not set -q __bobthefish_display_colors 711 | return 712 | end 713 | 714 | set -e __bobthefish_display_colors 715 | 716 | echo 717 | set_color normal 718 | 719 | __bobthefish_start_segment $__color_initial_segment_exit 720 | echo -n exit '! ' 721 | set_color -b $__color_initial_segment_su 722 | echo -n su '$ ' 723 | set_color -b $__color_initial_segment_jobs 724 | echo -n jobs '% ' 725 | __bobthefish_finish_segments 726 | set_color normal 727 | echo -n "(<- color_initial_segment)" 728 | echo 729 | 730 | __bobthefish_start_segment $__color_path 731 | echo -n /color/path/ 732 | set_color -b $__color_path_basename 733 | echo -ns basename ' ' 734 | __bobthefish_finish_segments 735 | echo 736 | 737 | __bobthefish_start_segment $__color_path_nowrite 738 | echo -n /color/path/nowrite/ 739 | set_color -b $__color_path_nowrite_basename 740 | echo -ns basename ' ' 741 | __bobthefish_finish_segments 742 | echo 743 | 744 | __bobthefish_start_segment $__color_path 745 | echo -n /color/path/ 746 | set_color -b $__color_path_basename 747 | echo -ns basename ' ' 748 | __bobthefish_start_segment $__color_repo 749 | echo -ns $__bobthefish_branch_glyph ' ' 750 | echo -n "color-repo " 751 | __bobthefish_finish_segments 752 | echo 753 | 754 | __bobthefish_start_segment $__color_path 755 | echo -n /color/path/ 756 | set_color -b $__color_path_basename 757 | echo -ns basename ' ' 758 | __bobthefish_start_segment $__color_repo_dirty 759 | echo -ns $__bobthefish_branch_glyph ' ' 760 | echo -n "color-repo-dirty " 761 | __bobthefish_finish_segments 762 | echo 763 | 764 | __bobthefish_start_segment $__color_path 765 | echo -n /color/path/ 766 | set_color -b $__color_path_basename 767 | echo -ns basename ' ' 768 | __bobthefish_start_segment $__color_repo_staged 769 | echo -ns $__bobthefish_branch_glyph ' ' 770 | echo -n "color-repo-staged " 771 | __bobthefish_finish_segments 772 | echo 773 | 774 | __bobthefish_start_segment $__color_vi_mode_default 775 | echo -ns vi_mode_default ' ' 776 | __bobthefish_finish_segments 777 | __bobthefish_start_segment $__color_vi_mode_insert 778 | echo -ns vi_mode_insert ' ' 779 | __bobthefish_finish_segments 780 | __bobthefish_start_segment $__color_vi_mode_visual 781 | echo -ns vi_mode_visual ' ' 782 | __bobthefish_finish_segments 783 | echo 784 | 785 | __bobthefish_start_segment $__color_vagrant 786 | echo -n color_vagrant ' ' 787 | __bobthefish_finish_segments 788 | echo 789 | 790 | __bobthefish_start_segment $__color_username 791 | echo -n color_username ' ' 792 | __bobthefish_finish_segments 793 | echo 794 | 795 | __bobthefish_start_segment $__color_rvm 796 | echo -n color_rvm ' ' 797 | __bobthefish_finish_segments 798 | __bobthefish_start_segment $__color_virtualfish 799 | echo -ns color_virtualfish ' ' 800 | __bobthefish_finish_segments 801 | echo -e "\n" 802 | 803 | end 804 | 805 | # =========================== 806 | # Apply theme 807 | # =========================== 808 | 809 | function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' 810 | # Save the last status for later (do this before the `set` calls below) 811 | set -l last_status $status 812 | 813 | # Powerline glyphs 814 | set -l __bobthefish_branch_glyph \uE0A0 815 | set -l __bobthefish_right_black_arrow_glyph \uE0B0 816 | set -l __bobthefish_right_arrow_glyph \uE0B1 817 | set -l __bobthefish_left_black_arrow_glyph \uE0B2 818 | set -l __bobthefish_left_arrow_glyph \uE0B3 819 | 820 | # Additional glyphs 821 | set -l __bobthefish_detached_glyph \u27A6 822 | set -l __bobthefish_tag_glyph \u2302 823 | set -l __bobthefish_nonzero_exit_glyph '! ' 824 | set -l __bobthefish_superuser_glyph '$ ' 825 | set -l __bobthefish_bg_job_glyph '% ' 826 | set -l __bobthefish_hg_glyph \u263F 827 | 828 | # Python glyphs 829 | set -l __bobthefish_superscript_glyph \u00B9 \u00B2 \u00B3 830 | set -l __bobthefish_virtualenv_glyph \u25F0 831 | set -l __bobthefish_pypy_glyph \u1D56 832 | 833 | set -l __bobthefish_ruby_glyph '' 834 | 835 | # Vagrant glyphs 836 | set -l __bobthefish_vagrant_running_glyph \u2191 # ↑ 'running' 837 | set -l __bobthefish_vagrant_poweroff_glyph \u2193 # ↓ 'poweroff' 838 | set -l __bobthefish_vagrant_aborted_glyph \u2715 # ✕ 'aborted' 839 | set -l __bobthefish_vagrant_saved_glyph \u21E1 # ⇡ 'saved' 840 | set -l __bobthefish_vagrant_stopping_glyph \u21E3 # ⇣ 'stopping' 841 | set -l __bobthefish_vagrant_unknown_glyph '!' # strange cases 842 | 843 | # Disable Powerline fonts 844 | if [ "$theme_powerline_fonts" = "no" ] 845 | set __bobthefish_branch_glyph \u2387 846 | set __bobthefish_right_black_arrow_glyph '' 847 | set __bobthefish_right_arrow_glyph '' 848 | set __bobthefish_left_black_arrow_glyph '' 849 | set __bobthefish_left_arrow_glyph '' 850 | end 851 | 852 | # Use prettier Nerd Fonts glyphs 853 | if [ "$theme_nerd_fonts" = "yes" ] 854 | set __bobthefish_branch_glyph \uF418 855 | set __bobthefish_detached_glyph \uF417 856 | set __bobthefish_tag_glyph \uF412 857 | 858 | set __bobthefish_virtualenv_glyph \uE73C ' ' 859 | set __bobthefish_ruby_glyph \uE791 ' ' 860 | 861 | set __bobthefish_vagrant_running_glyph \uF431 # ↑ 'running' 862 | set __bobthefish_vagrant_poweroff_glyph \uF433 # ↓ 'poweroff' 863 | set __bobthefish_vagrant_aborted_glyph \uF468 # ✕ 'aborted' 864 | set __bobthefish_vagrant_unknown_glyph \uF421 # strange cases 865 | end 866 | 867 | 868 | # Colors 869 | 870 | switch "$theme_color_scheme" 871 | case 'user' 872 | # Do not set any variables in this section. 873 | 874 | # If you want to create your own color scheme, set `theme_color_scheme` to 875 | # `user` and define the `__color_*` variables listed below in your fish 876 | # startup file (`$OMF_CONFIG/init.fish`, or similar). 877 | 878 | # The value for each variable is an argument to pass to `set_color -b`. 879 | # You can copy the commented code below as a base for your custom colors. 880 | # Use `__bobthefish_display_colors` at the command line to easily see what 881 | # these variables are used for. 882 | 883 | # See the built-in color schemes below for more examples. 884 | 885 | # # Example bobthefish color scheme: 886 | # set -g theme_color_scheme user 887 | # 888 | # set -g __color_initial_segment_exit ffffff ce000f --bold 889 | # set -g __color_initial_segment_su ffffff 189303 --bold 890 | # set -g __color_initial_segment_jobs ffffff 255e87 --bold 891 | # 892 | # set -g __color_path 333333 999999 893 | # set -g __color_path_basename 333333 ffffff --bold 894 | # set -g __color_path_nowrite 660000 cc9999 895 | # set -g __color_path_nowrite_basename 660000 cc9999 --bold 896 | # 897 | # set -g __color_repo addc10 0c4801 898 | # set -g __color_repo_work_tree 333333 ffffff --bold 899 | # set -g __color_repo_dirty ce000f ffffff 900 | # set -g __color_repo_staged f6b117 3a2a03 901 | # 902 | # set -g __color_vi_mode_default 999999 333333 --bold 903 | # set -g __color_vi_mode_insert 189303 333333 --bold 904 | # set -g __color_vi_mode_visual f6b117 3a2a03 --bold 905 | # 906 | # set -g __color_vagrant 48b4fb ffffff --bold 907 | # set -g __color_username cccccc 255e87 908 | # set -g __color_rvm af0000 cccccc --bold 909 | # set -g __color_virtualfish 005faf cccccc --bold 910 | 911 | case 'terminal' 'terminal-dark*' 912 | set -l colorfg black 913 | [ $theme_color_scheme = 'terminal-dark-white' ]; and set colorfg white 914 | set __color_initial_segment_exit white red --bold 915 | set __color_initial_segment_su white green --bold 916 | set __color_initial_segment_jobs white blue --bold 917 | 918 | set __color_path black white 919 | set __color_path_basename black white --bold 920 | set __color_path_nowrite magenta $colorfg 921 | set __color_path_nowrite_basename magenta $colorfg --bold 922 | 923 | set __color_repo green $colorfg 924 | set __color_repo_work_tree black $colorfg --bold 925 | set __color_repo_dirty brred $colorfg 926 | set __color_repo_staged yellow $colorfg 927 | 928 | set __color_vi_mode_default brblue $colorfg --bold 929 | set __color_vi_mode_insert brgreen $colorfg --bold 930 | set __color_vi_mode_visual bryellow $colorfg --bold 931 | 932 | set __color_vagrant brcyan $colorfg 933 | set __color_username white black 934 | set __color_rvm brmagenta $colorfg --bold 935 | set __color_virtualfish brblue $colorfg --bold 936 | 937 | case 'terminal-light*' 938 | set -l colorfg white 939 | [ $theme_color_scheme = 'terminal-light-black' ]; and set colorfg black 940 | set __color_initial_segment_exit black red --bold 941 | set __color_initial_segment_su black green --bold 942 | set __color_initial_segment_jobs black blue --bold 943 | 944 | set __color_path white black 945 | set __color_path_basename white black --bold 946 | set __color_path_nowrite magenta $colorfg 947 | set __color_path_nowrite_basename magenta $colorfg --bold 948 | 949 | set __color_repo green $colorfg 950 | set __color_repo_work_tree white $colorfg --bold 951 | set __color_repo_dirty brred $colorfg 952 | set __color_repo_staged yellow $colorfg 953 | 954 | set __color_vi_mode_default brblue $colorfg --bold 955 | set __color_vi_mode_insert brgreen $colorfg --bold 956 | set __color_vi_mode_visual bryellow $colorfg --bold 957 | 958 | set __color_vagrant brcyan $colorfg 959 | set __color_username black white 960 | set __color_rvm brmagenta $colorfg --bold 961 | set __color_virtualfish brblue $colorfg --bold 962 | 963 | case 'terminal2' 'terminal2-dark*' 964 | set -l colorfg black 965 | [ $theme_color_scheme = 'terminal2-dark-white' ]; and set colorfg white 966 | set __color_initial_segment_exit grey red --bold 967 | set __color_initial_segment_su grey green --bold 968 | set __color_initial_segment_jobs grey blue --bold 969 | 970 | set __color_path brgrey white 971 | set __color_path_basename brgrey white --bold 972 | set __color_path_nowrite magenta $colorfg 973 | set __color_path_nowrite_basename magenta $colorfg --bold 974 | 975 | set __color_repo green $colorfg 976 | set __color_repo_work_tree brgrey $colorfg --bold 977 | set __color_repo_dirty brred $colorfg 978 | set __color_repo_staged yellow $colorfg 979 | 980 | set __color_vi_mode_default brblue $colorfg --bold 981 | set __color_vi_mode_insert brgreen $colorfg --bold 982 | set __color_vi_mode_visual bryellow $colorfg --bold 983 | 984 | set __color_vagrant brcyan $colorfg 985 | set __color_username brgrey white 986 | set __color_rvm brmagenta $colorfg --bold 987 | set __color_virtualfish brblue $colorfg --bold 988 | 989 | case 'terminal2-light*' 990 | set -l colorfg white 991 | [ $theme_color_scheme = 'terminal2-light-black' ]; and set colorfg black 992 | set __color_initial_segment_exit brgrey red --bold 993 | set __color_initial_segment_su brgrey green --bold 994 | set __color_initial_segment_jobs brgrey blue --bold 995 | 996 | set __color_path grey black 997 | set __color_path_basename grey black --bold 998 | set __color_path_nowrite magenta $colorfg 999 | set __color_path_nowrite_basename magenta $colorfg --bold 1000 | 1001 | set __color_repo green $colorfg 1002 | set __color_repo_work_tree grey $colorfg --bold 1003 | set __color_repo_dirty brred $colorfg 1004 | set __color_repo_staged yellow $colorfg 1005 | 1006 | set __color_vi_mode_default brblue $colorfg --bold 1007 | set __color_vi_mode_insert brgreen $colorfg --bold 1008 | set __color_vi_mode_visual bryellow $colorfg --bold 1009 | 1010 | set __color_vagrant brcyan $colorfg 1011 | set __color_username grey black 1012 | set __color_rvm brmagenta $colorfg --bold 1013 | set __color_virtualfish brblue $colorfg --bold 1014 | 1015 | case 'zenburn' 1016 | set -l grey 333333 # a bit darker than normal zenburn grey 1017 | set -l red CC9393 1018 | set -l green 7F9F7F 1019 | set -l yellow E3CEAB 1020 | set -l orange DFAF8F 1021 | set -l blue 8CD0D3 1022 | set -l white DCDCCC 1023 | 1024 | set __color_initial_segment_exit $white $red --bold 1025 | set __color_initial_segment_su $white $green --bold 1026 | set __color_initial_segment_jobs $white $blue --bold 1027 | 1028 | set __color_path $grey $white 1029 | set __color_path_basename $grey $white --bold 1030 | set __color_path_nowrite $grey $red 1031 | set __color_path_nowrite_basename $grey $red --bold 1032 | 1033 | set __color_repo $green $grey 1034 | set __color_repo_work_tree $grey $grey --bold 1035 | set __color_repo_dirty $red $grey 1036 | set __color_repo_staged $yellow $grey 1037 | 1038 | set __color_vi_mode_default $grey $yellow --bold 1039 | set __color_vi_mode_insert $green $white --bold 1040 | set __color_vi_mode_visual $yellow $grey --bold 1041 | 1042 | set __color_vagrant $blue $green --bold 1043 | set __color_username $grey $blue 1044 | set __color_rvm $red $grey --bold 1045 | set __color_virtualfish $blue $grey --bold 1046 | 1047 | case 'base16-light' 1048 | set -l base00 181818 1049 | set -l base01 282828 1050 | set -l base02 383838 1051 | set -l base03 585858 1052 | set -l base04 b8b8b8 1053 | set -l base05 d8d8d8 1054 | set -l base06 e8e8e8 1055 | set -l base07 f8f8f8 1056 | set -l base08 ab4642 # red 1057 | set -l base09 dc9656 # orange 1058 | set -l base0A f7ca88 # yellow 1059 | set -l base0B a1b56c # green 1060 | set -l base0C 86c1b9 # cyan 1061 | set -l base0D 7cafc2 # blue 1062 | set -l base0E ba8baf # violet 1063 | set -l base0F a16946 # brown 1064 | 1065 | set -l colorfg $base00 1066 | 1067 | set __color_initial_segment_exit $base02 $base08 --bold 1068 | set __color_initial_segment_su $base02 $base0B --bold 1069 | set __color_initial_segment_jobs $base02 $base0D --bold 1070 | 1071 | set __color_path $base06 $base02 1072 | set __color_path_basename $base06 $base01 --bold 1073 | set __color_path_nowrite $base06 $base08 1074 | set __color_path_nowrite_basename $base06 $base08 --bold 1075 | 1076 | set __color_repo $base0B $colorfg 1077 | set __color_repo_work_tree $base06 $colorfg --bold 1078 | set __color_repo_dirty $base08 $colorfg 1079 | set __color_repo_staged $base09 $colorfg 1080 | 1081 | set __color_vi_mode_default $base04 $colorfg --bold 1082 | set __color_vi_mode_insert $base0B $colorfg --bold 1083 | set __color_vi_mode_visual $base09 $colorfg --bold 1084 | 1085 | set __color_vagrant $base0C $colorfg --bold 1086 | set __color_username $base02 $base0D 1087 | set __color_rvm $base08 $colorfg --bold 1088 | set __color_virtualfish $base0D $colorfg --bold 1089 | 1090 | case 'base16' 'base16-dark' 1091 | set -l base00 181818 1092 | set -l base01 282828 1093 | set -l base02 383838 1094 | set -l base03 585858 1095 | set -l base04 b8b8b8 1096 | set -l base05 d8d8d8 1097 | set -l base06 e8e8e8 1098 | set -l base07 f8f8f8 1099 | set -l base08 ab4642 # red 1100 | set -l base09 dc9656 # orange 1101 | set -l base0A f7ca88 # yellow 1102 | set -l base0B a1b56c # green 1103 | set -l base0C 86c1b9 # cyan 1104 | set -l base0D 7cafc2 # blue 1105 | set -l base0E ba8baf # violet 1106 | set -l base0F a16946 # brown 1107 | 1108 | set -l colorfg $base07 1109 | 1110 | set __color_initial_segment_exit $base05 $base08 --bold 1111 | set __color_initial_segment_su $base05 $base0B --bold 1112 | set __color_initial_segment_jobs $base05 $base0D --bold 1113 | 1114 | set __color_path $base02 $base05 1115 | set __color_path_basename $base02 $base06 --bold 1116 | set __color_path_nowrite $base02 $base08 1117 | set __color_path_nowrite_basename $base02 $base08 --bold 1118 | 1119 | set __color_repo $base0B $colorfg 1120 | set __color_repo_work_tree $base02 $colorfg --bold 1121 | set __color_repo_dirty $base08 $colorfg 1122 | set __color_repo_staged $base09 $colorfg 1123 | 1124 | set __color_vi_mode_default $base03 $colorfg --bold 1125 | set __color_vi_mode_insert $base0B $colorfg --bold 1126 | set __color_vi_mode_visual $base09 $colorfg --bold 1127 | 1128 | set __color_vagrant $base0C $colorfg --bold 1129 | set __color_username $base02 $base0D 1130 | set __color_rvm $base08 $colorfg --bold 1131 | set __color_virtualfish $base0D $colorfg --bold 1132 | 1133 | case 'solarized-light' 1134 | set -l base03 002b36 1135 | set -l base02 073642 1136 | set -l base01 586e75 1137 | set -l base00 657b83 1138 | set -l base0 839496 1139 | set -l base1 93a1a1 1140 | set -l base2 eee8d5 1141 | set -l base3 fdf6e3 1142 | set -l yellow b58900 1143 | set -l orange cb4b16 1144 | set -l red dc322f 1145 | set -l magenta d33682 1146 | set -l violet 6c71c4 1147 | set -l blue 268bd2 1148 | set -l cyan 2aa198 1149 | set -l green 859900 1150 | 1151 | set colorfg $base03 1152 | 1153 | set __color_initial_segment_exit $base02 $red --bold 1154 | set __color_initial_segment_su $base02 $green --bold 1155 | set __color_initial_segment_jobs $base02 $blue --bold 1156 | 1157 | set __color_path $base2 $base00 1158 | set __color_path_basename $base2 $base01 --bold 1159 | set __color_path_nowrite $base2 $orange 1160 | set __color_path_nowrite_basename $base2 $orange --bold 1161 | 1162 | set __color_repo $green $colorfg 1163 | set __color_repo_work_tree $base2 $colorfg --bold 1164 | set __color_repo_dirty $red $colorfg 1165 | set __color_repo_staged $yellow $colorfg 1166 | 1167 | set __color_vi_mode_default $blue $colorfg --bold 1168 | set __color_vi_mode_insert $green $colorfg --bold 1169 | set __color_vi_mode_visual $yellow $colorfg --bold 1170 | 1171 | set __color_vagrant $violet $colorfg --bold 1172 | set __color_username $base2 $blue 1173 | set __color_rvm $red $colorfg --bold 1174 | set __color_virtualfish $cyan $colorfg --bold 1175 | 1176 | case 'solarized' 'solarized-dark' 1177 | set -l base03 002b36 1178 | set -l base02 073642 1179 | set -l base01 586e75 1180 | set -l base00 657b83 1181 | set -l base0 839496 1182 | set -l base1 93a1a1 1183 | set -l base2 eee8d5 1184 | set -l base3 fdf6e3 1185 | set -l yellow b58900 1186 | set -l orange cb4b16 1187 | set -l red dc322f 1188 | set -l magenta d33682 1189 | set -l violet 6c71c4 1190 | set -l blue 268bd2 1191 | set -l cyan 2aa198 1192 | set -l green 859900 1193 | 1194 | set colorfg $base3 1195 | 1196 | set __color_initial_segment_exit $base2 $red --bold 1197 | set __color_initial_segment_su $base2 $green --bold 1198 | set __color_initial_segment_jobs $base2 $blue --bold 1199 | 1200 | set __color_path $base02 $base0 1201 | set __color_path_basename $base02 $base1 --bold 1202 | set __color_path_nowrite $base02 $orange 1203 | set __color_path_nowrite_basename $base02 $orange --bold 1204 | 1205 | set __color_repo $green $colorfg 1206 | set __color_repo_work_tree $base02 $colorfg --bold 1207 | set __color_repo_dirty $red $colorfg 1208 | set __color_repo_staged $yellow $colorfg 1209 | 1210 | set __color_vi_mode_default $blue $colorfg --bold 1211 | set __color_vi_mode_insert $green $colorfg --bold 1212 | set __color_vi_mode_visual $yellow $colorfg --bold 1213 | 1214 | set __color_vagrant $violet $colorfg --bold 1215 | set __color_username $base02 $blue 1216 | set __color_rvm $red $colorfg --bold 1217 | set __color_virtualfish $cyan $colorfg --bold 1218 | 1219 | case 'light' 1220 | # light medium dark 1221 | # ------ ------ ------ 1222 | set -l red cc9999 ce000f 660000 1223 | set -l green addc10 189303 0c4801 1224 | set -l blue 48b4fb 005faf 255e87 1225 | set -l orange f6b117 unused 3a2a03 1226 | set -l brown bf5e00 803f00 4d2600 1227 | set -l grey cccccc 999999 333333 1228 | set -l white ffffff 1229 | set -l black 000000 1230 | set -l ruby_red af0000 1231 | 1232 | set __color_initial_segment_exit $grey[3] $red[2] --bold 1233 | set __color_initial_segment_su $grey[3] $green[2] --bold 1234 | set __color_initial_segment_jobs $grey[3] $blue[3] --bold 1235 | 1236 | set __color_path $grey[1] $grey[2] 1237 | set __color_path_basename $grey[1] $grey[3] --bold 1238 | set __color_path_nowrite $red[1] $red[3] 1239 | set __color_path_nowrite_basename $red[1] $red[3] --bold 1240 | 1241 | set __color_repo $green[1] $green[3] 1242 | set __color_repo_work_tree $grey[1] $white --bold 1243 | set __color_repo_dirty $red[2] $white 1244 | set __color_repo_staged $orange[1] $orange[3] 1245 | 1246 | set __color_vi_mode_default $grey[2] $grey[3] --bold 1247 | set __color_vi_mode_insert $green[2] $grey[3] --bold 1248 | set __color_vi_mode_visual $orange[1] $orange[3] --bold 1249 | 1250 | set __color_vagrant $blue[1] $white --bold 1251 | set __color_username $grey[1] $blue[3] 1252 | set __color_rvm $ruby_red $grey[1] --bold 1253 | set __color_virtualfish $blue[2] $grey[1] --bold 1254 | 1255 | case 'gruvbox' 1256 | # light medium dark darkest 1257 | # ------ ------ ------ ------- 1258 | set -l red fb4934 cc241d 1259 | set -l green b8bb26 98971a 1260 | set -l yellow fabd2f d79921 1261 | set -l aqua 8ec07c 689d6a 1262 | set -l blue 83a598 458588 1263 | set -l grey cccccc 999999 333333 1264 | set -l fg fbf1c7 ebdbb2 d5c4a1 a89984 1265 | set -l bg 504945 282828 1266 | 1267 | set -g __color_initial_segment_exit $fg[1] $red[2] --bold 1268 | set -g __color_initial_segment_su $fg[1] $green[2] --bold 1269 | set -g __color_initial_segment_jobs $fg[1] $aqua[2] --bold 1270 | 1271 | set -g __color_path $bg[1] $fg[2] 1272 | set -g __color_path_basename $bg[1] $fg[2] --bold 1273 | set -g __color_path_nowrite $red[1] $fg[2] 1274 | set -g __color_path_nowrite_basename $red[1] $fg[2] --bold 1275 | 1276 | set -g __color_repo $green[2] $bg[1] 1277 | set -g __color_repo_work_tree $bg[1] $fg[2] --bold 1278 | set -g __color_repo_dirty $red[2] $fg[2] 1279 | set -g __color_repo_staged $yellow[1] $bg[1] 1280 | 1281 | set -g __color_vi_mode_default $fg[4] $bg[2] --bold 1282 | set -g __color_vi_mode_insert $blue[1] $bg[2] --bold 1283 | set -g __color_vi_mode_visual $yellow[1] $bg[2] --bold 1284 | 1285 | set -g __color_vagrant $blue[2] $fg[2] --bold 1286 | set -g __color_username $fg[3] $blue[2] 1287 | set -g __color_rvm $red[2] $fg[2] --bold 1288 | set -g __color_virtualfish $blue[2] $fg[2] --bold 1289 | 1290 | case '*' # default dark theme 1291 | # light medium dark 1292 | # ------ ------ ------ 1293 | set -l red cc9999 ce000f 660000 1294 | set -l green addc10 189303 0c4801 1295 | set -l blue 48b4fb 005faf 255e87 1296 | set -l orange f6b117 unused 3a2a03 1297 | set -l brown bf5e00 803f00 4d2600 1298 | set -l grey cccccc 999999 333333 1299 | set -l white ffffff 1300 | set -l black 000000 1301 | set -l ruby_red af0000 1302 | 1303 | set __color_initial_segment_exit $white $red[2] --bold 1304 | set __color_initial_segment_su $white $green[2] --bold 1305 | set __color_initial_segment_jobs $white $blue[3] --bold 1306 | 1307 | set __color_path $grey[3] $grey[2] 1308 | set __color_path_basename $grey[3] $white --bold 1309 | set __color_path_nowrite $red[3] $red[1] 1310 | set __color_path_nowrite_basename $red[3] $red[1] --bold 1311 | 1312 | set __color_repo $green[1] $green[3] 1313 | set __color_repo_work_tree $grey[3] $white --bold 1314 | set __color_repo_dirty $red[2] $white 1315 | set __color_repo_staged $orange[1] $orange[3] 1316 | 1317 | set __color_vi_mode_default $grey[2] $grey[3] --bold 1318 | set __color_vi_mode_insert $green[2] $grey[3] --bold 1319 | set __color_vi_mode_visual $orange[1] $orange[3] --bold 1320 | 1321 | set __color_vagrant $blue[1] $white --bold 1322 | set __color_username $grey[1] $blue[3] 1323 | set __color_rvm $ruby_red $grey[1] --bold 1324 | set __color_virtualfish $blue[2] $grey[1] --bold 1325 | end 1326 | 1327 | # Start each line with a blank slate 1328 | set -l __bobthefish_current_bg 1329 | 1330 | __bobthefish_maybe_display_colors 1331 | 1332 | __bobthefish_prompt_status $last_status 1333 | __bobthefish_prompt_vi 1334 | __bobthefish_prompt_vagrant 1335 | __bobthefish_prompt_docker 1336 | __bobthefish_prompt_user 1337 | __bobthefish_prompt_rubies 1338 | __bobthefish_prompt_virtualfish 1339 | 1340 | set -l git_root (__bobthefish_git_project_dir) 1341 | set -l hg_root (__bobthefish_hg_project_dir) 1342 | 1343 | if [ "$git_root" -a "$hg_root" ] 1344 | # only show the closest parent 1345 | switch $git_root 1346 | case $hg_root\* 1347 | __bobthefish_prompt_git $git_root 1348 | case \* 1349 | __bobthefish_prompt_hg $hg_root 1350 | end 1351 | else if [ "$git_root" ] 1352 | __bobthefish_prompt_git $git_root 1353 | else if [ "$hg_root" ] 1354 | __bobthefish_prompt_hg $hg_root 1355 | else 1356 | __bobthefish_prompt_dir 1357 | end 1358 | 1359 | __bobthefish_finish_segments 1360 | end 1361 | --------------------------------------------------------------------------------