Conversation
|
Just woke up ,
I was going to do that as well because it was beginning to get annoying to add the themes by hand manually, good job on that. I don't really like the error handling specifically the ex. if tw.Name == "" || len(tw.Colors) == 0 {
// skip invalid color
continue
}Is it possible to refactor this to something else to somehow skip an iteration without Also please note that your pr is a bit big for me and its my first time reviewing pr's so its going to take a a day or so to merge after changes and testing :) Thanks for contributing. Though i have to say this is a much needed change and a really cool one ! |
|
Decided to merge anyway i will refactor the Refactored if !valid {
continue
}
themes[strings.ToLower(theme.Name)] = themeinto if valid && !themeExists(theme.Name) {
themes[strings.ToLower(theme.Name)] = theme
}removing a continue statement and making sure no duplicate theme can be loaded , because that was possible with the previous code |
Hello. I added the ability to add custom themes in a yaml file and added a command to list available themes. i wanted to use this program personally but i didn't want to have to open a pr and wait for merge any time i wanted to add an unsupported theme or change a color.
I look for $XDG_CONFIG_HOME/gowall/config.yml or $HOME/.config/gowall/config.yml if you want to standardize your config file or use a flag to pass in the config file path eventually that will need to change.
I made the parser just read hex strings and convert them to color.Color. you might want to consider doing that in your code so its easier to add themes to the codebase without converting them.
let me know if you dont like any of this or want something changed
example config file