zsh changes

Jonathan Hodgson 5 years ago
parent fdb2ed3606
commit d9465307d6
  1. 2
      shells/shared/aliases
  2. 21
      shells/zsh/STOW/.zshrc
  3. 9
      shells/zsh/oh-my-zsh-custom/promptconfig.zsh

@ -14,7 +14,7 @@ alias tree='tree -F -C'
# Make qmv open on 1 column mode
alias qmv='qmv -f do'
alias msfconsole="msfconsole --quiet -x \"db_connect msf@msf\""
alias msfconsole="( systemctl status --no-pager postgresql.service > /dev/null || (echo \"Statring postgres\"; sudo systemctl start postgresql.service) ); ( pass show system/metasploit/database.yaml > database.yaml; msfconsole -y database.yaml; rm database.yaml )"
#Start cups
alias cups='sudo systemctl start org.cups.cupsd.service'

@ -53,7 +53,8 @@ ZSH_CUSTOM=$HOME/.dotfiles/shells/zsh/oh-my-zsh-custom
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git zsh-better-npm-completion zsh-autosuggestions)
plugins=(navi git zsh-better-npm-completion zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
@ -108,16 +109,14 @@ TRAPWINCH(){
#fi
#
#local current="$(project current --path)"
#if [ -n "$current" ]; then
# echo "yay"
# local script="/usr/bin/script"
# echo "'$(ps -ocommand -p $PPID | grep -v 'COMMAND' | cut -d' ' -f1)'"
# if [[ ! "$(ps -ocommand -p $PPID | grep -v 'COMMAND' | cut -d' ' -f1 )" == "$script" ]]; then
# mkdir "$current/shell-logs"
# /usr/bin/script -f "$current/shell-logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log"
# fi
#fi
local current="$(project current --path)"
if [ -n "$current" ]; then
local script="/usr/bin/script"
if [[ ! "$(ps -ocommand -p $PPID | grep -v 'COMMAND' | cut -d' ' -f1 )" == "$script" ]]; then
mkdir "$current/shell-logs"
/usr/bin/script -f "$current/shell-logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log"
fi
fi
#clear
#tldr --linux -r

@ -24,9 +24,8 @@ 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/")
local current_project_full="$(project current --path)"
local current_project_name="$(project current)"
if [ -n "$current_project_name" ]; then
current_project_full="$(project current --path)"
if [ -n "$current_project_full" ]; then
if echo "$PWD" | grep -q "$current_project_full"; then
current_path=$(echo $PWD | sed -r -e "s#$current_project_full##" | sed -r -e 's/^\///')
current_path="$current_path"
@ -102,9 +101,9 @@ POWERLEVEL9K_CUSTOM_CAPS_FOREGROUND="white"
function prompt_project() {
local segment_content state icon
local current_project_name="$(project current)"
local current_project_full="$(project current --path)"
local parent_process="$(ps -ocommand -p $PPID | grep -v 'COMMAND' | cut -d' ' -f1)"
local current_project_full="$(project current --path)"
local current_project_name="$(project current)"
# If there is a current project
if [ -n "$current_project_name" ]; then
segment_content="$current_project_name"

Loading…
Cancel
Save