diff options
author | Andinus <andinus@nand.sh> | 2020-03-23 13:32:16 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-03-23 13:32:16 +0530 |
commit | a6b03fa4bb89a8f0c3546f720d5b35178c29f499 (patch) | |
tree | a0092511e85360e9a11578e530ccd751cee124ec /cmd/cetus/bpod.go | |
parent | 929e30adced38ac82f4482aa8c0c813e6fa2471b (diff) | |
download | cetus-a6b03fa4bb89a8f0c3546f720d5b35178c29f499.tar.gz |
Add notify functionality to cetus
Diffstat (limited to 'cmd/cetus/bpod.go')
-rw-r--r-- | cmd/cetus/bpod.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cmd/cetus/bpod.go b/cmd/cetus/bpod.go index f308d47..cf0a4bb 100644 --- a/cmd/cetus/bpod.go +++ b/cmd/cetus/bpod.go @@ -8,6 +8,7 @@ import ( "framagit.org/andinus/cetus/pkg/background" "framagit.org/andinus/cetus/pkg/bpod" + "framagit.org/andinus/indus/notification" ) func execBPOD() { @@ -107,6 +108,18 @@ func execBPOD() { bpod.Print(res) } + // Send a desktop notification if notify flag was passed + if *bpodNotify { + n := notification.Notif{} + n.Title = res.Title + n.Message = fmt.Sprintf("%s\n\n%s", + res.StartDate, + res.Copyright) + + err = n.Notify() + chkErr(err) + } + // Proceed only if the command was set because if it was fetch // then it's already finished & should exit now. if os.Args[1] == "fetch" { |