Light Script for “Good Morning” v2.0

  • Note: This text is intended for Linux users. If you don’t know what Linux or a Bash Script is – save yourself some time and skip reading.
  • After years of experience with the Linux operating system, daily repeating operations naturally crystallize.
  • Automating daily processes not only makes the workflow smoother and faster, but also leaves more time for that first “Good Morning” coffee.

The Evolution of the Routine

In the previous version of this small craft script of mine, the focus was on basic operations: package updates and displaying basic system information. However, over time, locations change, and the need for a better system overview grows.

Version 2.0 brings significant improvements. Alongside distribution package upgrades (dist-upgrade), terminal clearing, and a more precise display of RAM and SWAP memory usage via awk filters, I’ve added something that makes every morning much more practical: live weather forecasts directly in the terminal, tailored to my current location on the map – Székesfehérvár. On top of that, we now have host details, as well as a system notification with an acoustic signal letting you know everything is ready for work.

The Code: dobro_jutro (v2.0)

Here is the complete, modified script:

#!/bin/bash

# Author: Relic Perisa ∇

-#– 1. SYSTEM UPDATE —

echo “Starting morning update, please wait a moment…”

sudo apt-get update && sudo apt-get dist-upgrade -y

clear

#— 2. YOUR DASHBOARD —

echo “Hello, $LOGNAME, welcome to the system!”

echo “You are currently in directory: $(pwd)”

echo “The machine you are working on is: $(uname -n)”

echo “——————————————“

echo “Documents located in this directory: “

ls -F

echo “——————————————“

echo “Hard disk memory availability: “

df -h | grep ‘^/dev/’

echo “——————————————“

echo “Memory (RAM & SWAP):”

# RAM: Used and Available (actual free memory for work)

# SWAP: Used and Free

free -h | awk ‘/Swap:/ { print “SWAP: Used ” $3 ” / Free ” $4 }’

echo “——————————————“

echo “Weather forecast for Székesfehérvár:”

curl -s “wttr.in/Székesfehérvár?format=3”

echo “——————————————“

echo “Details of your Computer: “

hostnamectl

echo “——————————————“

echo “Goodbye for now, $LOGNAME! Exact time is $(date +%T)”

# — 3. NOTIFICATION AND CUSTOM SOUND —

notify-send “System is ready!” “Update completed. Székesfehérvár is waiting for you!” –icon=weather-clouds

# Forcing any available system sound from the base directory (usually in /usr/share/sounds)

paplay /usr/share/sounds/freedesktop/stereo/message-new-instant.oga 2>/dev/null || echo -e “\a”

How to Set Up and Use the Updated Version?

In your running terminal (Ctrl + Alt + T), open or create the document:

  • Bash

nano good_morning

If you want to completely clear out the old content inside the nano editor, simply hold down the shortcut Ctrl + K until all lines are removed, then copy and paste the code above.

Save changes with Ctrl + O -> Enter, and exit with Ctrl + X.

Set execution permissions:

Bash

chmod +x good_morning

Move the executable file to a system-wide path:

Bash

sudo cp -v good_morning /bin/

From this moment on, every morning starts with the same simple command:

Bash

good_morning

You can download this version of the script soon from my GitHub repository.