1
0
Fork 0
mirror of https://github.com/Luzifer/streamdeck.git synced 2024-12-20 17:51:21 +00:00

On program exit go back to logo

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-11-21 18:15:31 +01:00
parent 4030524c09
commit ab281813bc
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -3,6 +3,8 @@ package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"github.com/Luzifer/rconfig/v2"
"github.com/Luzifer/streamdeck"
@ -92,6 +94,11 @@ func main() {
// Initial setup
sigs := make(chan os.Signal)
signal.Notify(sigs, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM)
defer sd.ResetToLogo()
if err = sd.SetBrightness(userConfig.DefaultBrightness); err != nil {
log.WithError(err).Fatal("Unable to set brightness")
}
@ -115,6 +122,9 @@ func main() {
}
}
case <-sigs:
return
}
}
}