Workaround for the no-disturb problem

Last week I unfortunately got advertising SMS at night that triggered the librem5 alarm.
Some time before I already got unwanted telephone calls at night that also triggered the librem5 alarm.
And sometimes the librem5 alarm in the morning is either to low or to high, depending if I have played to much with the phone the day before.

So I have created a workaround for this problems and created the file
/etc/cron.d/no-disturb with the following content:

XDG_RUNTIME_DIR=/run/user/1000

# enable sound (80% volume) and vibra 1 minutes before alarm at 0630
29 06 * * * purism amixer -q set Master 80\% && gsettings set org.sigxcpu.feedbackd profile full

# disable sound and vibra at 22:00
00 22 * * * purism gsettings set org.sigxcpu.feedbackd profile silent

I hope this is helpful for someone else.
Please be a aware, that this workaround is not much tested until now, but I am confident,
that it will work.

You can test it with the command:
fbcli -t 10 -E alarm-clock-elapsed && read dummy

I also would like to know if somebody has another solution to be not disturbed at night.

5 Likes

Turn the phone off.

1 Like

but I want to use the phone to be alarmed to wake up in the morning

Use Lockdown Mode.

1 Like

How can I use Lockdown Mode ?

Activate all hardware kill switches.

That would not work automatically, and I know I would forget it. Also it would not solve the problem with the sound volume.

I cannot help you with developing healthy habits or self-discipline with your Librem 5 if you are unwilling to learn them yourself.

I always set the killswitches on my librem5 in the following way: modem=on, wlan/bluetooth=on and camera/microphone=off. When I get a phone call I must not forget to turn on camera/microphone before answering. And after the phone call I must not forget to turn off camera/microphone again.

But sometimes I also forget this. So I would love to get a big warning immediatelly, if a call arrives and camera/microphone is off, to turn it on.

And also if the call has ended, and at the time when the call came in the camera/microphone was off, I would also like to get a big warning, that I have to turn camera/microphone off again.

1 Like

We share similar practices, except that I never forget. I have no doubt that you can achieve the same results in due time, with or without any scripts.

I have gotten in the habit of remembering to turn the mic/camera HKS on and off when needes. However I think it would be cool to have a warning to remind of HKS state when answering or ending a call.

Maybe not a big fullscreen warning but a regular system notification would be nice I think.

1 Like

This.

For an incoming call, the window should contain a large warning - but also toggling the mic HKS during that window (i.e. after the call becomes incoming and before you answer the call) must work.

For an outgoing call, the Calls app should produce a large warning - and I guess also the Contacts app would have to activate a similar warning when you actually initiate a call.

With the complication that if you are using a Bluetooth headset, that would need to be taken into account (once Bluetooth headset actually works, and bearing in mind that your car could be your headset).

2 Likes

While the cronjob in the first message of this thread seems to work well, I have an improvement.

The problem is, if I exceptionally schedule an alarm earlier in the Clocks settings, the sound/vibra may be still turned off. So it would be better that instead of sound/vibra the modem would be turnded off. To achieve that I have changed the cronjob /etc/cron.d/no-disturb:

XDG_RUNTIME_DIR=/run/user/1000

# disable modem at 22:00
0 22 * * * root mmcli -m any --disable

# set sound (80% volume) and vibra for next day
0 0 * * * purism amixer -q set Master 80\% && gsettings set org.sigxcpu.feedbackd profile full

# enable modem at 6:30
30 6 * * * root mmcli -m any --enable
1 Like