diff --git a/bin/package.js b/bin/package.js index 9f72e190..6e622d64 100755 --- a/bin/package.js +++ b/bin/package.js @@ -484,6 +484,11 @@ function buildLinux (cb) { dest: destPath, expand: true, cwd: filesPath + }, { + src: ['./**'], + dest: path.join('/usr', 'share'), + expand: true, + cwd: path.join(config.STATIC_PATH, 'linux', 'share') }], function (err) { if (err) return cb(err) console.log(`Linux: Created ${destArch} deb.`) diff --git a/src/main/handlers.js b/src/main/handlers.js index 4224b408..eb2f18a6 100644 --- a/src/main/handlers.js +++ b/src/main/handlers.js @@ -280,6 +280,9 @@ function installLinux () { var config = require('../config') var log = require('./log') + // Do not install in user dir if running on system + if (/^\/opt/.test(process.execPath)) return + installDesktopFile() installIconFile() diff --git a/static/linux/share/applications/webtorrent-desktop.desktop b/static/linux/share/applications/webtorrent-desktop.desktop new file mode 100644 index 00000000..e791833a --- /dev/null +++ b/static/linux/share/applications/webtorrent-desktop.desktop @@ -0,0 +1,33 @@ +[Desktop Entry] +Name=WebTorrent +Version=1.0 +GenericName=BitTorrent Client +X-GNOME-FullName=WebTorrent +Comment=Download and share files over BitTorrent +Encoding=UTF-8 +Type=Application +Icon=webtorrent-desktop +Terminal=false +Path=/opt/webtorrent-desktop +Exec=/opt/webtorrent-desktop/WebTorrent %U +TryExec=/opt/webtorrent-desktop/WebTorrent +StartupNotify=false +Categories=Network;FileTransfer;P2P; +MimeType=application/x-bittorrent;x-scheme-handler/magnet;x-scheme-handler/stream-magnet; + +Actions=CreateNewTorrent;OpenTorrentFile;OpenTorrentAddress; + +[Desktop Action CreateNewTorrent] +Name=Create New Torrent... +Exec=/opt/webtorrent-desktop/WebTorrent -n +Path=/opt/webtorrent-desktop + +[Desktop Action OpenTorrentFile] +Name=Open Torrent File... +Exec=/opt/webtorrent-desktop/WebTorrent -o +Path=/opt/webtorrent-desktop + +[Desktop Action OpenTorrentAddress] +Name=Open Torrent Address... +Exec=/opt/webtorrent-desktop/WebTorrent -u +Path=/opt/webtorrent-desktop diff --git a/static/linux/share/icons/hicolor/256x256/apps/webtorrent-desktop.png b/static/linux/share/icons/hicolor/256x256/apps/webtorrent-desktop.png new file mode 100644 index 00000000..6a3df05b Binary files /dev/null and b/static/linux/share/icons/hicolor/256x256/apps/webtorrent-desktop.png differ diff --git a/static/linux/share/icons/hicolor/48x48/apps/webtorrent-desktop.png b/static/linux/share/icons/hicolor/48x48/apps/webtorrent-desktop.png new file mode 100644 index 00000000..a9803979 Binary files /dev/null and b/static/linux/share/icons/hicolor/48x48/apps/webtorrent-desktop.png differ