dot

packages and services management
Log | Files | Refs | README

commit 7d23ee6c75257e7b032aa69d4c60d920665508ee
parent 59f6684441c8ee0f2a8ccba42a2369bd2cf2af8b
Author: josuah <mail@josuah.net>
Date:   Wed,  5 Oct 2016 22:55:21 -0400

Added theme picker

Diffstat:
Mshell/.profile | 118+++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
Mtmux/.config/tmux/status | 2+-
Mtmux/.tmux.conf | 15++++++++-------
3 files changed, 80 insertions(+), 55 deletions(-)

diff --git a/shell/.profile b/shell/.profile @@ -5,57 +5,28 @@ # / /_/ // / / /_/ // ___/ / // // ____/ #/ ____/ \/ \____/ \/ \/ \/ \___\ 2016-10-05 #\/============================================================================= -# Variables & shell config +# Shell configuration, for any shell (dash, zsh, mksh, bash, busybox's ash...) +# Prevent from running twice + +[ "$PROFILE_RUN" ] && return 0 +export PROFILE_RUN=1 # VARIABLES #------------------------------------------------------------------------------- - -# Black Red Green Yellow -# Blue Magenta Cyan White - -solarized_light="\ -\033]P0ffddbb \033]P1d0154b \033]P2779900 \033]P3ffa700\ -\033]P4096daf \033]P5dd6699 \033]P600aa88 \033]P7000000\ -\033]P8bb9988 \033]P9d0154b \033]PA779900 \033]PBffa700\ -\033]PC096daf \033]PD897f74 \033]PE00aa88 \033]PF222222" - -ghost_in_the_shell="\ -\033]P0000000 \033]P191265C \033]P2439a64 \033]P3ccdd66\ -\033]P455aaaa \033]P5516583 \033]P64a8f86 \033]P799bbbb\ -\033]P8334444 \033]P9E71E5B \033]PA72f4a0 \033]PBf5ff8B\ -\033]PC99bbff \033]PD676cb0 \033]PE00ffff \033]PFffffff" - -coal="\ -\033]P0000000 \033]P1ee3333 \033]P288ff44 \033]P3ffcc55\ -\033]P477aaaa \033]P5888888 \033]P655ee99 \033]P7cccccc\ -\033]P8555555 \033]P9ff6666 \033]PAaaff66 \033]PBffff99\ -\033]PCaaddff \033]PDaaaaaa \033]PE99ffbb \033]PFffffff" - # Parse and merge ~/.pam_environment + [ -z "$CONFIG" ] && eval << EOF $(sed -r '/^ *#/ d; /^ *$/ d; s/@/$/g; s/ *([^ ]*) *[^ ]*=/\1=/' \ ~/.pam_environment) EOF export PATH="$CONFIG/bin:$LOCAL/bin:$PATH" - -export PS1="$( - code="$?" - - # Error code - [ "$code" -eq 0 ] || printf '\033[62C\033[31;1m %s \033[0m\r' "$code" - printf '\n \033[1;31m>\033[33m>\033[34m>\033[0m ' - - # Update tmux status at each prompt - tmux set status off - tmux set status on -)" +export PS1='$(ps1)' export PS2='| ' - -# ALIAS +# ALIAS 2016-10-05 #------------------------------------------------------------------------------- alias l='ls -F -w 80 --color' @@ -75,9 +46,21 @@ alias lines='find . -name "*.[ch]" | xargs wc -l' alias myip='curl icanhazip.com' -# FUNCTIONS +# FUNCTIONS 2016-10-05 #------------------------------------------------------------------------------- +ps1() +{ + code="$?" + + # Error code + [ "$code" -eq 0 ] || printf '\033[31;1m %40s ' "$code" + printf '\n \033[1;31m>\033[33m>\033[34m>\033[0m ' + + # Update tmux status line at each new prompt + tmux refresh-client -S +} + h() { for field in $@; do local cmd="$cmd $field"; done @@ -228,15 +211,56 @@ rotate() } -# STARTUP +# TTY THEMES 2016-10-05 #------------------------------------------------------------------------------- -# TTY setup -if [ "$TERM" = 'linux' ] -then - printf "$coal" # Theme - printf '\033[?6;c' # Cursor style -fi +# Black Red Green Yellow +# Blue Magenta Cyan White + +while read name theme +do + THEMES="$( printf '%s\t%s\n%s' "$name" "$theme" "$THEMES")" + THEMES_NAMES="$(printf '%s\n%s' "$name" "$THEMES_NAMES")" +done << EOF +solarized_light \ +P0ffddbb P1d0154b P2779900 P3ffa700 P4096daf P5dd6699 P600aa88 P7000000\ +P8bb9988 P9d0154b PA779900 PBffa700 PC096daf PD897f74 PE00aa88 PF222222\ + +ghost_in_the_shell \ +P0000000 P191265C P2439a64 P3ccdd66 P455aaaa P5516583 P64a8f86 P799bbbb\ +P8334444 P9E71E5B PA72f4a0 PBf5ff8B PC99bbff PD676cb0 PE00ffff PFffffff\ + +coal \ +P0000000 P1ee3333 P288ff44 P3ffcc55 P477aaaa P5888888 P655ee99 P7cccccc\ +P8555555 P9ff6666 PAaaff66 PBffff99 PCaaddff PDaaaaaa PE99ffbb PFffffff\ + +drakula \ +P0282a36 P1cc4343 P242c763 P3ffb86c P46272a4 P5bd93f9 P66fb9c9 P7e6e6d5\ +P844475a P9ff5555 PA50fa7b PBf1fa8c PC8196d6 PDff79c6 PE8be9fd PFffffff\ + +gotham \ +P00a0f14 P1c33027 P226a98b P3edb54c P4195465 P54e5165 P633859d P798d1ce\ +P810151b P9d26939 PA30dbb3 PBffd280 PC268099 PD888ba5 PE599caa PFd3ebe9\ + +monokai \ +P048483e P1dc2566 P28fc029 P3d4c96e P455bcce P59358fe P656b7a5 P7acada1\ +P876715e P9fa2772 PAa7e22e PBe7db75 PC66d9ee PDae82ff PE66efd5 PFcfd0c2\ -# Start tmux right away -command -v tmux &> /dev/null && [ -z "$TMUX" ] && tmux attach || : +EOF + +theme() +{ + local name="${1-$(printf '%s\n' "$THEMES_NAMES" | fzf --margin=10,20)}" + printf "$(printf %s "$THEMES" | sed -n "/$name/"'s/P/\\033]P/g p')" + clear +} + +[ "$TERM" = 'linux' ] && theme coal + +# STARTUP 2016-10-05 +#------------------------------------------------------------------------------- + +# Attach to tmux right away +command -v tmux &> /dev/null && if [ -z "$TMUX" ] +then tmux attach &> /dev/null || tmux new +fi diff --git a/tmux/.config/tmux/status b/tmux/.config/tmux/status @@ -14,7 +14,7 @@ help='USAGE: ~/.tmux/status segmentname1 segmentname2 ...' PWD="$(tmux display -p '#{pane_current_path}')" -BACKGROUND=black,blink +BACKGROUND=black SEPARATOR="${SEPARATOR- }" diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf @@ -1,9 +1,10 @@ -# /\ -# / /_ ________ __ /\ __ __ -# / ___\/ __ __ \ / / / / \ \' / -# / / / / / / / // /_/ / ,' ,' -# \/ \/ \/ \/ \____/ /_,\_\ 2016-10-05 -#=============================================================================== +# /usr/bin/env tmux -f +# /\ ____ +# / /_ ________ __ /\ __ __ ____ ____ ____ .' ___\ +# / ___\/ __ __ \ / / / / \ \' / / ___\ / __ \ / __ \ / .'_ +# / / / / / / / // /_/ / ,' ,'__ / /__ / /_/ // / / // ___/ +# \/ \/ \/ \/ \____/ /_,\_\ \/ \____\ \____/ \/ \/ \/ 2016-10-05 +#============================================================== # KEYBINDINGS 2016-10-05 @@ -94,7 +95,7 @@ set -g status-left-style fg=white set -g status-left "#[fg=black,bg=white] #S #[default] " # Right -set -g status-right-length 50 +set -g status-right-length 100 set -g status-right-style fg=white set -g status-right \ " #(~/.config/tmux/status dir git mail clock)"