Browse Source

initial commit

Paul Frazee 4 years ago
commit
7dbf0b46a5
3 changed files with 54 additions and 0 deletions
  1. BIN
      icon.png
  2. 36
    0
      index.js
  3. 18
    0
      package.json

BIN
icon.png View File


+ 36
- 0
index.js View File

@@ -0,0 +1,36 @@
1
+var app = require('app')
2
+var Tray = require('tray')
3
+var Menu = require('menu')
4
+var shell = require('shell')
5
+var config = require('ssb-config') 
6
+
7
+// Report crashes to our server.
8
+//require('crash-reporter').start();
9
+
10
+var tray
11
+
12
+app.on('ready', function ready () {
13
+  // start sbot
14
+	require('scuttlebot').init(config, function (err, sbot) {
15
+
16
+    // setup tray icon
17
+    tray = new Tray('./icon.png')
18
+    var contextMenu = Menu.buildFromTemplate([
19
+      { label: 'Open App', click: onopen },
20
+      { label: 'Quit', click: onquit }
21
+    ])
22
+    tray.setContextMenu(contextMenu)
23
+    tray.setToolTip('Secure Scuttlebutt: Running on port 8008')
24
+    tray.on('double-clicked', onopen)
25
+
26
+    function onopen () {
27
+      shell.openExternal('http://localhost:8008')
28
+    }
29
+    function onquit () {
30
+      tray = null
31
+      sbot.close()
32
+      process.exit()
33
+    }
34
+
35
+  })
36
+});

+ 18
- 0
package.json View File

@@ -0,0 +1,18 @@
1
+{
2
+  "name": "electron-scuttlebot",
3
+  "version": "1.0.0",
4
+  "description": "",
5
+  "main": "index.js",
6
+  "scripts": {
7
+    "start": "electron ."
8
+  },
9
+  "author": "",
10
+  "license": "?",
11
+  "devDependencies": {
12
+    "electron-prebuilt": "^0.28.2"
13
+  },
14
+  "dependencies": {
15
+    "scuttlebot": "^4.2.3",
16
+    "ssb-config": "^1.0.3"
17
+  }
18
+}

Loading…
Cancel
Save