Skip to content

Instantly share code, notes, and snippets.

@hanxi
Created January 17, 2019 07:27
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 hanxi/122563e68b65a2f3470420a8d0a30510 to your computer and use it in GitHub Desktop.
Save hanxi/122563e68b65a2f3470420a8d0a30510 to your computer and use it in GitHub Desktop.
mintty color to putty color
ForegroundColour=248,248,242
BackgroundColour=40,42,54
Black=0,0,0
BoldBlack=104,104,104
Red=255,85,85
BoldRed=255,110,103
Green=80,250,123
BoldGreen=90,247,142
Yellow=241,250,140
BoldYellow=244,249,157
Blue=202,169,250
BoldBlue=202,169,250
Magenta=255,121,198
BoldMagenta=255,146,208
Cyan=139,233,253
BoldCyan=154,237,254
White=191,191,191
BoldWhite=230,230,230
#!/bin/sh
transline()
{
color=$(echo $1 | cut -d '=' -f 2)
echo '"Colour'$2'"="'$color'"'
}
cat $1 | while read line
do
case $line in
ForegroundColour*)
transline $line 0
transline $line 1
transline $line 5
;;
BackgroundColour*)
transline $line 2
transline $line 3
transline $line 4
;;
Black*)
transline $line 6
;;
BoldBlack*)
transline $line 7
;;
Red*)
transline $line 8
;;
BoldRed*)
transline $line 9
;;
Green*)
transline $line 10
;;
BoldGreen*)
transline $line 11
;;
Yellow*)
transline $line 12
;;
BoldYellow*)
transline $line 13
;;
Blue*)
transline $line 14
;;
BoldBlue*)
transline $line 15
;;
Magenta*)
transline $line 16
;;
BoldMagenta*)
transline $line 17
;;
Cyan*)
transline $line 18
;;
BoldCyan*)
transline $line 19
;;
White*)
transline $line 20
;;
BoldWhite*)
transline $line 21
;;
esac;
done
# 1. trans mintty color to putty
sh mintty2putty.sh dracula.minttyrc > dracula.putty
# 2. trans putty color to putty tray
cat dracula.putty | awk -F'"' '{print $2"\\"$4"\\"}' > dracula.puttytray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment