Work on stuff

Jonathan Hodgson 8 years ago
parent 267d0938e1
commit 22deab147a
  1. 2
      bin/php-swap
  2. 2
      config/oh-my-zsh/functions.zsh
  3. 32
      config/oh-my-zsh/promptconfig.zsh
  4. 3
      zshrc

@ -43,6 +43,8 @@ ln -s -f $phpcgi /opt/lampp/bin/php-cgi
ln -s -f $phpconfig /opt/lampp/bin/php-config
ln -s -f $phpize /opt/lampp/bin/phpize
# Also need to change /opt/lampp/modules/libphp7.so if 7.x.
$lampp startapache
echo
echo "Now on PHP ${phpexe##*-}"

@ -77,7 +77,7 @@ function themes() {
if [ -d $themes ]; then
cdlc $themes
else
echo " Can't find plugins folder "
echo " Can't find theme folder "
fi
else
echo " Can't find public_html folder."

@ -6,8 +6,11 @@ function my_dir(){
wpPluginsIcon=".p."
wpThemesIcon=".t."
siteIcon=" "
wpSiteIcon=" "
magentoSiteIcon=" "
dropboxIcon=" "
seperator=""
seperator=" "
root=" "
# Gets the path.
local current_path="$(print -P "%~")"
@ -20,18 +23,35 @@ function my_dir(){
# Replace wp-content/plugins with plugin icon if in plugin
# current_path=$(echo $current_path | sed -r -e "s/wp\-content\/plugins/$wpPluginsIcon/")
# If in a site folder, replace home/Sites/<site-name>/public_html with siteIcon <site-name>
current_path=$(echo $current_path | sed -r -e "s/$homeIcon\/Sites\/([a-z_\-]*)\/public_html/$siteIcon\1/")
#This is used for checking if wp or magento
local ph=${PWD%/public_html*}/public_html
# If in a site folder and a wp site, replace home/Sites/<site-name>/public_html with siteIcon <site-name>
if [[ -d $ph ]]; then
local icon=$siteIcon
if [[ -e "$ph/wp-config.php" ]]; then #If WordPress
icon=$wpSiteIcon
current_path=$(echo $current_path | sed -r -e "s/$homeIcon\/Sites\/([a-z_\-]*)\/public_html/$wpSiteIcon\1/")
# Change wp-content in sub folders
current_path=$(echo $current_path | sed -r -e "s/wp\-content\//wpc\//")
elif [[ -d "$ph/pub/opt/magento" ]]; then #If magento
icon=$magentoSiteIcon
fi
current_path=$(echo $current_path | sed -r -e "s/$homeIcon\/Sites\/([a-z_\-]*)\/public_html/$icon\1/")
fi
# Replace Dropbox with icon
current_path=$(echo $current_path | sed -r -e "s/$homeIcon\/Dropbox/$dropboxIcon/")
# Change wp-content in sub folders
current_path=$(echo $current_path | sed -r -e "s/wp\-content\//wpc\//")
# Set the root
current_path=$(echo $current_path | sed -r -e "s/^\//$root/g")
# Set the seperator
current_path=$(echo $current_path | sed -r -e "s/\//$seperator/g")
echo $current_path
}

@ -84,3 +84,6 @@ source $ZSH/oh-my-zsh.sh
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
[ -r "$HOME/.smartcd_config" ] && ( [ -n $BASH_VERSION ] || [ -n $ZSH_VERSION ] ) && source ~/.smartcd_config

Loading…
Cancel
Save