forked from ptrcnull/bat-alert
Compare commits
No commits in common. "d230d84e91bbd5ba62a0c6a99c5229a1a0c14060" and "d1a03b924e361695539223cd8a33a30d0ca25378" have entirely different histories.
d230d84e91
...
d1a03b924e
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -11,7 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func notify(msg string) {
|
func notify(msg string) {
|
||||||
cmd := exec.Command("notify-send", "-t", "5000", "-u", "critical", "bat-alert", msg)
|
cmd := exec.Command("notify-send", "-t", "5000", "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 <= *targetFlag {
|
if numCap < 15 {
|
||||||
if !sent {
|
if !sent {
|
||||||
sent = true
|
sent = true
|
||||||
notify("battery running low!")
|
notify("battery running low!")
|
||||||
|
|
Loading…
Reference in a new issue