Skip to content

philsphicas/motd-verse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

motd-verse

Display the Bible Gateway "Verse of the Day" in your Linux MOTD, with systemd integration and translation support.

Features

  • Fetches the verse of the day from Bible Gateway (default: NIV)
  • Configurable translation (e.g., NIV, ESV, NLT, etc.) via environment variable or /etc/default/motd-verse
  • Caches the verse to avoid repeated downloads
  • Robust error handling and fallback to last cached verse
  • Systemd service and timer for scheduled updates
  • Simple install/uninstall scripts
  • Easy configuration via /etc/default/motd-verse

Installation

Run as root:

./install.sh

This installs the script, systemd unit files, creates /etc/default/motd-verse if needed, and enables the timer.

Uninstallation

Run as root:

./uninstall.sh

You will be prompted to remove the cache and config files.

Configuration

Configure motd-verse by editing /etc/default/motd-verse:

  • TRANSLATION — Bible translation code (if unset or empty, Bible Gateway's default is used: NIV)
  • CACHE — Cache file location (default: /var/cache/motd-verse)
  • URL — Override the Bible Gateway API URL (advanced)
  • TIMEOUT — Timeout in seconds for API requests (default: 2)

Example /etc/default/motd-verse:

# Bible translation code (e.g., NIV, ESV, NLT)
#TRANSLATION=

# Cache file location
CACHE=/var/cache/motd-verse

# Override the Bible Gateway API URL (advanced)
#URL=https://www.biblegateway.com/votd/get/?format=json

# Timeout in seconds for API requests
TIMEOUT=2

Supported Translations

Set TRANSLATION to any valid Bible Gateway version code, such as:

  • NIV — New International Version (Bible Gateway default if TRANSLATION is unset)
  • ESV — English Standard Version
  • KJV — King James Version
  • NASB — New American Standard Bible
  • NLT — New Living Translation

See Bible Gateway versions for a full list.

How It Works

  • The script fetches the verse of the day from Bible Gateway and caches it.
  • The systemd timer runs the update hourly and at startup.
  • The script is called by the MOTD system to display the verse at login.

Troubleshooting

  • If the verse is not updating, check the timer status:
    systemctl status motd-verse.timer
    
  • To force a refresh:
    /etc/update-motd.d/50-motd-verse --force
    
  • After changing configuration, restart the timer:
    systemctl restart motd-verse.timer
    

License

MIT License. Not affiliated with Bible Gateway.

About

Display the Verse of the Day from Bible Gateway in MOTD

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published