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