Do not reveal panel on notifications if "do not disturb" is enabled

This commit is contained in:
Charles Gagnon
2025-02-26 16:48:42 -05:00
parent c798be297b
commit 6a0fbbe12a
3 changed files with 8 additions and 3 deletions

View File

@@ -42,6 +42,7 @@ export let DTP_EXTENSION = null
export let SETTINGS = null
export let DESKTOPSETTINGS = null
export let TERMINALSETTINGS = null
export let NOTIFICATIONSSETTINGS = null
export let PERSISTENTSTORAGE = null
export let EXTENSION_PATH = null
@@ -64,6 +65,9 @@ export default class DashToPanelExtension extends Extension {
TERMINALSETTINGS = new Gio.Settings({
schema_id: 'org.gnome.desktop.default-applications.terminal',
})
NOTIFICATIONSSETTINGS = new Gio.Settings({
schema_id: 'org.gnome.desktop.notifications',
})
EXTENSION_PATH = this.path
//create a global object that can emit signals and conveniently expose functionalities to other extensions

View File

@@ -28,7 +28,7 @@ import * as PointerWatcher from 'resource:///org/gnome/shell/ui/pointerWatcher.j
import * as Proximity from './proximity.js'
import * as Utils from './utils.js'
import { SETTINGS } from './extension.js'
import { SETTINGS, NOTIFICATIONSSETTINGS } from './extension.js'
//timeout intervals
const CHECK_POINTER_MS = 200
@@ -165,7 +165,8 @@ export const Intellihide = class {
if (
!this.enabled ||
(holdStatus == Hold.NOTIFY &&
!SETTINGS.get_boolean('intellihide-show-on-notification'))
(!SETTINGS.get_boolean('intellihide-show-on-notification') ||
!NOTIFICATIONSSETTINGS.get_boolean('show-banners')))
)
return

View File

@@ -159,7 +159,7 @@
</child>
<child>
<object class="AdwActionRow">
<property name="subtitle">(requires show notification counter badge option)</property>
<property name="subtitle">(respects Gnome "Do Not Disturb" and requires show notification counter badge option)</property>
<property name="title" translatable="yes">Reveal and hold the panel on notification</property>
<child>
<object class="GtkSwitch" id="intellihide_show_on_notification_switch">