Skip to content

Instantly share code, notes, and snippets.

@mattiasghodsian
Last active December 3, 2019 23:26
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 mattiasghodsian/a953a67b0f897079764ee4e75a1778cb to your computer and use it in GitHub Desktop.
Save mattiasghodsian/a953a67b0f897079764ee4e75a1778cb to your computer and use it in GitHub Desktop.
Terminal Welcome message
#!/bin/bash
# vars
os=$(lsb_release -sd)
codename=$(lsb_release -sc)
id=$(lsb_release -si)
pubip=$(dig @resolver1.opendns.com A myip.opendns.com +short -4)
locip=$(hostname -I | cut -d " " -f1)
ut=$(awk '{print int($1/86400)"days "int($1%86400/3600)":"int(($1%3600)/60)":"int($1%60)}' /proc/uptime)
qt=$(fortune -n 25 -s)
shl=$SHELL
# font
BOLD=$(tput bold)
NORM=$(tput sgr0)
# script
clear
toilet -f "Red Phoenix" " $USER" --gay
printf " ${BOLD}$qt${NORM}\n\n"
printf " Os: ${BOLD} $os {$codename} ${NORM} \n"
printf " IP: ${BOLD} $pubip ${NORM} \n"
printf " Local: ${BOLD} $locip ${NORM} \n"
printf " Uptime: ${BOLD} $ut ${NORM} \n"
printf " Shell: ${BOLD} ${shl##*/} ${NORM} \n\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment