Skip to content

MichalAFerber/welcome-message

Repository files navigation

πŸ–₯️ Custom Welcome Message for Linux & macOS

screenshot

Easily add a beautiful, dynamic welcome message to your Linux or macOS shellβ€”complete with system stats, public IP, disk usage, weather, and multi-language support.

License: MIT

πŸš€ Features

  • πŸ’¬ Multi-language support (auto-detected via LANG)
  • πŸ“¦ Fastfetch system overview at login
  • 🌐 Weather, public IP, disk usage report
  • πŸ’Ύ System metrics dashboard (memory, CPU usage)
  • ⚑ Performance optimized with smart caching
  • 🎨 Customizable via configuration file
  • πŸ”’ Security focused with timeouts and error handling
  • 🐚 Bash & ZSH support
  • πŸ“¦ Multi-distro support (Ubuntu, Debian, Fedora, Arch, openSUSE, RHEL)
  • πŸ“ Improved Raspberry Pi detection and throttling status
  • βœ… Idempotent installer β€” safe to run repeatedly
  • πŸ§ͺ Test mode and uninstall options

βš™οΈ Installation

Run this command to install:

curl -s https://raw.githubusercontent.com/MichalAFerber/welcome-message/main/install_welcome.sh | bash

βœ… You can re-run this any time β€” it will only update the script if needed.

Installation Options

# Test mode - see what would be installed without making changes
curl -s https://raw.githubusercontent.com/MichalAFerber/welcome-message/main/install_welcome.sh | bash -s -- --test

# Skip dependency installation (if you already have curl and fastfetch)
curl -s https://raw.githubusercontent.com/MichalAFerber/welcome-message/main/install_welcome.sh | bash -s -- --no-deps

# Uninstall welcome message
curl -s https://raw.githubusercontent.com/MichalAFerber/welcome-message/main/install_welcome.sh | bash -s -- --uninstall

# Show help
curl -s https://raw.githubusercontent.com/MichalAFerber/welcome-message/main/install_welcome.sh | bash -s -- --help

🎨 Configuration

After installation, customize your welcome message by editing:

~/.config/welcome.sh/config

Available Options

# Display toggles
SHOW_FASTFETCH=true          # Show fastfetch system info
SHOW_WEATHER=true            # Show weather from wttr.in
SHOW_PUBLIC_IP=true          # Show your public IP address
SHOW_SYSTEM_METRICS=true     # Show disk usage, memory, CPU temp, and top process
SHOW_ASCII_ART=false         # Show ASCII art banner
QUIET_MODE=false             # Minimal output for faster loading

# Customization
WEATHER_LOCATION=""          # Set your city (e.g., "New+York", "London")
CACHE_TIMEOUT=3600           # Cache duration in seconds (default: 1 hour)
REQUEST_TIMEOUT=3            # Timeout for external API calls (seconds)

Example configuration file: config.example

Quick Customization Examples

Enable ASCII art banner:

echo "SHOW_ASCII_ART=true" >> ~/.config/welcome.sh/config

Change weather location:

echo "WEATHER_LOCATION=\"Tokyo\"" >> ~/.config/welcome.sh/config

Speed up loading (disable slow features):

cat >> ~/.config/welcome.sh/config << EOF
SHOW_WEATHER=false
SHOW_PUBLIC_IP=false
QUIET_MODE=true
EOF

πŸ—£οΈ Language Support

The installer detects your system language using LANG and fetches a matching welcome.sh.template.{lang}. Currently available: en, es, nl, fr, de. If no matching template is found, the script will display all available templates and automatically use English.

You can temporarily force a language without changing your system locale permanently:

LANG=fr_FR.UTF-8 LANGUAGE=fr \
bash <(curl -s https://raw.githubusercontent.com/MichalAFerber/welcome-message/main/install_welcome.sh)

πŸš€ Performance Optimizations

  • Smart Caching: Public IP and weather data are cached for 1 hour by default
  • Timeouts: External API calls timeout after 3 seconds to prevent hanging
  • Quiet Mode: Disable resource-intensive features for faster loading
  • Conditional Checks: System metrics only run when needed

Cache files are stored in: ~/.cache/welcome.sh/

πŸ§ͺ Safe, Smart, and Idempotent

  • Uses content comparison (not hashes) to determine updates
  • Adds hook to .bashrc and .zshrc if needed
  • Will not duplicate or overwrite if already installed
  • Test mode available to preview changes
  • Clean uninstall option removes all files and hooks

🐧 Distribution Support

Supported Platforms

  • Linux: Ubuntu, Debian, Fedora, RHEL, CentOS, Arch Linux, Manjaro, openSUSE, SUSE Linux, Raspberry Pi OS
  • macOS: Fully compatible with Bash and Zsh (Homebrew installation recommended)

Supported Package Managers (Linux)

  • APT (Debian, Ubuntu, Raspberry Pi OS)
  • DNF (Fedora, RHEL 8+)
  • YUM (CentOS, RHEL 7)
  • Pacman (Arch Linux, Manjaro)
  • Zypper (openSUSE, SUSE Linux)

macOS Installation

On macOS, you'll need Homebrew to install dependencies. If you don't have Homebrew installed yet:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then install the required dependencies:

brew install curl fastfetch

Finally, run the installer:

curl -s https://raw.githubusercontent.com/MichalAFerber/welcome-message/main/install_welcome.sh | bash

Note: The installer will automatically detect macOS and skip Linux-specific package managers. Just ensure curl and fastfetch are installed via Homebrew first.

Raspberry Pi

Improved detection using multiple methods:

  • /proc/device-tree/model check
  • /boot/config.txt presence
  • Automatic libraspberrypi-bin installation
  • Throttling status monitoring

πŸ“¦ Dependencies

These are installed automatically (unless --no-deps is used):

  • bash, curl
  • fastfetch (via distribution package manager or PPA)
  • libraspberrypi-bin (only on Raspberry Pi)

Ubuntu 22.04+ users benefit from a Fastfetch PPA for latest builds.

οΏ½ System Metrics Dashboard

When SHOW_SYSTEM_METRICS=true, the welcome message includes:

  • Disk Usage: Disk space on /
  • Memory Usage: Shows used/total memory with percentage (uses vm_stat/sysctl on macOS, free on Linux)
  • Top CPU Process: Displays the most CPU-intensive process (hidden in quiet mode)
  • CPU Temperature: Multi-method temperature detection

Always shown (independent of SHOW_SYSTEM_METRICS):

  • Package Updates: Works across multiple package managers
  • Reboot Status: Warning if system reboot is required
  • Throttling Status: Raspberry Pi throttling detection

οΏ½πŸ“‚ Directory Layout

.
β”œβ”€β”€ install_welcome.sh
β”œβ”€β”€ config.example
└── templates/
    β”œβ”€β”€ welcome.sh.template.en
    β”œβ”€β”€ welcome.sh.template.es
    β”œβ”€β”€ welcome.sh.template.nl
    β”œβ”€β”€ welcome.sh.template.fr
    └── welcome.sh.template.de

Want to contribute a translation? Add a new welcome.sh.template.xx file!

🧠 Advanced Usage

Manual Update

To manually trigger an update, just rerun:

curl -s https://raw.githubusercontent.com/MichalAFerber/welcome-message/main/install_welcome.sh | bash

Testing Configuration Changes

After editing your config file, test it immediately:

~/welcome.sh

Temporary Disable

Comment out the hook in your shell rc file:

# ~/.bashrc or ~/.zshrc
# ~/welcome.sh

Custom Installation

Download and modify the template locally:

curl -O https://raw.githubusercontent.com/MichalAFerber/welcome-message/main/templates/welcome.sh.template.en
# Edit welcome.sh.template.en as desired
mv welcome.sh.template.en ~/welcome.sh
chmod +x ~/welcome.sh

Docker/VM Testing

To test in a clean shell environment, use Docker or a VM:

docker run -it ubuntu:22.04 bash -c "curl -s https://raw.githubusercontent.com/MichalAFerber/welcome-message/main/install_welcome.sh | bash && bash"

🀝 Contributing

Pull requests are welcome! Especially for:

  • 🌍 Translations (templates/welcome.sh.template.xx)
  • πŸ’‘ Feature ideas and enhancements
  • 🐞 Bug fixes and improvements
  • πŸ“š Documentation improvements
  • 🎨 ASCII art banners and visual enhancements

Adding a New Language

  1. Copy an existing template: cp templates/welcome.sh.template.en templates/welcome.sh.template.xx
  2. Translate all user-facing strings
  3. Test the template: bash templates/welcome.sh.template.xx
  4. Submit a pull request

πŸ†˜ Troubleshooting

Welcome message doesn't show

  • Check if the hook exists: grep welcome.sh ~/.bashrc ~/.zshrc
  • Test manually: ~/welcome.sh
  • Check for errors: bash -x ~/welcome.sh

Slow loading

  • Enable caching (default is enabled)
  • Disable weather: echo "SHOW_WEATHER=false" >> ~/.config/welcome.sh/config
  • Disable public IP: echo "SHOW_PUBLIC_IP=false" >> ~/.config/welcome.sh/config
  • Enable quiet mode: echo "QUIET_MODE=true" >> ~/.config/welcome.sh/config

Temperature not showing

  • Install lm-sensors: sudo apt install lm-sensors (Ubuntu/Debian)
  • Run sensors detection: sudo sensors-detect

Fastfetch not found

  • Manually install: sudo apt install fastfetch or check your distro's package manager
  • On older Ubuntu: The installer will try to add the PPA automatically

Apt signature verification warnings

You may see warnings like W: An error occurred during signature verification during installation on systems with third-party repositories (e.g., NodeSource for Node.js). These warnings are:

  • Not caused by the welcome-message installer
  • Typically from deprecated SHA1 signatures in third-party repos
  • Safe to ignore β€” they don't affect the welcome-message installation
  • The installer handles these gracefully and will continue normally

These are system-level warnings from your package manager when updating repository metadata, not from this project.

πŸ“„ License

MIT License

πŸ™ Credits

For more info, read the full blog guide: Custom Linux Welcome Message

Enjoy your new login experience. Whiskey, Tango, Foxtrot ready. 🫑

About

Beautiful terminal welcome message with fastfetch, weather, system metrics & multi-language support. Configurable, cached, supports 5+ distros. Bash & ZSH compatible.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages