Simple MOTD for Debian Desktop

Here you can discuss every aspect of Debian. Note: not for support requests!
Post Reply
User avatar
Posts: 5258
Joined: 2006-09-17 03:17
Location: Oz
Has thanked: 3 times
Been thanked: 3 times

Simple MOTD for Debian Desktop

#1 Post by craigevil »

Ubuntu-like "message of the day" screen for Debian desktop terminals, without the requirement of PAM ... an-desktop

It needs figlet and lolcat. YES I know it hasn't been updated since 2019. But it really doesn't do much. Plus the script that actually runs is pretty easy to see what it does.

Although I do not think the Swap part is correct. Just not sure what to change it to.

I had to edit the config, then copy it to /usr/bin

Here is what it looks like on my system:

Code: Select all


#BANNER=Debian Sid

[ -r /etc/lsb-release ] && . /etc/lsb-release

if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ];


  # Fall back to using the very slow lsb_release utility

  DISTRIB_DESCRIPTION=$(lsb_release -s -d)


figlet Debian Sid -c | lolcat -f

printf "\n"

printf "\t%s \t\tKernel: %s\n" "$DISTRIB_DESCRIPTION" "$(uname -r)"

printf "\n"


load=$(cat /proc/loadavg | awk '{print $1}')

root_usage=$(df -h / | awk '/\// {print $(NF-1)}')

memory_usage=$(free -t -g | grep Total | awk '{print $3;}')

total_memory=$(free -t -g | grep "Mem" | awk '{print $2" GB";}')

swap_usage=$(free -m | awk '/Swap/ { printf("%3.1f%%", "exit !$2;$3/$2*100") }')

time=$(uptime | grep -ohe 'up .*' | sed 's/,/\ hours/g' | awk '{ printf $2" "$3 }')

processes=$(ps aux | wc -l)

printf "\t\tAs of: %s\n\n" "$date"

printf "\tSystem load:\t%s\t\tProcesses:\t%s\n" "$load" "$processes"

printf "\tMemory usage:\t%s/%s\t\tUptime:\t\t%s\n" "$memory_usage" "$total_memory" "$time"

printf "\tDisk usage:\t%s\t\tSwap:\t\t%s\n\n" "$root_usage" "$swap_usage"
Raspberry PI 400 Distro: Raspberry Pi OS (Unstable) Kernel: 5.10.52-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"

Post Reply