kylecorry31 / gnome-shell-extension-do-not-disturb Goto Github PK
View Code? Open in Web Editor NEWEnable or disable do not disturb mode on Pop!_OS
License: MIT License
Enable or disable do not disturb mode on Pop!_OS
License: MIT License
When the show notifications setting is modified in settings, the toggle should reflect that
Noticed that I get that white circle notification next to the time whenever a notification is received that wasn't displayed as a popup notification (it shows up when DND is off and I get a handful of notifications all at once or immediately if DND is on).
I was thinking if it's possible, we would probably like to hide that dot when DND is enabled(otherwise you're still getting a notification).
Also thinking that the DND icon (slashed-out bell), makes more sense, if possible, in place of that white dot notification next to the clock since it is directly associated with notifications. Also because all of the icons on the right side have associated actions that can be done in that corner (where as the DND switch is in the notification menu). If the above is possible, I think enabling the icon by default would be desired.
Option to change the label "Do not disturb"
The destroy function in the widgets.js file attempts to destroy the children of this._iconBox (this._countLbl and this._iconBox) after destroying this._iconBox, which wouldn't be possible. This results in the following error messages:
(gnome-shell:24861): Gjs-CRITICAL **: 17:04:00.378: Object St.Label (0x55a0f7fa1c60), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
== Stack trace for context 0x55a0f604a1e0 ==
#0 55a0f7f15f70 i /home/username/.local/share/gnome-shell/extensions/[email protected]/widgets.js:204 (7fc23173c0d0 @ 97)
#1 55a0f7f15ee0 i /home/username/.local/share/gnome-shell/extensions/[email protected]/extension.js:50 (7fc231708ca0 @ 77)
#2 55a0f7f15e20 i resource:///org/gnome/shell/ui/extensionSystem.js:83 (7fc26455a0d0 @ 436)
#3 55a0f7f15da0 i resource:///org/gnome/shell/ui/extensionSystem.js:297 (7fc26455a790 @ 13)
#4 7ffe3a19e8e0 b self-hosted:261 (7fc2648c1dc0 @ 223)
#5 55a0f7f15d20 i resource:///org/gnome/shell/ui/extensionSystem.js:294 (7fc26455a550 @ 113)
(gnome-shell:24861): Clutter-CRITICAL **: 17:04:00.378: clutter_actor_destroy: assertion 'CLUTTER_IS_ACTOR (self)' failed
== Stack trace for context 0x55a0f604a1e0 ==
#0 55a0f7f15f70 i /home/username/.local/share/gnome-shell/extensions/[email protected]/widgets.js:204 (7fc23173c0d0 @ 97)
#1 55a0f7f15ee0 i /home/username/.local/share/gnome-shell/extensions/[email protected]/extension.js:50 (7fc231708ca0 @ 77)
#2 55a0f7f15e20 i resource:///org/gnome/shell/ui/extensionSystem.js:83 (7fc26455a0d0 @ 436)
#3 55a0f7f15da0 i resource:///org/gnome/shell/ui/extensionSystem.js:297 (7fc26455a790 @ 13)
#4 7ffe3a19e8e0 b self-hosted:261 (7fc2648c1dc0 @ 223)
#5 55a0f7f15d20 i resource:///org/gnome/shell/ui/extensionSystem.js:294 (7fc26455a550 @ 113)
(gnome-shell:24861): Gjs-CRITICAL **: 17:04:00.378: Object St.Icon (0x55a0f80d5d90), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
== Stack trace for context 0x55a0f604a1e0 ==
#0 55a0f7f15f70 i /home/username/.local/share/gnome-shell/extensions/[email protected]/widgets.js:206 (7fc23173c0d0 @ 128)
#1 55a0f7f15ee0 i /home/username/.local/share/gnome-shell/extensions/[email protected]/extension.js:50 (7fc231708ca0 @ 77)
#2 55a0f7f15e20 i resource:///org/gnome/shell/ui/extensionSystem.js:83 (7fc26455a0d0 @ 436)
#3 55a0f7f15da0 i resource:///org/gnome/shell/ui/extensionSystem.js:297 (7fc26455a790 @ 13)
#4 7ffe3a19e8e0 b self-hosted:261 (7fc2648c1dc0 @ 223)
#5 55a0f7f15d20 i resource:///org/gnome/shell/ui/extensionSystem.js:294 (7fc26455a550 @ 113)
(gnome-shell:24861): Clutter-CRITICAL **: 17:04:00.379: clutter_actor_destroy: assertion 'CLUTTER_IS_ACTOR (self)' failed
== Stack trace for context 0x55a0f604a1e0 ==
#0 55a0f7f15f70 i /home/username/.local/share/gnome-shell/extensions/[email protected]/widgets.js:206 (7fc23173c0d0 @ 128)
#1 55a0f7f15ee0 i /home/username/.local/share/gnome-shell/extensions/[email protected]/extension.js:50 (7fc231708ca0 @ 77)
#2 55a0f7f15e20 i resource:///org/gnome/shell/ui/extensionSystem.js:83 (7fc26455a0d0 @ 436)
#3 55a0f7f15da0 i resource:///org/gnome/shell/ui/extensionSystem.js:297 (7fc26455a790 @ 13)
#4 7ffe3a19e8e0 b self-hosted:261 (7fc2648c1dc0 @ 223)
#5 55a0f7f15d20 i resource:///org/gnome/shell/ui/extensionSystem.js:294 (7fc26455a550 @ 113)
These messages appear when running "gnome-shell --replace" in the Terminal. I am using Gnome Shell 3.30
Distribution (run cat /etc/os-release
):
I am on Pop_OS! 18.10
NAME="Ubuntu"
VERSION="18.10 (Cosmic Cuttlefish)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.10"
VERSION_ID="18.10"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=cosmic
UBUNTU_CODENAME=cosmic
Do not disturb settings (run gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]/schemas list-recursively org.gnome.shell.extensions.kylecorry31-do-not-disturb
):
GLib-GIO-Message: 15:24:02.065: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications.
org.gnome.shell.extensions.kylecorry31-do-not-disturb do-not-disturb false
org.gnome.shell.extensions.kylecorry31-do-not-disturb mute-sounds false
org.gnome.shell.extensions.kylecorry31-do-not-disturb show-count true
org.gnome.shell.extensions.kylecorry31-do-not-disturb show-dot false
org.gnome.shell.extensions.kylecorry31-do-not-disturb show-icon true
Log output (journalctl -b | grep donotdisturb@kylecorry31
)
Issue/Bug Description:
"Do not disturb" turns itself off after resume from sleep
Steps to reproduce (if you know):
Turn "Do not disturb" ON. Put computer to sleep. Wake it up -> "Do not disturb" is OFF
Expected behavior:
Stay ON until manually switched off since opening the notification panel to turn it ON is distracting enough with all the suppressed old notifications.
Updated to Ubuntu 18.10 with GNOME 3.30.1 and this appears to no longer work, I can try to find a log soon
Installed from git and it is the extension shows an error state in gnome-tweaks. Here are the logs from journalctl |grep kylecorry
:
Dec 05 17:10:19 hostname org.gnome.Shell.desktop[2167]: extracting: /home/tony/.local/share/gnome-shell/extensions/[email protected]/metadata.json
Dec 05 17:10:20 hostname gnome-software[2426]: State change on user/*/*/shell-extension/donotdisturb_kylecorry31.github.io/* from available to installed is not OK
Dec 05 17:10:51 hostname gnome-shell[2167]: Extension "[email protected]" had error: TypeError: Main.panel._centerBox.get_child_at_index(...) is null
Dec 05 20:07:00 hostname gnome-shell[2168]: Extension "[email protected]" had error: TypeError: Main.panel._centerBox.get_child_at_index(...) is null
Dec 05 20:10:35 hostname gnome-shell[2168]: Extension "[email protected]" had error: TypeError: Main.panel._centerBox.get_child_at_index(...) is null
To make it easier for people to install this, it'd be great if it were on https://extensions.gnome.org/.
Thanks! :)
Developer fixing.
The parent of this._iconBox may not always exist when attempting to run the code to remove it from this._indicatorArea, resulting in this error message when switching on Do Not Disturb mode and when disabling the extension:
clutter_actor_remove_child: assertion 'child->priv->parent != NULL' failed
This message appears when running "gnome-shell --replace" in the Terminal. I am using Gnome Shell 3.30
Text should be on the right of the toggle instead of the left
It currently appears at the bottom of the date panel, need to make it appear next to the clear button, seen here: pop-os/pop#151
Not sure exactly what will be tested, but jasmine gjs will help with testing:
Ideas
Distribution (run cat /etc/os-release
):
NAME="Pop!_OS"
VERSION="18.10"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Pop!_OS 18.10"
VERSION_ID="18.10"
HOME_URL="https://system76.com/pop"
SUPPORT_URL="http://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=cosmic
UBUNTU_CODENAME=cosmic
Do not disturb settings (run gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]/schemas list-recursively org.gnome.shell.extensions.kylecorry31-do-not-disturb
):
org.gnome.shell.extensions.kylecorry31-do-not-disturb do-not-disturb false
org.gnome.shell.extensions.kylecorry31-do-not-disturb mute-sounds false
org.gnome.shell.extensions.kylecorry31-do-not-disturb show-count true
org.gnome.shell.extensions.kylecorry31-do-not-disturb show-dot false
org.gnome.shell.extensions.kylecorry31-do-not-disturb show-icon true
Log output (journalctl -b | grep donotdisturb@kylecorry31
)
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/dnd-symbolic.svg
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/system.js
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: creating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/locale/es/LC_MESSAGES/
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/locale/es/LC_MESSAGES/gnome-shell-extension-do-not-disturb.po
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/locale/fr/LC_MESSAGES/gnome-shell-extension-do-not-disturb.mo
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/schemas/gschemas.compiled
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/locale/pt/LC_MESSAGES/gnome-shell-extension-do-not-disturb.po
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/settings.js
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/doNotDisturb.js
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/locale/pt/LC_MESSAGES/gnome-shell-extension-do-not-disturb.mo
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/extension.js
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/prefs.js
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/schemas/org.gnome.shell.extensions.kylecorry31-do-not-disturb.gschema.xml
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/stylesheet.css
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/locale/es/LC_MESSAGES/gnome-shell-extension-do-not-disturb.mo
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/dndExtension.js
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/locale/fr/LC_MESSAGES/gnome-shell-extension-do-not-disturb.po
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/lib.js
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: inflating: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/widgets.js
Apr 15 17:44:27 caelum org.gnome.Shell.desktop[2503]: extracting: /home/echosa/.local/share/gnome-shell/extensions/[email protected]/metadata.json
Apr 16 10:30:11 caelum gnome-shell-ext[1318]: JS LOG: Extension [email protected] already installed in /home/echosa/.local/share/gnome-shell/extensions/[email protected]. /usr/share/gnome-shell/extensions/[email protected] will not be loaded
Issue/Bug Description:
See screenshot below. I have lots of Do Not Disturb toggles in my notification area.
Steps to reproduce (if you know):
I'm not sure.
Expected behavior:
A single toggle, like before.
It doesn't look as nice as the one referenced here: pop-os/pop#151
Error: Requiring Clutter, version none: Typelib file for namespace 'Clutter' (any version) not found
Stack trace:
:1:43
@/home/ramuyko/.local/share/gnome-shell/extensions/[email protected]/utils.js:17:7
@/home/ramuyko/.local/share/gnome-shell/extensions/[email protected]/prefs.js:26:7
_getExtensionPrefsModule@resource:///org/gnome/shell/extensionPrefs/main.js:75:13
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_selectExtension@resource:///org/gnome/shell/extensionPrefs/main.js:90:31
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_onCommandLine@resource:///org/gnome/shell/extensionPrefs/main.js:243:17
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
main@resource:///org/gnome/shell/extensionPrefs/main.js:397:5
@
Updated the extension (autoupdate was turned off), but the problem remained.
Found an advice to do sudo apt-get install gir1.2-clutter-1.0 gir1.2-clutter-gst-3.0 gir1.2-gtkclutter-1.0
. Result:
Error: Requiring Shell, version none: Requiring namespace 'Clutter' version '2', but '1.0' is already loaded
Stack trace:
:1:43
@resource:///org/gnome/shell/misc/util.js:10:7
@/home/biasedagent/.local/share/gnome-shell/extensions/[email protected]/settings.js:5:7
@/home/biasedagent/.local/share/gnome-shell/extensions/[email protected]/prefs.js:8:7
_getExtensionPrefsModule@resource:///org/gnome/shell/extensionPrefs/main.js:75:13
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_selectExtension@resource:///org/gnome/shell/extensionPrefs/main.js:90:31
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
_onCommandLine@resource:///org/gnome/shell/extensionPrefs/main.js:243:17
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22
main@resource:///org/gnome/shell/extensionPrefs/main.js:397:5
@
It seems that almost randomly, the dot is appearing/disappearing at 5-15 minute intervals. When the dot does appear, it disappears almost immediately. I've clicked the clock to view notifications a few times, but have never noticed a notification appearing/disappearing that would trigger this behavior.
I've also turned off do not disturb mode (while the extension was still enabled), and there were no notifications being received that were maybe only appearing briefly.
On Fedora 29, GNOME 3.30.1
When the extension is being enabled at startup or upon refreshing Gnome Shell the date menu popup wouldn't have appeared yet, so the Clear button is not on the stage. Because of this, the code to change the height of the clear button results in these error messages.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.650: st_widget_get_theme_node called on the widget [0x55a0f7e5e050 StBoxLayout ("Do not disturb")] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.650: st_widget_get_theme_node called on the widget [0x55a0f7e64420 StBoxLayout.popup-menu-item do-not-disturb:last-child first-child ("Do not disturb")] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.650: st_widget_get_theme_node called on the widget [0x55a0f7e5e050 StBoxLayout ("Do not disturb")] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.651: st_widget_get_theme_node called on the widget [0x55a0f7e64420 StBoxLayout.popup-menu-item do-not-disturb:last-child first-child ("Do not disturb")] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.651: st_widget_get_theme_node called on the widget [0x55a0f7ff3ad0 StBin:first-child] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.651: st_widget_get_theme_node called on the widget [0x55a0f7e5e050 StBoxLayout ("Do not disturb")] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.651: st_widget_get_theme_node called on the widget [0x55a0f7e64420 StBoxLayout.popup-menu-item do-not-disturb:last-child first-child ("Do not disturb")] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.651: st_widget_get_theme_node called on the widget [0x55a0f7ff3ad0 StBin:first-child] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.651: st_widget_get_theme_node called on the widget [0x55a0f80510f0 StBin.toggle-switch toggle-switch-us:last-child first-child] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.651: st_widget_get_theme_node called on the widget [0x55a0f7e5e050 StBoxLayout ("Do not disturb")] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.651: st_widget_get_theme_node called on the widget [0x55a0f7e64420 StBoxLayout.popup-menu-item do-not-disturb:last-child first-child ("Do not disturb")] which is not in the stage.
(gnome-shell:24861): St-CRITICAL **: 17:01:43.651: st_widget_get_theme_node called on the widget [0x55a0f7ec5240 StLabel:last-child ("Do not disturb")] which is not in the stage.
These messages appear when running "gnome-shell --replace" in the Terminal. I am using Gnome Shell 3.30
Adding a notification indicator or a count of unread notifications would be a useful feature.
From hunny-1 on GNOME Shell Extensions:
"If I deactivate then reactivate I get two copies in the notification area."
center the label according to the button
As a worker, I would like DND to activate during work so I don't get distracted by notifications.
As a student, I would like DND to activate during school hours so I can take notes in class without distractions.
Add a .po file at /locale/{language code}/LC_MESSAGES/gnome-shell-extension-do-not-disturb.po with the translations.
Translations needed for:
after activating the extension the clean notifications button was next to the separator line
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.