Compare commits
	
		
			3 Commits
		
	
	
		
			1b054466cf
			...
			6b033f10de
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						6b033f10de
	
				 | 
					
					
						|||
| 
						
						
							
						
						968b098344
	
				 | 
					
					
						|||
| 
						
						
							
						
						8b2a67b73b
	
				 | 
					
					
						
@@ -8,10 +8,15 @@ import (
 | 
			
		||||
	"git.kill0.net/chill9/lume"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type Config struct {
 | 
			
		||||
	AccessToken string
 | 
			
		||||
	Colors      map[string]string `toml:"colors"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type CmdArgs struct {
 | 
			
		||||
	Flags  Flags
 | 
			
		||||
	Client *lifx.Client
 | 
			
		||||
	Selector string
 | 
			
		||||
	Config Config
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type Flags struct {
 | 
			
		||||
 
 | 
			
		||||
@@ -13,16 +13,8 @@ import (
 | 
			
		||||
 | 
			
		||||
const lumercFile = ".lumerc"
 | 
			
		||||
 | 
			
		||||
type Config struct {
 | 
			
		||||
	AccessToken string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func main() {
 | 
			
		||||
	var (
 | 
			
		||||
		selector string
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
	var config Config
 | 
			
		||||
	var config lumecmd.Config
 | 
			
		||||
	homeDir, err := os.UserHomeDir()
 | 
			
		||||
	_, err = toml.DecodeFile(path.Join(homeDir, lumercFile), &config)
 | 
			
		||||
	if os.IsNotExist(err) {
 | 
			
		||||
@@ -42,7 +34,7 @@ func main() {
 | 
			
		||||
 | 
			
		||||
	cmdArgs := lumecmd.CmdArgs{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Selector: selector,
 | 
			
		||||
		Config: config,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	cmd, ok := lumecmd.GetCommand(command)
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	var cmdName string = "set-state"
 | 
			
		||||
	var cmdName string = "toggle"
 | 
			
		||||
 | 
			
		||||
	fs := flag.NewFlagSet(cmdName, flag.ExitOnError)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user