Allow bash to show info text
This commit is contained in:
parent
bfcc543e65
commit
d3cbce8c25
@ -4,6 +4,9 @@ export EWCONFIG_ROOT="$HOME/.config/ewconfig"
|
|||||||
# Load macros
|
# Load macros
|
||||||
. $EWCONFIG_ROOT/configs/shells/bash/macros.sh
|
. $EWCONFIG_ROOT/configs/shells/bash/macros.sh
|
||||||
|
|
||||||
|
# Show some host info
|
||||||
|
. $EWCONFIG_ROOT/configs/shells/bash/info.sh
|
||||||
|
|
||||||
# I always want my ~/bin to be in my PATH
|
# I always want my ~/bin to be in my PATH
|
||||||
export PATH="$HOME/bin:$PATH"
|
export PATH="$HOME/bin:$PATH"
|
||||||
export PATH="$EWCONFIG_ROOT/configs/scripts:$PATH"
|
export PATH="$EWCONFIG_ROOT/configs/scripts:$PATH"
|
||||||
|
@ -1,16 +1,26 @@
|
|||||||
|
|
||||||
|
# Define red and green based on the shell
|
||||||
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
red='\033[0;31m'
|
||||||
|
green='\033[0;32m'
|
||||||
|
reset_color='\033[0m'
|
||||||
|
elif [ -n "$ZSH_VERSION" ]; then
|
||||||
|
red="$fg[red]"
|
||||||
|
green="$fg[green]"
|
||||||
|
fi
|
||||||
|
|
||||||
# If `uname -s` is a BSD
|
# If `uname -s` is a BSD
|
||||||
if [ $(uname -s | grep -c BSD) -gt 0 ]; then
|
if [ $(uname -s | grep -c BSD) -gt 0 ]; then
|
||||||
echo "$fg[green]Platform:$reset_color $(uname -s) $(uname -r) $(uname -p)"
|
echo -e "${green}Platform:$reset_color $(uname -s) $(uname -r) $(uname -p)"
|
||||||
else # Linux
|
else # Linux
|
||||||
echo "$fg[green]Platform:$reset_color $(uname -o) $(uname -r)"
|
echo -e "${green}Platform:$reset_color $(uname -o) $(uname -r)"
|
||||||
echo "$fg[green]Uptime:$reset_color $(uptime -p)"
|
echo -e "${green}Uptime:$reset_color $(uptime -p)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Determine if $EWCONFIG_ROOT contains uncommitted changes
|
# Determine if $EWCONFIG_ROOT contains uncommitted changes
|
||||||
if [ -d $EWCONFIG_ROOT/.git ]; then
|
if [ -d $EWCONFIG_ROOT/.git ]; then
|
||||||
if [ -n "$(git -C $EWCONFIG_ROOT status --porcelain)" ]; then
|
if [ -n "$(git -C $EWCONFIG_ROOT status --porcelain)" ]; then
|
||||||
echo "$fg[red]ewconfig contains uncommitted changes$reset_color"
|
echo -e "${red}ewconfig contains uncommitted changes$reset_color"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -14,7 +14,7 @@ if [ -f $EWCONFIG_ROOT/configs/zsh/by_host/$HOSTNAME.sh ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Show some host info
|
# Show some host info
|
||||||
. $EWCONFIG_ROOT/configs/shells/zsh/info.sh
|
. $EWCONFIG_ROOT/configs/shells/bash/info.sh
|
||||||
|
|
||||||
# I always want my ~/bin to be in my PATH
|
# I always want my ~/bin to be in my PATH
|
||||||
export PATH="$HOME/bin:$PATH"
|
export PATH="$HOME/bin:$PATH"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user