Merge pull request #182 from grunjol/master

add icon for linux desktop file
This commit is contained in:
Feross Aboukhadijeh
2016-03-20 16:00:44 -07:00

View File

@@ -7,6 +7,7 @@ module.exports = function () {
}
if (process.platform === 'linux') {
installDesktopFile()
installDesktopIcon()
}
}
@@ -27,6 +28,19 @@ function installDesktopFile () {
fs.writeFileSync(desktopFilePath, desktopFile)
}
function installDesktopIcon () {
var config = require('../config')
var fs = require('fs')
var path = require('path')
var os = require('os')
var iconStaticPath = path.join(config.STATIC_PATH, 'WebTorrent.png')
var iconFile = fs.readFileSync(iconStaticPath)
var iconFilePath = path.join(os.homedir(), '.local', 'share', 'icons', 'webtorrent.png')
fs.writeFileSync(iconFilePath, iconFile)
}
/**
* To add a protocol handler on Windows, the following keys must be added to the Windows
* registry: