# README
Echo
A CLI tool to convert your VSCode themes to iTerm colors.
Demo
Project Structure
echo/
├── cmd/
│ └── echo/
│ └── main.go
├── internal/
│ ├── constants/
│ │ └── constants.go
│ ├── logger/
│ │ └── logger.go
│ ├── theme/
│ │ └── theme.go
│ ├── vsc/
│ │ └── vsc.go
│ └── converter/
│ └── converter.go
├── pkg/
│ └── utils/
│ └── utils.go
└── go.mod
└── go.sum
└── README.MD
How it works
- When user starts the program, we get all of the user's VSCode themes from the
~/.vscode/extensions
folder. - We start a goroutine for each extension folder, which processes an extension (by reading and unmarshalling file) and sends its themes through a channel.
- The main goroutine collects themes from the theme channel and appends them to the allThemes slice.
- we display the themes to the user in a list from bubbletea's library, just for aesthetic purposes (
vsctheme_picker.go
) - If the user-selected theme does not have a
themeType
set, we ask the user to select one eitherlight
ordark
. (theme_type_picker.go
) - After getting the file path of the selected theme, we convert it to an iTerm theme using the
convertTheme
function (converter.go
)- read theme file
- removes comments and trailing commas or unmarshalling errors will occur
- unmarshal the cleaned file
- iterate through ANSI color mappings and retrive corresponding color from vscode theme + add fallback colors if missing
- convert hex color to RGBA (iterm uses RGBA)
- generate iTerm theme XML