add icon for linux desktop file
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user