Skip to content

Commit

Permalink
feat: general QoL changes (spicetify#1923)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrie25 authored Sep 8, 2022
1 parent 42bd615 commit aa819fb
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
21 changes: 20 additions & 1 deletion src/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (

// Flag enables/disables additional feature
type Flag struct {
CurrentTheme string
ColorScheme string
Extension []string
CustomApp []string
SidebarConfig bool
Expand Down Expand Up @@ -104,7 +106,24 @@ func htmlMod(htmlPath string, flags Flag) {
}

if flags.SpicetifyVer != "" {
helperHTML += `<script>Spicetify.version="` + flags.SpicetifyVer + `";</script>` + "\n"
var extList string
for _, ext := range flags.Extension {
extList += `"` + ext + `",`
}

var customAppList string
for _, app := range flags.CustomApp {
customAppList += `"` + app + `",`
}

helperHTML += `<script>
Spicetify.Config={};
Spicetify.Config["version"]="` + flags.SpicetifyVer + `";
Spicetify.Config["current_theme"]="` + flags.CurrentTheme + `";
Spicetify.Config["color_scheme"]="` + flags.ColorScheme + `";
Spicetify.Config["extensions"] = [` + extList + `];
Spicetify.Config["custom_apps"] = [` + customAppList + `];
</script>` + "\n"
}

for _, v := range flags.Extension {
Expand Down
2 changes: 2 additions & 0 deletions src/cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ func Apply(spicetifyVersion string) {

utils.PrintBold(`Applying additional modifications:`)
apply.AdditionalOptions(appDestPath, apply.Flag{
CurrentTheme: settingSection.Key("current_theme").MustString(""),
ColorScheme: settingSection.Key("color_scheme").MustString(""),
Extension: extensionList,
CustomApp: customAppsList,
SidebarConfig: featureSection.Key("sidebar_config").MustBool(false),
Expand Down
14 changes: 9 additions & 5 deletions src/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func DisplayAllConfig() {
}

log.Println()
utils.PrintBold("AdditionFeatures")
utils.PrintBold("AdditionalFeatures")
for _, key := range featureSection.Keys() {
name := key.Name()
if name == "extensions" || name == "custom_apps" || name == "spotify_launch_flags" {
Expand All @@ -59,15 +59,19 @@ func DisplayAllConfig() {
if listLen == 0 {
log.Println(name)
} else {
log.Println(name + strings.Repeat(" ", maxLen-len(name)) + list[0])
for _, ext := range list[1:] {
log.Println(strings.Repeat(" ", maxLen) + ext)
}
log.Println(name + strings.Repeat(" ", maxLen-len(name)) + strings.Join(list, " | "))
}
} else {
log.Println(name + strings.Repeat(" ", maxLen-len(name)) + key.Value())
}
}

log.Println()
utils.PrintBold("Backup")
for _, key := range backupSection.Keys() {
name := key.Name()
log.Println(name + strings.Repeat(" ", maxLen-len(name)) + key.Value())
}
}

// DisplayConfig displays value of requested config field
Expand Down
4 changes: 4 additions & 0 deletions src/preprocess/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ func colorVariableReplace(content string) string {

utils.Replace(&content, "#1db954", "var(--spice-button)")
utils.Replace(&content, "#1877f2", "var(--spice-button)")

utils.Replace(&content, "#1ed760", "var(--spice-button-active)")
utils.Replace(&content, "#1fdf64", "var(--spice-button-active)")
utils.Replace(&content, "#169c46", "var(--spice-button-active)")

utils.Replace(&content, "#535353", "var(--spice-button-disabled)")

utils.Replace(&content, "#333", "var(--spice-tab-active)")
Expand Down

0 comments on commit aa819fb

Please sign in to comment.