diff --git a/aliases b/aliases index 9c8027c..d915d1e 100644 --- a/aliases +++ b/aliases @@ -18,7 +18,7 @@ alias tn="tmux new-session -s" alias gcc="gcc -g" alias hora='date "+%H:%M:%S"' alias wthr='curl wttr.in/san_luis_obispo' -alias nf='cl; neofetch; shownetinfo && lab && batt' +alias nf='cl; neofetch; shownetinfo && batt' alias servers='python3 /Users/smparkin/Development/server_stats/servers.py' # School diff --git a/functions b/functions index bf0f53e..bddc928 100644 --- a/functions +++ b/functions @@ -1,25 +1,28 @@ function shownetinfo() { OSTYPE=$(uname -s) - IP="" - GW="" - NET="" + LANIP="" + WANIP="" + ROUTR="" if [ "$OSTYPE" = "Linux" ]; then - IP=$(ip addr show | grep -v "127.0.0.1" | grep "inet " | head -1 | cut -d " " -f6 | cut -d "/" -f1) - NET=$(ip route | grep default | cut -d " " -f3) + LANIP=$(ip addr show | grep -v "127.0.0.1" | grep "inet " | head -1 | cut -d " " -f6 | cut -d "/" -f1) + ROUTR=$(ip route | grep default | cut -d " " -f3) + if [ "$ROUTR" != "" ]; then + WANIP=$(timeout 0.25s curl -s ipv4.icanhazip.com) + fi elif [ "$OSTYPE" = "Darwin" ]; then - NET=$(system_profiler SPNetworkDataType | grep "Router:" | cut -c 19-30 | head -1) - IP=$(ifconfig | grep -v "127.0.0.1" | grep "inet " | head -1 | cut -d " " -f2) - fi - if [ "$NET" != "" ]; then - GW=$(curl -s icanhazip.com) + ROUTR=$(system_profiler SPNetworkDataType | grep "Router:" | cut -c 19-30 | head -1) + LANIP=$(ifconfig | grep -v "127.0.0.1" | grep "inet " | head -1 | cut -d " " -f2) + if [ "$ROUTR" != "" ]; then + WANIP=$(gtimeout 0.25s curl -s ipv4.icanhazip.com) + fi fi tput setaf 7; tput bold; echo -en "Net: " tput sgr0 - tput setaf 7; echo -en "internal $IP" - if [ "$NET" != "" ]; then - echo -en ", external $GW" - echo -en ", router $NET" + tput setaf 7; echo -en "internal $LANIP" + if [ "$ROUTR" != "" ]; then + echo -en ", external $WANIP" + echo -en ", router $ROUTR" fi tput sgr0 } diff --git a/gitconfig b/gitconfig index fd9d93b..5a73f73 100644 --- a/gitconfig +++ b/gitconfig @@ -8,3 +8,5 @@ email = smparkin@calpoly.edu [core] excludesfile = ~/.gitignore_global +[pull] + rebase = false diff --git a/zshrc b/zshrc index fcc1b0f..75e8c37 100644 --- a/zshrc +++ b/zshrc @@ -45,7 +45,9 @@ if [ "$OSTYPE" = "Darwin" ]; then if [ "$ARCH" = "arm64" ]; then export PATH="/opt/homebrew/bin:$PATH" export PATH="/opt/homebrew/sbin:$PATH" + export PATH="/Users/smparkin/Library/Python/3.9/bin:$PATH" elif [ "$ARCH" = "x86_64" ]; then export PATH="/usr/local/bin:$PATH" + export PATH="/usr/local/sbin:$PATH" fi fi