Giter Site home page Giter Site logo

kylecorry31 / gnome-shell-extension-do-not-disturb Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 5.0 1.45 MB

Enable or disable do not disturb mode on Pop!_OS

License: MIT License

JavaScript 96.74% Makefile 2.57% CSS 0.69%
do-not-disturb notifications linux gnome pop-os extension gnome-shell-extension quiet distraction-free

gnome-shell-extension-do-not-disturb's Introduction

gnome-shell-extension-do-not-disturb's People

Contributors

artyomzorin avatar kylecorry31 avatar mikebarkmin avatar r4dixx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gnome-shell-extension-do-not-disturb's Issues

UX thoughts upon looking at the extension in Pop!_OS 18.04

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.

Children of this._iconBox are trying to be destroyed after destroying this._iconBox

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

Do not disturb turns OFF after resume from sleep

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.

Broken in Shell 3.30.1

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

Not working on up-to-date Fedora 29 running GNOME 3.30.2

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

DND consistency across reboots

If DND is left on when rebooting, upon logging in the DND toggle is inverted.
The DND bell is still displayed when DND is enabled but the toggle says that DND is off at that time. Note that the toggle is incorrect here, not the display of the bell.
screenshot from 2018-04-02 12-29-03
screenshot from 2018-04-02 12-29-06

clutter_actor_remove_child assertion fails when removing this._iconBox from this._indicatorArea

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

Add tests

Not sure exactly what will be tested, but jasmine gjs will help with testing:

Ideas

  • Test that calling setDoNotDisturb enables/disables the Busy Presence API etc

Lots of toggles in the notifications area

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.

Other Notes:
image

Error window instead of settings window in GNOME Tweaks

Error: Requiring Clutter, version none: Typelib file for namespace 'Clutter' (any version) not found

Stack trace:
@/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
@

:1:43

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:
@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
@

:1:43

dot next to date: false positive

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

Support gsettings API

  • A gsettings API to enable or disable DND would be useful as other apps could tap into this extension to provide their users a distraction free (well, reduced) work environment.

Setting the clear button height results in error messages due to it not being on the stage

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

Doesn't deactivate properly?

From hunny-1 on GNOME Shell Extensions:

"If I deactivate then reactivate I get two copies in the notification area."

Enable during certain set times of day (Quiet hours)

User stories

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.

User story conversations

  • Allow user to specify if they want DND to turn on automatically
  • Allow user to specify the start and end time they want DND to turn on
  • If the user disables DND during quiet hours, do not reactivate automatically until the next day
  • If the user enables DND before quiet hours, do not deactivate automatically at the end of the quiet hours

Scenarios

  1. User has DND disabled -> quiet hours start -> DND activated -> quiet hours end -> DND deactivated (repeat until user enables DND)
  2. User enabled DND -> quiet hours start -> DND already activated -> quiet hours end -> DND still activated (repeat until user disables DND)
  3. User has DND disabled -> quiet hours start -> DND activated -> user disables DND -> quiet hours end -> DND still disabled (go to 1)
  4. User has DND disabled -> quiet hours start -> DND activated -> user disables DND -> user enables DND -> quiet hours end -> DND still enabled (go to 2)

Add more translations

Add a .po file at /locale/{language code}/LC_MESSAGES/gnome-shell-extension-do-not-disturb.po with the translations.

Translations needed for:

  • Do not disturb label
  • Settings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.