Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Shugabuga
Created June 21, 2020 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shugabuga/59791374288878ea4d9cfe2f4b94006e to your computer and use it in GitHub Desktop.
Save Shugabuga/59791374288878ea4d9cfe2f4b94006e to your computer and use it in GitHub Desktop.
#!/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