Browse Source

Fixes desktop notificator for Windows and Linux

tags/v1.8.3
Faissal Elamraoui 2 years ago
parent
commit
6394f3f80a
1 changed files with 16 additions and 3 deletions
  1. 16
    3
      utils/notification.go

+ 16
- 3
utils/notification.go View File

@@ -1,3 +1,16 @@
1
+// Copyright 2017 bee authors
2
+//
3
+// Licensed under the Apache License, Version 2.0 (the "License"): you may
4
+// not use this file except in compliance with the License. You may obtain
5
+// a copy of the License at
6
+//
7
+//     http://www.apache.org/licenses/LICENSE-2.0
8
+//
9
+// Unless required by applicable law or agreed to in writing, software
10
+// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+// License for the specific language governing permissions and limitations
13
+// under the License.
1 14
 package utils
2 15
 
3 16
 import (
@@ -21,9 +34,9 @@ func Notify(text, title string) {
21 34
 	case "darwin":
22 35
 		osxNotify(text, title)
23 36
 	case "linux":
24
-		windowsNotify(text, title)
25
-	case "windows":
26 37
 		linuxNotify(text, title)
38
+	case "windows":
39
+		windowsNotify(text, title)
27 40
 	}
28 41
 }
29 42
 
@@ -45,7 +58,7 @@ func windowsNotify(text, title string) {
45 58
 }
46 59
 
47 60
 func linuxNotify(text, title string) {
48
-	exec.Command("notify-send", "-i", "", title, text)
61
+	exec.Command("notify-send", "-i", "", title, text).Run()
49 62
 }
50 63
 
51 64
 func existTerminalNotifier() bool {

Loading…
Cancel
Save