Do Not Disturb - active hours

We need to be able to set “do not disturb” hours in Settings rather than triggering it manually every day/night.

6 Likes

You can solve it by using ‘Situations’ app (it’s available on Jolla Store) and ‘Do not disturb’ feature.

3 Likes

Or from cli, script, cron job, systemd timer etc:

dconf write '/lipstick/do_not_disturb' 'true'
dconf write '/lipstick/do_not_disturb' 'false'

Example usage for systemd timer:

Create these files:

.config/systemd/user/dnd-activate.service

[Unit]
Description=Do-not-Disturb mode toggle

[Service]
Type=oneshot
ExecStart=/usr/bin/dconf write '/lipstick/do_not_disturb' 'true'

.config/systemd/user/dnd-activate.timer

[Unit]
Description=Do-not-Disturb mode Activation

[Timer]
OnCalendar=Mon..Fri 19:00
OnCalendar=Sat,Sun 23:30
Persistent=true

[Install]
WantedBy=timers.target

.config/systemd/user/dnd-deactivate.service

[Unit]
Description=Do-not-Disturb mode toggle

[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/usr/bin/dconf write '/lipstick/do_not_disturb' 'false'

.config/systemd/user/dnd-dectivate.timer

[Unit]
Description=Do-not-Disturb mode Deactivation

[Timer]
OnCalendar=Mon..Fri 07:00
OnCalendar=Sat,Sun 09:00
Persistent=true

[Install]
WantedBy=timers.target

Then enable and start them:

systemctl --user enable dnd-activate.timer
systemctl --user start dnd-activate.timer
systemctl --user enable dnd-deactivate.timer
systemctl --user start dnd-deactivate.timer
5 Likes

It sure can be done one way or another, but that is an enhancement request to be integrated into the base OS. There really is no need for workarounds for such a basic functionality.

2 Likes

It’s a good feature request for sure. Also relatively easy to do IMHO.

2 Likes

I know you are requesting a feature, I’ve only tried to help you until it is implemented on Sailfish OS, if some day it’s implemented.