github.com/wtfutil/wtf@v0.43.0/modules/spotify/settings.go (about)

     1  package spotify
     2  
     3  import (
     4  	"github.com/olebedev/config"
     5  	"github.com/wtfutil/wtf/cfg"
     6  )
     7  
     8  const (
     9  	defaultFocusable = true
    10  	defaultTitle     = "Spotify"
    11  )
    12  
    13  type colors struct {
    14  	label string
    15  	text  string
    16  }
    17  
    18  type Settings struct {
    19  	colors
    20  	*cfg.Common
    21  }
    22  
    23  func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
    24  	settings := Settings{
    25  		Common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
    26  	}
    27  
    28  	settings.colors.label = ymlConfig.UString("colors.label", "green")
    29  	settings.colors.text = ymlConfig.UString("colors.text", "white")
    30  
    31  	return &settings
    32  }