Skip to content

Commit

Permalink
Merge pull request #3 from ressonix/siphomateke-mpris
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
FoggyMtnDrifter authored Sep 28, 2021
2 parents fc5af85 + ce14ba5 commit 0f16904
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 185 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Deezer Desktop sources
locales/
resources/
npm_temp/
*.pak
*.exe
*.dll
*.dat
*.bin
*.7z
LICENSE.electron.txt
vk_swiftshader_icd.json
LICENSES.chromium.html
139 changes: 0 additions & 139 deletions 0001-MPRIS-interface.patch

This file was deleted.

28 changes: 28 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 Solus:
Expand All @@ -25,6 +33,26 @@ chmod +x ./install.sh

The Deezer Windows installer will then be downloaded, extracted and patched to work for Linux. When prompted for your sudo password, please enter it.

## Uninstalling

You can uninstall Deezer by running `uninstall.sh`:

```bash
chmod +x ./uninstall.sh
./uninstall.sh
```

## Updating

```bash
# Open the folder where you cloned this repo
cd deezer
# Pull the latest version
git pull
chmod +x ./install.sh
./install.sh
```

## Debugging

Running the application from the command line will show verbose logging.
Expand Down
1 change: 0 additions & 1 deletion deezer
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#!/bin/sh
export DZ_DISABLE_UPDATE="yes"
exec electron /usr/share/deezer/app.asar "$@"
18 changes: 8 additions & 10 deletions install.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

# Maintainer: Michael Kinder <[email protected]>
pkgname="deezer"
pkgver=4.32.20
pkgver=5.30.70
srcdir="$PWD"

install_dependencies() {
sudo eopkg -y install p7zip imagemagick nodejs wget patch
sudo npm install -g electron@^6 --unsafe-perm=true
sudo eopkg -y install p7zip imagemagick nodejs wget g++ make patch
sudo npm install -g electron@^13= --unsafe-perm=true
sudo npm install -g --engine-strict asar
sudo npm install -g prettier
}
Expand All @@ -28,7 +28,6 @@ prepare() {
asar extract app.asar app

mkdir -p app/resources/linux/
cp win/systray.png app/resources/linux/systray.png

# Remove NodeRT from package (-205.72 MiB)
rm -r app/node_modules/@nodert
Expand All @@ -45,15 +44,14 @@ prepare() {
done

cd "$srcdir/resources/app"
mkdir -p resources/linux/
install -Dm644 "$srcdir/resources/win/systray.png" resources/linux/

prettier --write "build/*.js"
# Disable menu bar
patch -p1 < "$srcdir/menu-bar.patch"
# Hide to tray (https://github.com/SibrenVasse/deezer/issues/4)
patch -p1 < "$srcdir/quit.patch"

# Monkeypatch MPRIS D-Bus interface
patch -p1 < "$srcdir/0001-MPRIS-interface.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 All @@ -64,7 +62,7 @@ package() {
sudo mkdir -p "$pkgdir"/usr/share/deezer
sudo mkdir -p "$pkgdir"/usr/share/applications
sudo mkdir -p "$pkgdir"/usr/bin/
for size in 16 32 48 64 128 256 512; do
for size in 16 32 48 64 128 256; do
sudo mkdir -p "$pkgdir"/usr/share/icons/hicolor/${size}x${size}/apps/
done

Expand Down
13 changes: 0 additions & 13 deletions menu-bar.patch

This file was deleted.

40 changes: 18 additions & 22 deletions quit.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
diff --git a/build/main.js b/build/main.js
index 6934bbd..a150316 100644
index 5066eef..d05dda2 100644
--- a/build/main.js
+++ b/build/main.js
@@ -3123,7 +3123,7 @@ module.exports = (function(modules) {
};
@@ -503,7 +503,7 @@
}
getQuitOptions() {
- return { label: i18n.t("menu_quit-deezer_label"), role: "quit" };
+ return { label: i18n.t("menu_quit-deezer_label"), click: () => { external_electron_.app.isQuiting = true; external_electron_.app.quit(); } };
}
getReloadOptions() {
return {
@@ -4714,6 +4714,12 @@ module.exports = (function(modules) {
this.window.on("resize", () => {
this.windowState.save();
}),
+ this.window.on('close', function(event) {
+ if(!external_electron_.app.isQuiting){
+ event.preventDefault();
+ this.hide();
+ }
+ }),
this.window.once("ready-to-show", () => {
if (windowState.isMaximized) this.window.maximize();
else if (isPlatform(PLATFORM_WINDOWS)) {
closeWindow() {
if (this.getWindow())
- return isPlatform(PLATFORM.DARWIN)
+ return isPlatform(PLATFORM.DARWIN) || isPlatform(PLATFORM.LINUX)
? (this.getWindow().isFullScreen() &&
this.getWindow().setFullScreen(!1),
this.getWindow().hide())
@@ -3079,7 +3079,7 @@
this._adjustViewToContentSize(),
mainView.setAutoResize({ width: !0, height: !0 });
} else this.appService.setWindow(this.window, void 0);
- if ((this.appService.setUserAgent(), isPlatform(PLATFORM.DARWIN))) {
+ if ((this.appService.setUserAgent(), isPlatform(PLATFORM.DARWIN) || isPlatform(PLATFORM.LINUX))) {
let isQuitting = !1;
external_electron_namespaceObject.app.on(
"before-quit",
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();
}
17 changes: 17 additions & 0 deletions uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

printf "\nPlease enter your root password to proceed.\n"
sudo true

printf "\nUninstalling Deezer... "
sudo rm -rf /usr/share/deezer &> /dev/null || true
sudo rm /usr/share/applications/deezer.desktop &> /dev/null || true
sudo rm /usr/bin/deezer &> /dev/null || true

for size in 16 32 48 64 128 256; do
sudo rm /usr/share/icons/hicolor/${size}x${size}/apps/deezer.png &> /dev/null || true
done

sudo update-desktop-database --quiet

printf "OK.\nDeezer has been uninstalled.\n\n"

0 comments on commit 0f16904

Please sign in to comment.