From 56a3b9959a6d4d780bccab709592b1f8605cf7f3 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Wed, 31 Jan 2018 17:33:23 +0000 Subject: [PATCH] Update stuff for st --- config/i3/configWork | 3 ++- config/oh-my-zsh/aliases.zsh | 2 +- config/oh-my-zsh/functions.zsh | 42 ++++++++++++++++++++++++++----- config/oh-my-zsh/promptconfig.zsh | 6 ++++- config/vim | 2 +- zprofile | 2 +- 6 files changed, 46 insertions(+), 11 deletions(-) diff --git a/config/i3/configWork b/config/i3/configWork index 6707d0f8..b76f41f8 100644 --- a/config/i3/configWork +++ b/config/i3/configWork @@ -43,7 +43,8 @@ floating_modifier $mod # start a terminal # bindsym $mod+Return exec xfce4-terminal # bindsym $mod+Return exec konsole -bindsym $mod+Return exec termite +# bindsym $mod+Return exec termite +bindsym $mod+Return exec /usr/local/bin/st # kill focused window bindsym $mod+q kill diff --git a/config/oh-my-zsh/aliases.zsh b/config/oh-my-zsh/aliases.zsh index b51fdcaf..1b5cb9b0 100644 --- a/config/oh-my-zsh/aliases.zsh +++ b/config/oh-my-zsh/aliases.zsh @@ -33,7 +33,7 @@ alias mkdir='mkdir -p' alias perms='wp rewrite flush' #Clear terminal and screenfetch -alias cls='clear; screenfetch' +alias cls='clear; neofetch' #An alias for my standard less configuration #I don't set it to lessc because sometimes I don't use this config and I always forget how to ignore an alias diff --git a/config/oh-my-zsh/functions.zsh b/config/oh-my-zsh/functions.zsh index 15db9eb7..209b0137 100644 --- a/config/oh-my-zsh/functions.zsh +++ b/config/oh-my-zsh/functions.zsh @@ -47,7 +47,12 @@ function createLetter(){ function ptheme() { public_html=${PWD%/public_html*}/public_html if [ -d $public_html ]; then - theme=$(dirname $(wp --path="$public_html" theme path $(wp --path="$public_html" theme list | grep "parent" | awk '{print $1}'))) + if [ -d $public_html/wp ]; then + wpPath=$public_html/wp; + else + wpPath=$public_html; + fi + theme=$(dirname $(wp --path="$wpPath" theme path $(wp --path="$wpPath" theme list | grep "parent" | awk '{print $1}'))) if [ -d $theme ]; then if [ -d "$theme" ]; then cd $theme @@ -66,7 +71,12 @@ function ptheme() { function theme() { public_html=${PWD%/public_html*}/public_html if [ -d $public_html ]; then - theme=$(dirname $(wp --path="$public_html" theme path $(wp --path="$public_html" theme list | grep "active" | grep -v "inactive" | awk '{print $1}'))) + if [ -d $public_html/wp ]; then + wpPath=$public_html/wp; + else + wpPath=$public_html; + fi + theme=$(dirname $(wp --path="$wpPath" theme path $(wp --path="$wpPath" theme list | grep "active" | grep -v "inactive" | awk '{print $1}'))) if [ -d $theme ]; then cd $theme else @@ -81,7 +91,12 @@ function theme() { function js() { public_html=${PWD%/public_html*}/public_html if [ -d $public_html ]; then - theme=$(dirname $(wp --path="$public_html" theme path $(wp --path="$public_html" theme list | grep "active" | grep -v "inactive" | awk '{print $1}'))) + if [ -d $public_html/wp ]; then + wpPath=$public_html/wp; + else + wpPath=$public_html; + fi + theme=$(dirname $(wp --path="$wpPath" theme path $(wp --path="$wpPath" theme list | grep "active" | grep -v "inactive" | awk '{print $1}'))) if [ -d $theme ]; then if [ -d "$theme/js" ]; then cd "$theme/js" @@ -101,7 +116,12 @@ function js() { function css() { public_html=${PWD%/public_html*}/public_html if [ -d $public_html ]; then - theme=$(dirname $(wp --path="$public_html" theme path $(wp --path="$public_html" theme list | grep "active" | grep -v "inactive" | awk '{print $1}'))) + if [ -d $public_html/wp ]; then + wpPath=$public_html/wp; + else + wpPath=$public_html; + fi + theme=$(dirname $(wp --path="$wpPath" theme path $(wp --path="$wpPath" theme list | grep "active" | grep -v "inactive" | awk '{print $1}'))) if [ -d $theme ]; then if [ -d "$theme/css" ]; then cd "$theme/css" @@ -121,7 +141,12 @@ function css() { function plugins() { public_html=${PWD%/public_html*}/public_html if [ -d $public_html ]; then - cd $(wp --path="$public_html" plugin path) + if [ -d $public_html/wp ]; then + wpPath=$public_html/wp; + else + wpPath=$public_html; + fi + cd $(wp --path="$wpPath" plugin path) else echo " Can't find public_html folder." fi @@ -131,7 +156,12 @@ function plugins() { function themes() { public_html=${PWD%/public_html*}/public_html if [ -d $public_html ]; then - cd $(wp --path="$public_html" theme path) + if [ -d $public_html/wp ]; then + wpPath=$public_html/wp; + else + wpPath=$public_html; + fi + cd $(wp --path="$wpPath" theme path) else echo " Can't find public_html folder." fi diff --git a/config/oh-my-zsh/promptconfig.zsh b/config/oh-my-zsh/promptconfig.zsh index de4e7b68..d823260c 100644 --- a/config/oh-my-zsh/promptconfig.zsh +++ b/config/oh-my-zsh/promptconfig.zsh @@ -10,6 +10,7 @@ function my_dir(){ magentoSiteIcon=" " dropboxIcon="" seperator="  " + seperatorDual="  " root="$seperator" # Gets the path. local current_path="$(print -P "%~")" @@ -35,7 +36,7 @@ function my_dir(){ current_path=$(echo $current_path | sed -r -e "s/wp\-content\//wpc\//") if [[ $(tput cols) -lt 100 ]]; then - current_path=$(echo $current_path | sed -r -e "s/wpc\/themes\///") + current_path=$(echo $current_path | sed -r -e "s/wpc\/themes\//\//") fi elif [[ -e "$ph/bin/magento" ]]; then #If magento @@ -53,6 +54,9 @@ function my_dir(){ # Set the root current_path=$(echo $current_path | sed -r -e "s/^\//$root/g") + # Set the dual seperator + current_path=$(echo $current_path | sed -r -e "s/\/\//$seperatorDual/g") + # Set the seperator current_path=$(echo $current_path | sed -r -e "s/\//$seperator/g") diff --git a/config/vim b/config/vim index 3856ba8c..3a15cd29 160000 --- a/config/vim +++ b/config/vim @@ -1 +1 @@ -Subproject commit 3856ba8c89731e3a59ef5fccd8f91909cf7157c2 +Subproject commit 3a15cd29a13ef48013ba78904cad5286eb66ed26 diff --git a/zprofile b/zprofile index f5d52cc6..8ece2d57 100644 --- a/zprofile +++ b/zprofile @@ -1,5 +1,5 @@ export LANG="en_GB.UTF-8" -export TERMINAL=/usr/bin/termite +export TERMINAL=/usr/local/bin/st export TERM=xterm-256color export PATH=~/.bin:$PATH:/opt/lampp/bin:. export EDITOR='vim'