initial commit
This commit is contained in:
commit
7dbf0b46a5
36
index.js
Normal file
36
index.js
Normal file
@ -0,0 +1,36 @@
|
||||
var app = require('app')
|
||||
var Tray = require('tray')
|
||||
var Menu = require('menu')
|
||||
var shell = require('shell')
|
||||
var config = require('ssb-config')
|
||||
|
||||
// Report crashes to our server.
|
||||
//require('crash-reporter').start();
|
||||
|
||||
var tray
|
||||
|
||||
app.on('ready', function ready () {
|
||||
// start sbot
|
||||
require('scuttlebot').init(config, function (err, sbot) {
|
||||
|
||||
// setup tray icon
|
||||
tray = new Tray('./icon.png')
|
||||
var contextMenu = Menu.buildFromTemplate([
|
||||
{ label: 'Open App', click: onopen },
|
||||
{ label: 'Quit', click: onquit }
|
||||
])
|
||||
tray.setContextMenu(contextMenu)
|
||||
tray.setToolTip('Secure Scuttlebutt: Running on port 8008')
|
||||
tray.on('double-clicked', onopen)
|
||||
|
||||
function onopen () {
|
||||
shell.openExternal('http://localhost:8008')
|
||||
}
|
||||
function onquit () {
|
||||
tray = null
|
||||
sbot.close()
|
||||
process.exit()
|
||||
}
|
||||
|
||||
})
|
||||
});
|
18
package.json
Normal file
18
package.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "electron-scuttlebot",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "electron ."
|
||||
},
|
||||
"author": "",
|
||||
"license": "?",
|
||||
"devDependencies": {
|
||||
"electron-prebuilt": "^0.28.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"scuttlebot": "^4.2.3",
|
||||
"ssb-config": "^1.0.3"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user