From 65459dff0745bdddc45f76baa167499e8a964fc6 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Fri, 22 Aug 2014 23:15:37 -0400 Subject: [PATCH] Added new theme that tells you when you're sshed!! Also, fixed the wallpaper generator --- i3/{i3config => config} | 2 +- scripts/sync.sh | 7 +++--- shells/af-magic.zsh-theme | 45 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) rename i3/{i3config => config} (99%) create mode 100644 shells/af-magic.zsh-theme diff --git a/i3/i3config b/i3/config similarity index 99% rename from i3/i3config rename to i3/config index 0edbdaf..bbbf13f 100644 --- a/i3/i3config +++ b/i3/config @@ -192,7 +192,7 @@ bindsym $mod+Shift+0 move container to workspace 10 # reload the configuration file bindsym $mod+Shift+r reload # To initialize wallpapers, run: -# mkdir -p ~/.i3/wall ; cp ~/source ~/.i3/wall ; cd ~/.i3/wall ; rename -v 's/(.* )+//' * ; mogrify -resize `xrandr -q|perl -F'\s|,' -lane "/^Sc/&&print join '',@F[8..10]"`^ -verbose -gravity center -format png ; rm *.jpg *.jpeg +# mkdir -p ~/.i3/wall ; cp ~/source ~/.i3/wall ; cd ~/.i3/wall ; rename -v 's/(.* )+//' * ; mogrify -resize `xrandr -q|perl -F'\s|,' -lane "/^Sc/&&print join '',@F[8..10]"`^ -verbose -gravity center -format png * ; rm *.jpg ; rm *.jpeg bindsym $mod+grave exec "i3lock -i `echo $(shuf -n1 -e ~/.i3/wall/*) | tee /tmp/wall`; sleep 60; pgrep i3lock && xset dpms force off" bindsym $mod+Shift+grave exec "sudo pm-suspend | i3lock -i `echo $(shuf -n1 -e ~/.i3/wall/*) | tee /tmp/wall`" # Tees the filename to /tmp/wall for debugging diff --git a/scripts/sync.sh b/scripts/sync.sh index 9846288..7708c5b 100755 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -59,9 +59,9 @@ while getopts ":hbsdtclw" VALUE "$@"; do if [ "$VALUE" = "c" ] ; then echo "Syncing config files" if which trash >/dev/null; then - trash ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp ~/.vimperator/info/sync/quickmarks ~/.bashrc ~/.pylintrc ~/.zshrc ~/.i3/config ~/.i3/sleep.sh ~/.Xmodmap ~/.xsession + trash ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp ~/.vimperator/info/sync/quickmarks ~/.bashrc ~/.pylintrc ~/.zshrc ~/.i3/config ~/.i3/sleep.sh ~/.Xmodmap ~/.xsession ~/.oh-my-zsh/themes/af-magic.zsh-theme else - rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp ~/.vimperator/info/sync/quickmarks ~/.bashrc ~/.pylintrc ~/.zshrc ~/.i3/config ~/.i3/sleep.sh ~/.Xmodmap ~/.xsession + rm ~/.gitconfig ~/.vimrc ~/.vimperatorrc ~/.vimperator/colors/vimPgray.vimp ~/.vimperator/info/sync/quickmarks ~/.bashrc ~/.pylintrc ~/.zshrc ~/.i3/config ~/.i3/sleep.sh ~/.Xmodmap ~/.xsession ~/.oh-my-zsh/themes/af-magic.zsh-theme fi ln -s ${PWD}/../python/pylintrc ~/.pylintrc ln -s ${PWD}/../vim/vimrc ~/.vimrc @@ -73,11 +73,12 @@ while getopts ":hbsdtclw" VALUE "$@"; do ln -s ${PWD}/../git/gitconfig ~/.gitconfig ln -s ${PWD}/../shells/bashrc ~/.bashrc ln -s ${PWD}/../shells/zshrc ~/.zshrc + ln -s ${PWD}/../shells/af-magic.zsh-theme ~/.oh-my-zsh/themes/af-magic.zsh-theme if [ -d "~/.oh-my-zsh" ] ; then curl -L http://install.ohmyz.sh | sh fi mkdir -p ~/.i3 - ln -s ${PWD}/../i3/i3config ~/.i3/config + ln -s ${PWD}/../i3/config ~/.i3/config ln -s ${PWD}/../i3/sleep.sh ~/.i3/sleep.sh ln -s ${PWD}/../i3/Xmodmap ~/.Xmodmap ln -s ${PWD}/../i3/xsession ~/.xsession diff --git a/shells/af-magic.zsh-theme b/shells/af-magic.zsh-theme new file mode 100644 index 0000000..3e767bc --- /dev/null +++ b/shells/af-magic.zsh-theme @@ -0,0 +1,45 @@ +# af-magic.zsh-theme +# Repo: https://github.com/andyfleming/oh-my-zsh +# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme + +if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="green"; fi +if [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ] ; then + local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" +else + local return_code="%(?..%{$fg[green]%}%? ↵%{$reset_color%})" +fi + +# primary prompt +PROMPT='$FG[237]------------------------------------------------------------%{$reset_color%} +$FG[032]%~\ +$(git_prompt_info) \ +$FG[105]%(!.#.»)%{$reset_color%} ' +PROMPT2='%{$fg[red]%}\ %{$reset_color%}' +RPS1='${return_code}' + + +# color vars +eval my_gray='$FG[237]' +eval my_orange='$FG[214]' + +# right prompt +if type "virtualenv_prompt_info" > /dev/null +then + if [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ] ; then + RPROMPT='$(virtualenv_prompt_info)$my_gray%n@%m%{$reset_color%}%' + else + RPROMPT='$(virtualenv_prompt_info)$my_red%n@%m%{$reset_color%}%' + fi +else + if [ -z "$SSH_TTY" ] && [ -z "$SSH_CONNECTION" ] && [ -z "$SSH_CLIENT" ] ; then + RPROMPT='$my_gray%n@%m%{$reset_color%}%' + else + RPROMPT='$my_red%n@%m%{$reset_color%}%' + fi +fi + +# git settings +ZSH_THEME_GIT_PROMPT_PREFIX="$FG[075](branch:" +ZSH_THEME_GIT_PROMPT_CLEAN="" +ZSH_THEME_GIT_PROMPT_DIRTY="$my_orange*%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="$FG[075])%{$reset_color%}"