Skip to content

Commit

Permalink
Let user specify brightness with cli-flag --brightness
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Feb 4, 2020
1 parent 77d07d4 commit 9aaf097
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ var (
deck *Deck
recentWindows []Window

deckFile = flag.String("deck", "deckmaster.deck", "path to deck config file")
deckFile = flag.String("deck", "deckmaster.deck", "path to deck config file")
brightness = flag.Uint("brightness", 80, "brightness in percent")
)

func handleActiveWindowChanged(dev streamdeck.Device, event ActiveWindowChangedEvent) {
Expand Down Expand Up @@ -108,7 +109,11 @@ func main() {
if err != nil {
log.Fatal(err)
}
err = dev.SetBrightness(80)

if *brightness > 100 {
*brightness = 100
}
err = dev.SetBrightness(uint8(*brightness))
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 9aaf097

Please sign in to comment.