-
-
Save loneicewolf/bff76d8d0809120525a65c3621b81be8 to your computer and use it in GitHub Desktop.
## edit: this was only called "colors in bash" but I renamed it to include more "general" or "overall" effects, | |
## such as; popups(zenity, notify-send, ..) and (soon coming!) ncurses, etc. | |
# might be some errors (not only grammar) | |
# red=31 | |
# green=32 | |
# blue=34 | |
# yellow=33 | |
# cyan=36 | |
# pink=35 | |
## to use printf DO \n AT END | |
m="hello" && for i in {31,32,34,33,36,35}; do printf "\e["$i"m$m\e[00m\n"; done | |
m="hello" && for i in {31,32,34,33,36,35}; do echo -e "\e["$i"m$m\e[00m"; done | |
# hello | |
# ... | |
# hello | |
## all in diff colors. | |
loneicewolf
commented
Jul 20, 2022
note: not mine, I took it from CERNs spectre/meltdown check bash script
ALERT(){
case "$1" in
R) col="\033[101m\033[30m";;
G) col="\033[102m\033[30m";;
Y) col="\033[103m\033[30m";;
B) col="\033[104m\033[30m";;
*) col="";;
esac
/bin/echo -ne "$col $2 \033[0m"
[ -n "$3" ] && /bin/echo -n " ($3)"
/bin/echo
}
ALERT "G" "[+] something went good somewhere.."
ALERT "R" "[-] something went terribly wrong somewhere.. hopefully not here..."
Okay, but what about pictures?
text is good, but.. not very "nice" or "fun" to look at, would be better if we could use some nice picture (as well) as the text. Why limit ourselves? :)
first download your favo picture. Which might be, you know - a wallpaper, an actual icon, emoji, or a gif. (if a gif, screenshot where you want - and save it as a .ico) (in fact, save all pictures/images/icons as just that. Icons (.ico
) else you will get a
# ~~~~~icon to display~~~~~ ~~~~~message to display~~~~~
notify-send -i /path/to/your/favorite/image.ico "Hello world!"
it will not only (as you probably already guessed) display text "hello world!" but it will also display that icon
(think of a fun thing like when you boot into the system and you are presented with a message saying "welcome" and a emoji with sunglasses on, instead of just a boring text.)