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:
parent
4030524c09
commit
ab281813bc
1 changed files with 10 additions and 0 deletions
|
@ -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
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue