commit 7dbf0b46a5080c4c3469cb014d6ec807ec4d335e Author: Paul Frazee Date: Wed Jun 24 10:41:17 2015 -0500 initial commit diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..7aabf6c Binary files /dev/null and b/icon.png differ diff --git a/index.js b/index.js new file mode 100644 index 0000000..5082d8f --- /dev/null +++ b/index.js @@ -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() + } + + }) +}); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..187f97d --- /dev/null +++ b/package.json @@ -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" + } +}