Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# Lightweight MOTD script by Shuga. Licensed under CC-0.
SHUGA_MACHINE_NAME=Senko
SHUGA_MACHINE_ICON=🦊
SHUGA_MACHINE_COLOR="2;239;144;19m"
PS1="\033[48;$SHUGA_MACHINE_COLOR $SHUGA_MACHINE_ICON\033[38;2;0;0;0m \w\[ \033[00m\]\033[38;$SHUGA_MACHINE_COLOR""\033[00m\] "
echo -e "$SHUGA_MACHINE_ICON\033[38;$SHUGA_MACHINE_COLOR Welcome to $SHUGA_MACHINE_NAME!\033[0m"
echo -e " \033[38;2;115;144;196mConnected to $(dig -4 +short myip.opendns.com @resolver1.opendns.com).\033[0m"
echo -e " \033[38;2;115;144;196mUptime: $(uptime -p)\033[0m"
echo -e " \033[38;2;115;144;196mMemory: \033[38;2;115;144;196m$(free -m | awk 'NR==2{printf "%s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }')\033[0m"
echo -e " \033[38;2;115;144;196mDisk: $(df -h | awk '$NF=="/"{printf "%d/%dGB (%s)\n", $3,$2,$5}')\033[0m"
echo -e " \033[38;2;115;144;196mCPU: $(top -bn1 | grep load | awk '{printf "%.2f\n", $(NF-2)}' )\033[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.