dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone git://edryd.org/dotfiles
Log | Files | Refs

commit 6cc7b4eee1faa9886329970a0612d9efcc0da24b
parent 828db3a2171e9868a93922a6a1ea75fbb8652524
Author: Ed van Bruggen <edvb54@gmail.com>
Date:   Fri,  7 Nov 2014 17:22:02 -0800

Bin: Add Checkium

Diffstat:
bin/checkium.sh | 34++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+), 0 deletions(-)

diff --git a/bin/checkium.sh b/bin/checkium.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +check_color() { + if [[ $? -eq 0 ]]; then + echo "${Green}" + return 0 + else + echo "${Red}" + return 1 + fi +} + +face() { + if [[ $? -eq 0 ]]; then + local face=":)" + else + local face=":(" + fi + echo $face +} + +random_face() { + if [[ $? -eq 0 ]]; then + local faces=(":)" ":D") + else + local faces=(":P" ":(" ":(" ":O" ":\\" ":|" ":(" ":(") + fi + + local facels=${#faces[*]} + local randfacels=${faces[$(($RANDOM % $facels))]} + echo $randfacels + +} +