diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dce45f9..40656173 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ Release date: TBD - Added an option to make the taskbar icon flash on new messages - Added the badge to count mentions for Unity. - An existing application instance will be reused instead of starting another instance. +- Added a script to create `Mattermost.desktop` desktop entry file. ### Bug Fixes - Fixed an issue where the maximized state of the app window was lost in some cases. diff --git a/docs/setup.md b/docs/setup.md index 2d550e4d..b353650e 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -67,7 +67,9 @@ For Ubuntu 16.04. 2. Extract the archive, then execute `Mattermost` which is located at inside of the extracted directory -3. If you need the Desktop Entry, please refer https://wiki.archlinux.org/index.php/Desktop_entries +3. If you need the Desktop Entry, please execute `create_desktop_file.sh`. It creates `Mattermost.desktop`. + + Please refer https://wiki.archlinux.org/index.php/Desktop_entries ## Configuration You have to configure the application to interact with your teams. diff --git a/gulpfile.js b/gulpfile.js index 557cd635..380dba64 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -224,7 +224,28 @@ function makePackage(platform, arch, callback) { callback(err); } else { - callback(); + if (arch === 'linux' || arch === 'all') { + const dest_32 = 'release/Mattermost-linux-ia32'; + const dest_64 = 'release/Mattermost-linux-x64'; + fs.createReadStream('resources/icon.png').pipe(fs.createWriteStream(`${dest_32}/icon.png`)); + fs.createReadStream('resources/icon.png').pipe(fs.createWriteStream(`${dest_64}/icon.png`)); + fs.createReadStream('resources/linux/create_desktop_file.sh') + .pipe(fs.createWriteStream(`${dest_32}/create_desktop_file.sh`)) + .on('finish', () => { + fs.chmodSync(`${dest_32}/create_desktop_file.sh`, '755'); + }); + fs.createReadStream('resources/linux/create_desktop_file.sh') + .pipe(fs.createWriteStream(`${dest_64}/create_desktop_file.sh`)) + .on('finish', () => { + fs.chmodSync(`${dest_64}/create_desktop_file.sh`, '755'); + }); + setTimeout(() => { + callback(); + }, 1000); // should wait all pipes + } + else { + callback(); + } } }); }; diff --git a/package.json b/package.json index f6499410..f77946ea 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "package": "gulp package", "package:windows": "gulp package:windows", "package:osx": "gulp package:osx", - "package:linux": "gulp build && build --platform linux --arch all", + "package:linux": "gulp build && build --platform linux --arch all && npm run linux-additions", + "linux-additions": "cp resources/icon.png resources/linux/create_desktop_file.sh release/linux/ && cp resources/icon.png resources/linux/create_desktop_file.sh release/linux-ia32/", "package:all": "gulp package:all", "prettify": "gulp prettify", "installer": "node ./script/installer.js" diff --git a/resources/linux/create_desktop_file.sh b/resources/linux/create_desktop_file.sh new file mode 100755 index 00000000..3eb06b7d --- /dev/null +++ b/resources/linux/create_desktop_file.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e +WORKING_DIR=`pwd` +THIS_PATH=`readlink -f $0` +cd `dirname ${THIS_PATH}` +FULL_PATH=`pwd` +cd ${WORKING_DIR} +cat < Mattermost.desktop +[Desktop Entry] +Name=Mattermost +Comment=Mattermost Desktop application for Linux +Exec="${FULL_PATH}/Mattermost" +Terminal=false +Type=Application +Icon=${FULL_PATH}/icon.png +EOS +chmod +x Mattermost.desktop