1
0
mirror of https://github.com/beego/bee.git synced 2024-12-22 15:10:49 +00:00

Merge pull request #376 from amrfaissal/fix-notificator

Fixes desktop notificator for Windows and Linux
This commit is contained in:
Sergey Lanzman 2017-03-13 02:54:28 +02:00 committed by GitHub
commit 3be35d9d81

View File

@ -1,3 +1,16 @@
// Copyright 2017 bee authors
//
// Licensed under the Apache License, Version 2.0 (the "License"): you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
package utils
import (
@ -21,9 +34,9 @@ func Notify(text, title string) {
case "darwin":
osxNotify(text, title)
case "linux":
windowsNotify(text, title)
case "windows":
linuxNotify(text, title)
case "windows":
windowsNotify(text, title)
}
}
@ -45,7 +58,7 @@ func windowsNotify(text, title string) {
}
func linuxNotify(text, title string) {
exec.Command("notify-send", "-i", "", title, text)
exec.Command("notify-send", "-i", "", title, text).Run()
}
func existTerminalNotifier() bool {