Skip to content

Instantly share code, notes, and snippets.

@notpushkin
Forked from AndrewKvalheim/monokai.sh
Created March 9, 2013 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notpushkin/5123763 to your computer and use it in GitHub Desktop.
Save notpushkin/5123763 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Applies the Monokai color scheme to the current terminal session.
declare -A map0
map0=( [foreground ]='#F8F8F2' [background ]='#272822'
[cursor ]='#F8F8F0' [selection ]='#49483E'
[pink ]='#F92672' [green ]='#A6E22E'
[yellow ]='#E6DB74' [blue ]='#66D9EF'
[purple ]='#AE81FF' [orange ]='#FD971F'
[gray ]='#75715E' )
map1=( # Foreground # Background # Cursor
foreground background cursor )
map2=( # Black # Red # Green # Yellow
background pink green yellow
# Blue # Magenta # Cyan # White
blue purple orange foreground
# Bold black # Bold red # Bold green # Bold yellow
selection pink green yellow
# Bold blue # Bold magenta # Bold cyan # Bold white
blue purple orange foreground )
map3=( M o n o k a i )
map4=( 1 6 3 2 4 5 7 )
for i in "${!map1[@]}"; do echo -en "\e]1$i;${map0[${map1[$i]}]}\a"; done
for i in "${!map2[@]}"; do echo -en "\e]4;$i;${map0[${map2[$i]}]}\a"; done
for i in "${!map3[@]}"; do echo -en "\e[1;3${map4[$i]}m${map3[$i]}"; done
echo -e "\e[0m color scheme applied"
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment