From 59c0c9500aafed578bffda86520624632dedc989 Mon Sep 17 00:00:00 2001 From: Lukas Bestle Date: Sun, 13 Sep 2015 18:02:23 +0200 Subject: [PATCH] Initial commit --- LICENSE.md | 21 ++++++ README.md | 83 ++++++++++++++++++++++++ bin/welcome | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 284 insertions(+) create mode 100644 LICENSE.md create mode 100644 README.md create mode 100755 bin/welcome diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..cbc4d65 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +# The MIT License (MIT) + +Copyright (c) 2015 Lukas Bestle + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8692f88 --- /dev/null +++ b/README.md @@ -0,0 +1,83 @@ +# welcome + +> A more beautiful and informative shell login message + +## Introduction + +If you use the shell on your computer or server a lot, it makes sense to customize everything to your needs. Still, many people I know get greeted by a dollar sign and a boxy cursor. + +I wanted to see at the first glance on which host I'm working and what the current state of the system is. All of that should be beautiful and flexible to configure. So I created welcome, which looks like this on my Uberspace account: + +![](https://cdn.codesignd.net/projects/welcome/screenshot.png) + +The information below the fancy dynamic ASCII art comes from a modular information provider setup. Each line is its own shell script that can do whatever it wants and output one or more lines of (colored) text. The information then gets layouted automatically by indenting it properly and adding a heading in front of it. + +*BTW, before you ask: That is [iTerm 2](http://iterm2.com) with the Solarized Dark color preset and [oh-my-zsh](http://ohmyz.sh) with the agnoster theme.* + +## Setup + +### Install welcome + +The `welcome` script from the `bin` directory can be installed anywhere in your `$PATH`. `~/bin` makes sense, but it can be any directory. + +### Install figlet, a dependency of welcome + +[figlet](http://www.figlet.org) is a command line tool to generate fancy ASCII art from text and is a required depencency of welcome. + +1. Install figlet itself. You can build it from source, but much easier (for example on Uberspace) is the following command to setup everything automatically: + ```bash + toast arm ftp://ftp.figlet.org/pub/figlet/program/unix/figlet-2.2.5.tar.gz + ``` + +2. Get colossal, a figlet ASCII font that looks great but is not included by default: Download the file [colossal.flf](http://www.figlet.org/fonts/colossal.flf) from the figlet website and place it in `~/.welcome/colossal.flf`. + +### Create your own information providers + +The reason welcome is so flexible is the modular information provider system. There are two different kinds of information providers: + +#### Summarizers + +A summarizer is a function that returns one or more lines of text. Summarizers are expected to always output information and are therefore useful for information like the current date, the system uptime etc. + +You can place as many summarizers as you need in `~/.welcome/summarizers`. Each summarizer is a shell script with a specific structure: + +```bash +function helloWorldSummarizer() { + echo "World" +} + +registerSummarizer "Hello" helloWorldSummarizer +``` + +Each summarizer must contain at least one function that outputs arbitrary text. You then need to use `registerSummarizer