Add script to create .desktop file for Linux

For #208
This commit is contained in:
Yuya Ochiai 2016-08-25 00:20:07 +09:00
parent a0453b5865
commit f2284fddb4
5 changed files with 45 additions and 3 deletions

View file

@ -29,6 +29,7 @@ Release date: TBD
- Added an option to make the taskbar icon flash on new messages - Added an option to make the taskbar icon flash on new messages
- Added the badge to count mentions for Unity. - Added the badge to count mentions for Unity.
- An existing application instance will be reused instead of starting another instance. - An existing application instance will be reused instead of starting another instance.
- Added a script to create `Mattermost.desktop` desktop entry file.
### Bug Fixes ### Bug Fixes
- Fixed an issue where the maximized state of the app window was lost in some cases. - Fixed an issue where the maximized state of the app window was lost in some cases.

View file

@ -67,7 +67,9 @@ For Ubuntu 16.04.
2. Extract the archive, then execute `Mattermost` which is located at inside of the extracted directory 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 ## Configuration
You have to configure the application to interact with your teams. You have to configure the application to interact with your teams.

View file

@ -224,7 +224,28 @@ function makePackage(platform, arch, callback) {
callback(err); callback(err);
} }
else { else {
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(); callback();
}, 1000); // should wait all pipes
}
else {
callback();
}
} }
}); });
}; };

View file

@ -23,7 +23,8 @@
"package": "gulp package", "package": "gulp package",
"package:windows": "gulp package:windows", "package:windows": "gulp package:windows",
"package:osx": "gulp package:osx", "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", "package:all": "gulp package:all",
"prettify": "gulp prettify", "prettify": "gulp prettify",
"installer": "node ./script/installer.js" "installer": "node ./script/installer.js"

View file

@ -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 <<EOS > 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