Skip to content

Commit 9aaf097

Browse files
committed
Let user specify brightness with cli-flag --brightness
1 parent 77d07d4 commit 9aaf097

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ var (
2323
deck *Deck
2424
recentWindows []Window
2525

26-
deckFile = flag.String("deck", "deckmaster.deck", "path to deck config file")
26+
deckFile = flag.String("deck", "deckmaster.deck", "path to deck config file")
27+
brightness = flag.Uint("brightness", 80, "brightness in percent")
2728
)
2829

2930
func handleActiveWindowChanged(dev streamdeck.Device, event ActiveWindowChangedEvent) {
@@ -108,7 +109,11 @@ func main() {
108109
if err != nil {
109110
log.Fatal(err)
110111
}
111-
err = dev.SetBrightness(80)
112+
113+
if *brightness > 100 {
114+
*brightness = 100
115+
}
116+
err = dev.SetBrightness(uint8(*brightness))
112117
if err != nil {
113118
log.Fatal(err)
114119
}

0 commit comments

Comments
 (0)