Skip to content

Fancy, colorful MOTD written in bash. Server status at a glance.

License

Notifications You must be signed in to change notification settings

bcyran/fancy-motd

Repository files navigation

Fancy MOTD

Fancy, colorful MOTD written in bash. Server status at a glance.

MOTD screenshot

Usage

Running

Clone the repository:

git clone https://github.com/bcyran/fancy-motd.git

Then run motd.sh:

./fancy-motd/motd.sh

This runs all the scripts in modules directory in order, run-parts style, and formats the output.

If any modules are missing in your output, plese see requirements.

You can also pass the config file path as the script argument (see configuration):

./fancy-motd/motd.sh ./path/to/config.sh

Running at login

One way to run it at each login is to add a line to ~/.profile file (assuming you cloned fancy-motd into your home directory):

~/fancy-motd/motd.sh

If you don't want to run it in all subshells you could do something like this instead:

if [ -z "$FANCY_MOTD" ]; then
    ~/fancy-motd/motd.sh
    export FANCY_MOTD=1
fi

If you use tmux and don't want to see the motd everytime you open a new shell in tmux, add this to your .tmux.conf:

set-option -ga update-environment ' FANCY_MOTD'

Requirements

In order to run all the available modules the following programs are required:

This list excludes the obvious ones, like tmux for tmux module.

If any program requried by the given module is missing (or any other error occurs), it will fail silently, i.e. the module just won't be shown at all.

Configuration

You can configure some aspects of the motd using config file. By default config.sh file in the fancy-motd directory will be read if it exists. Alternatively you can pass path to another config as a script argument.

There's an example file provided in the repo:

cd fancy-motd
cp config.sh.example config.sh

Hacking

To add a new module you can create a new script in modules directory. For the output to be properly formatted it has to use print_columns function from framework.sh, please refer to the existing modules.

Module files have to start with a two digit number followed by a hyphen. You may disable modules by simply rename the module file.

Credits

Fancy MOTD is hugely inspired by this repo by Hermann Björgvin.

About

Fancy, colorful MOTD written in bash. Server status at a glance.

Topics

Resources

License

Stars

Watchers

Forks

Languages