Skip to content

Commit

Permalink
Added support for Windows and Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
dcrousso committed Aug 21, 2016
1 parent 0f51e77 commit 39c8246
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 10 deletions.
Binary file added assets/Icon.ico
Binary file not shown.
Binary file modified assets/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ if (isAlreadyRunning)
electron.app.quit();

electron.ipcMain.on("count-badges-result", (event, data) => {
electron.app.dock.setBadge(data ? data.toString() : "");
if (typeof electron.app.setBadgeCount === "function")
electron.app.setBadgeCount(isNaN(data) ? 0 : data);
});

function createMainWindow() {
Expand Down Expand Up @@ -52,15 +53,19 @@ function createMainWindow() {
if (!title.includes("New message"))
return;

event.sender.send("count-badges");
browser.webContents.send("count-badges");
});

browser.on("close", event => {
if (isQuitting)
return;

event.preventDefault();
electron.app.hide();

if (process.platform === "darwin")
electron.app.hide();
else
electron.app.quit();
});

browser.loadURL("https://web.groupme.com/signin", {userAgent: ""});
Expand Down
2 changes: 1 addition & 1 deletion modules/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function sendAction(action) {

module.exports = electron.Menu.buildFromTemplate([
{
label: electron.app.getName(),
label: process.platform === "darwin" ? electron.app.getName() : "File",
submenu: [
{
role: "about"
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "GroupMe",
"productName": "GroupMe",
"version": "1.0.4",
"version": "1.1.0",
"description": "Unofficial GroupMe App",
"scripts": {
"start": "electron .",
"pack": "rm -rf ./dist/ && electron-packager . --overwrite --asar --out=dist --ignore=\"^/dist$\" --ignore=\"^/media$\" --prune --platform=darwin --arch=x64 --icon=assets/Icon.icns --app-bundle-id=com.dcrousso.GroupMe --app-version=$npm_package_version"
"build": "npm run build-darwin && npm run build-win32 && npm run build-linux",
"build-darwin": "electron-packager --platform=darwin --arch=x64 --icon=assets/Icon.icns --app-bundle-id=com.dcrousso.GroupMe --app-version=$npm_package_version --overwrite --asar --out=dist --ignore=\"^/dist$\" --ignore=\"^/media$\" --prune .",
"build-win32": "electron-packager --platform=win32 --arch=ia32 --icon=assets/Icon.ico --app-bundle-id=com.dcrousso.GroupMe --app-version=$npm_package_version --overwrite --asar --out=dist --ignore=\"^/dist$\" --ignore=\"^/media$\" --prune .",
"build-linux": "electron-packager --platform=linux --arch=x64 --icon=assets/Icon.icns --version-string.ProductName=$npm_package_productName --app-version=$npm_package_version --overwrite --asar --out=dist --ignore=\"^/dist$\" --ignore=\"^/media$\" --prune ."
},
"repository": {
"type": "git",
Expand All @@ -28,8 +31,8 @@
},
"homepage": "https://github.com/dcrousso/GroupMe#readme",
"devDependencies": {
"electron-packager": "^7.0.0",
"electron-prebuilt": "^1.1.1"
"electron": "^1.3.3",
"electron-packager": "^7.7.0"
},
"dependencies": {
"electron-debug": "^1.0.0",
Expand Down
31 changes: 29 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@

[Current Release](https://github.com/dcrousso/GroupMe/releases/latest)

#### Linux Shortcut

Create a file in `~/.local/share/applications/` called `GroupMe.desktop` with the following contents:

```
[Desktop Entry]
Name=GroupMe
Exec=/path/to/GroupMe
Terminal=false
Type=Application
Icon=/path/to/GroupMe/resources/app/assets/Icon.png
```

Replace all instances of `/path/to` with the actual path of the GroupMe app.

## Development

> Made with [Electron](http://electron.atom.io).
Expand All @@ -22,8 +37,20 @@
<td><code>npm start</code></td>
</tr>
<tr>
<td>Pack</td>
<td><code>npm run pack</code></td>
<td>Build</td>
<td><code>npm run build</code></td>
</tr>
<tr>
<td>Build macOS</td>
<td><code>npm run build-darwin</code></td>
</tr>
<tr>
<td>Build Windows</td>
<td><code>npm run build-win32</code></td>
</tr>
<tr>
<td>Build Linux</td>
<td><code>npm run build-linux</code></td>
</tr>
</table>

Expand Down

0 comments on commit 39c8246

Please sign in to comment.