Compare commits

...

2 commits
test ... master

Author SHA1 Message Date
Maja Kądziołka
d230d84e91
Make the target actually configurable 2023-03-05 15:09:49 +01:00
Maja Kądziołka
cc129b9387
Bypass do-not-disturb mode 2023-03-05 15:09:44 +01:00

View file

@ -11,7 +11,7 @@ import (
) )
func notify(msg string) { func notify(msg string) {
cmd := exec.Command("notify-send", "-t", "5000", "bat-alert", msg) cmd := exec.Command("notify-send", "-t", "5000", "-u", "critical", "bat-alert", msg)
err := cmd.Run() err := cmd.Run()
if err != nil { if err != nil {
log.Println(err) log.Println(err)
@ -34,7 +34,7 @@ func main() {
notify("error: " + err.Error()) notify("error: " + err.Error())
} }
if numCap < 15 { if numCap <= *targetFlag {
if !sent { if !sent {
sent = true sent = true
notify("battery running low!") notify("battery running low!")