Merge pull request #151 from aunetx/feature/disable-notifications

feat(patch): disable notifications (w/ cli arg or env var)
This commit is contained in:
josselinonduty 2025-07-29 23:32:28 +02:00 committed by GitHub
commit d8676754fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 52 additions and 9 deletions

View File

@ -50,6 +50,7 @@ prepare: clean install_build_deps
@echo "10 - Improve responsiveness on small devices (https://github.com/aunetx/deezer-linux/pull/122)" @echo "10 - Improve responsiveness on small devices (https://github.com/aunetx/deezer-linux/pull/122)"
@echo "11 - Hide Application is offline banner (https://github.com/aunetx/deezer-linux/pull/124)" @echo "11 - Hide Application is offline banner (https://github.com/aunetx/deezer-linux/pull/124)"
@echo "12 - Disable animations (https://github.com/aunetx/deezer-linux/pull/133)" @echo "12 - Disable animations (https://github.com/aunetx/deezer-linux/pull/133)"
@echo "13 - Disable notifications (https://github.com/aunetx/deezer-linux/pull/151)"
@$(foreach p, $(wildcard ./patches/*), patch -p 1 -d $(APP_DIR) < $(p);) @$(foreach p, $(wildcard ./patches/*), patch -p 1 -d $(APP_DIR) < $(p);)

View File

@ -38,7 +38,7 @@ Other packages can be installed from you package manager, either by clicking on
## Usage ## Usage
| Option | Description | | Option | Description |
| ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | | ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `--start-in-tray` | Start the app in the tray (see [patch](./patches/01-start-hidden-in-tray.patch)) | | `--start-in-tray` | Start the app in the tray (see [patch](./patches/01-start-hidden-in-tray.patch)) |
| `--disable-systray` | Quit the app when the window is closed (see [patch](./patches/03-quit.patch)) | | `--disable-systray` | Quit the app when the window is closed (see [patch](./patches/03-quit.patch)) |
| `--keep-kernel` | Use the exact kernel version (see [patch](./patches/05-remove-os-information.patch)) <br/> _This feature impacts privacy._ | | `--keep-kernel` | Use the exact kernel version (see [patch](./patches/05-remove-os-information.patch)) <br/> _This feature impacts privacy._ |
@ -46,12 +46,14 @@ Other packages can be installed from you package manager, either by clicking on
| `--enable-discord-rpc` | Enable Discord RPC integration (see [patch](./patches/09-discord-rich-presence.patch)) | | `--enable-discord-rpc` | Enable Discord RPC integration (see [patch](./patches/09-discord-rich-presence.patch)) |
| `--hide-appoffline-banner` | Hide the "Application is offline" banner that appears when using a VPN or DNS blocker (see [patch](./patches/11-hide-appoffline-banner.patch)) | | `--hide-appoffline-banner` | Hide the "Application is offline" banner that appears when using a VPN or DNS blocker (see [patch](./patches/11-hide-appoffline-banner.patch)) |
| `--disable-animations` | Disable animations (see [patch](./patches/12-disable-animations.patch)) | | `--disable-animations` | Disable animations (see [patch](./patches/12-disable-animations.patch)) |
| `--disable-notifications` | Disable notifications (see [patch](./patches/13-disable-notifications.patch)) |
| `--enable-wayland-ime` `--ozone-platform-hint=auto` `--wayland-text-input-version=3` | Enable IME keyboard support on Wayland | | `--enable-wayland-ime` `--ozone-platform-hint=auto` `--wayland-text-input-version=3` | Enable IME keyboard support on Wayland |
| Environment variable | Options | Description | | Environment variable | Options | Description |
| --------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------ | | --------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| `DZ_HIDE_APPOFFLINE_BANNER` | `yes`,`no` | Hide the "Application is offline" banner (see [patch](./patches/11-hide-appoffline-banner.patch)) | | `DZ_HIDE_APPOFFLINE_BANNER` | `yes`,`no` | Hide the "Application is offline" banner (see [patch](./patches/11-hide-appoffline-banner.patch)) |
| `DZ_DISABLE_ANIMATIONS` | `yes`,`no` | Disable animations (see [patch](./patches/12-disable-animations.patch)) | | `DZ_DISABLE_ANIMATIONS` | `yes`,`no` | Disable animations (see [patch](./patches/12-disable-animations.patch)) |
| `DZ_DISABLE_NOTIFICATIONS` | `yes`,`no` | Disable notifications (see [patch](./patches/13-disable-notifications.patch)) |
| `LOG_LEVEL` | `silly`,`debug`,`verbose`,`info`,`warning`,`error` | Set the log level (see [patch](./patches/07-log-level-environment-variable.patch)) | | `LOG_LEVEL` | `silly`,`debug`,`verbose`,`info`,`warning`,`error` | Set the log level (see [patch](./patches/07-log-level-environment-variable.patch)) |
| `DZ_DEVTOOLS` | `yes`,`no` | Enable the developer console (ctrl+shift+i) | | `DZ_DEVTOOLS` | `yes`,`no` | Enable the developer console (ctrl+shift+i) |

View File

@ -0,0 +1,40 @@
From fead13c466b3f5fde6f6fdd62c77b22a070e8d97 Mon Sep 17 00:00:00 2001
From: josselinonduty <contact@josselinonduty.fr>
Date: Tue, 29 Jul 2025 10:46:31 +0200
Subject: [PATCH] feat(patch): disable notifications (w/ cli arg or env var)
---
build/main.js | 3 +++
build/preload.js | 2 ++
2 files changed, 5 insertions(+)
diff --git a/build/main.js b/build/main.js
index 5034587..315cab4 100644
--- a/build/main.js
+++ b/build/main.js
@@ -3259,6 +3259,9 @@
(process.argv.some((arg) => arg === "--disable-animations") ||
"yes" === process.env.DZ_DISABLE_ANIMATIONS) &&
"--disable-animations",
+ (process.argv.some((arg) => arg === "--disable-notifications") ||
+ "yes" === process.env.DZ_DISABLE_NOTIFICATIONS) &&
+ "--disable-notifications",
].filter(Boolean),
},
windowOptions = {
diff --git a/build/preload.js b/build/preload.js
index 0df9150..aa4bb78 100644
--- a/build/preload.js
+++ b/build/preload.js
@@ -546,6 +546,8 @@
document
.getElementsByTagName("body")[0]
.classList.add("disable-animations");
+ if (process.argv.some((arg) => arg === "--disable-notifications"))
+ delete window.Notification;
});
})(),
(module.exports = __webpack_exports__);
--
2.48.1