irongit

a bin full of cool programs

'have fancy colors and styleme'

huncholanehuncholaneauthored
parent 5963fb7commit 88eb10756722c5be701b14d8f1f626e61f2899d4Browse files

1 file changed, +34 -0

+34-0bin/styleme
@@ -0,0 +1,34 @@
1+#!/bin/bash
2+
3+# Display text styles
4+echo -n "Text Styles "
5+styles=("0 Normal" "1 Bold" "3 Italic" "4 Underline" "5 Blink" "7 Reverse" "9 Strikethrough")
6+for style in "${styles[@]}"; do
7+ code=$(echo "$style" | awk '{print $1}')
8+ desc=$(echo "$style" | awk '{$1=""; print $0}')
9+ echo -e -n "\e[${code}mCode ${code}\e[0m "
10+done
11+
12+echo
13+
14+# Display foreground colors
15+echo -n "Foreground Colors "
16+for fg in {30..37}; do
17+ echo -e -n "\e[${fg}mCode ${fg}\e[0m "
18+done
19+
20+echo
21+
22+# Display background colors
23+echo -n "Background Colors "
24+for bg in {40..47}; do
25+ echo -e -n "\e[${bg}mCode ${bg}\e[0m "
26+done
27+
28+echo
29+
30+# Reminder on how to use these
31+echo -e "\n\e[2mExample Usage:"
32+echo "\\e[<STYLE>;<FG>;<BG>mText"
33+echo -e -n "\e[0m"
34+echo -e "Replace <STYLE>, <FG>, <BG> with the desired codes.\e[0m"