Skip to content

Commit

Permalink
Add start in tray cli option
Browse files Browse the repository at this point in the history
Deezer desktop can be started minimized using the `--start-in-tray` flag.

SibrenVasse#12
  • Loading branch information
siphomateke committed Sep 27, 2021
1 parent 5315b0a commit 7612b5a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ This package applies several patches for:
- Compatibility with a Linux environment in general.
- Fixing bugs

## Options

You can start Deezer minimized on the tray using the `--start-in-tray` flag;

```bash
deezer --start-in-tray
```

## Building

To install on Ubuntu:
Expand Down
2 changes: 2 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ prepare() {
prettier --write "build/*.js"
# Hide to tray (https://github.com/SibrenVasse/deezer/issues/4)
patch -p1 < "$srcdir/quit.patch"
# Add start in tray cli option (https://github.com/SibrenVasse/deezer/pull/12)
patch --forward --strip=1 --input="$srcdir/start-hidden-on-tray.patch"

cd ..
asar pack app app.asar
Expand Down
19 changes: 19 additions & 0 deletions start-hidden-on-tray.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/build/main.js b/build/main.js
index 5066eef..592a6bc 100644
--- a/build/main.js
+++ b/build/main.js
@@ -3122,8 +3122,12 @@
finalMinSize[1]
);
}
- isDev() ? this.window.showInactive() : this.window.show(),
- this.thumbar.init();
+ if (!process.argv.some(arg => arg === '--start-in-tray')) {
+ isDev() ? this.window.showInactive() : this.window.show(),
+ this.thumbar.init();
+ } else {
+ this.window.hide();
+ }
}),
this.appService.enableDevMode();
}

0 comments on commit 7612b5a

Please sign in to comment.