Is there any way to set a keyboard shortcut to toggle do not disturb mode on/off?


Yes, you can. Disturb mode can be set via the dconf boolean value org.pantheon.desktop.gala.notifications.do-not-disturb.

You can toggle it with a script like this (saved as ~/bin/toggle_do-not-disturb)


dconf write $KEY $(if [ $(dconf read $KEY) = 'true' ]; then echo false; else echo true; fi)

Then you can assign this script to a custom hot key in Settings/Keyboard Layout tab:

enter image description here

  • This is very useful!
    – png2378
    Dec 15 '16 at 14:46
  • Thanks. :) This is also useful if you want to override the "Do not disturb" mode temporarily for a notification You can set the KEY false, send a notification and set it to true again.
    – Gaurav
    Apr 19 '18 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.