Giter Club home page Giter Club logo

fancy-motd's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.