Merge branch 'main' of github.com:jim-fx/.dotfiles

This commit is contained in:
2021-07-04 15:54:49 +02:00
15 changed files with 124 additions and 95 deletions

View File

@@ -78,9 +78,10 @@ source $HOME/.dotfiles/configs/zsh/update-repo.zsh
# The next line enables shell command completion for gcloud.
#if [ -f '/home/coder/downloads/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/coder/downloads/google-cloud-sdk/completion.zsh.inc'; fi
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
if [ -s "$HOME/.asdf" ]; then
. $HOME/.asdf/asdf.sh
. $HOME/.asdf/completions/asdf.bash
fi
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

View File

@@ -9,7 +9,7 @@ alias yoink="curl"
alias pls='sudo -E env "PATH=$PATH"'
alias zshc="cd ~/.dotfiles && vim configs/.zshrc"
alias zshc="cd ~/.dotfiles && vim configs/.zshrc && cd -"
alias zshu="source ~/.zshrc"
alias nano="nvim"

View File

@@ -2,28 +2,33 @@
function fp(){
PORT=$1;
for p in "$@"
do
if [ "$(which lsof)" = "lsof not found" ]; then
echo "lsof not installed"
else
PIDS="$(lsof -t -i:$PORT)"
AMOUNT=$(wc -w<<<$PIDS);
if [ $AMOUNT = 0 ]; then
echo "No processes use port $PORT";
PORT=$var;
if [ "$(which lsof)" = "lsof not found" ]; then
echo "lsof not installed"
else
PIDS="$(lsof -t -i:$PORT)"
echo "Killing $AMOUNT process(es) using port $PORT";
AMOUNT=$(wc -w<<<$PIDS);
echo "$PIDS" | while IFS= read -r pid ; do
kill -9 $pid;
done
if [ $AMOUNT = 0 ]; then
echo "No processes use port $PORT";
else
echo "Killing $AMOUNT process(es) using port $PORT";
echo "$PIDS" | while IFS= read -r pid ; do
kill -9 $pid;
done
fi
fi
fi
}
done
}