From e230c28e740290cfa6cfbdbde148002790e2c6f2 Mon Sep 17 00:00:00 2001 From: Armin Date: Sat, 31 Jan 2015 00:48:16 +0100 Subject: [PATCH] add powerlinecolours --- lib/powerlinecolours | 71 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 lib/powerlinecolours diff --git a/lib/powerlinecolours b/lib/powerlinecolours new file mode 100644 index 000000000..27a0450fc --- /dev/null +++ b/lib/powerlinecolours @@ -0,0 +1,71 @@ +# custom colour definitions for powerline theme (oh-my-zsh) +# this file should be symlinked to ~/.powerlinecolours if you +# want to make use of it. + +# get your hostname checksum with: + +# OSX: +# echo -n "$(hostname)" | shasum | cut -d" " -f 1 + +# Linux: +# echo -n "$(hostname)" | sha1sum | cut -d" " -f 1 + +# c7d8a6d722a1ec9a16fae165177c418d4fd63175 + +# use shasum on Mac OS X, sha1sum on Linux: +if [[ "$(uname)" == "Darwin" ]]; then + shasum_cmd="shasum" +else + shasum_cmd="sha1sum" +fi + +# calculate hostname sha1 +hash="$(echo -n "$(hostname)" | $shasum_cmd | cut -d" " -f 1)" + +case "$hash" in + + +# specify colour themes for different hosts here (to see the ccolour codes, use the 256-colour-test.py script): +c4c948228b9947cec128662a414e1f4194573329) +colours=(254 24 208 236) +# \ \ \ \________________> prompt background colour for root +# \ \ \__________________> prompt foreground colour for root +# \ \_____________________> prompt background colour for user +# \_______________________> prompt foreground colour for user +;; + +c7d8a6d722a1ec9a16fae165177c418d4fd63175) +colours=(254 52 196 32) +# \ \ \ \________________> prompt background colour for root +# \ \ \__________________> prompt foreground colour for root +# \ \_____________________> prompt background colour for user +# \_______________________> prompt foreground colour for user +;; + +09407639790bbb3778e1c2a9f81c0680186097d1) +colours=(254 62 196 32) +# \ \ \ \________________> prompt background colour for root +# \ \ \__________________> prompt foreground colour for root +# \ \_____________________> prompt background colour for user +# \_______________________> prompt foreground colour for user +;; + +0ccd98ec02bedc50fef38fc9f285eb14b63c89a4) +colours=(254 130 196 32) +# \ \ \ \________________> prompt background colour for root +# \ \ \__________________> prompt foreground colour for root +# \ \_____________________> prompt background colour for user +# \_______________________> prompt foreground colour for user +;; + + + + +esac + +# set colours from array: +prompt_context_user_fg="${colours[1]}" +prompt_context_user_bg="${colours[2]}" +prompt_context_root_fg="${colours[3]}" +prompt_context_root_bg="${colours[4]}" +