Automatic mute for night mode
-
Now, i had issues with different servicies sending emails around 4AM waking me up, so I am currently playing with mute service, there are commands I am trying just muting the DEFAULT_SINK, not sure if correct way, since it is not toggle-able with the switch in ayatana indicators
nano ~/.config/systemd/user/mute-audio.service with
[Unit] Description=Mute Audio [Service] Type=oneshot ExecStart=/usr/bin/pactl set-sink-mute @DEFAULT_SINK@ 1
nano /.config/systemd/user/unmute-audio.service with
[Unit] Description=Unmute Audio [Service] Type=oneshot ExecStart=/usr/bin/pactl set-sink-mute @DEFAULT_SINK@ 0
nano /.config/systemd/user/mute-audio.timer with
[Unit] Description=Timer to mute audio at 8 PM [Timer] OnCalendar=*-*-* 20:00:00 Persistent=true [Install] WantedBy=timers.target
nano /.config/systemd/user/unmute-audio.timer with
[Unit] Description=Timer to unmute audio at 7 AM [Timer] OnCalendar=*-*-* 07:00:00 Persistent=true [Install] WantedBy=timers.target
systemctl --user daemon-reload
systemctl --user enable mute-audio.timer
systemctl --user enable unmute-audio.timer
systemctl --user start mute-audio.timer
systemctl --user start unmute-audio.timersystemctl --user list-timers
-
after week of using, I am really happy with this solution, works just as it should.
I can imagine some simple application that edits this timer file or doing disable/enable, could also be managable from system-settings.
-
@uxes
Yes, that would be a very usefull feature to have in system settings.Ideal would be to be able to set as much mute scenarios as we need, like for alarm clock (and possibly, coupled with), in order to allow for muting depending on sleep periods, for instance for people shift working.
-
@uxes Your idea is pretty amazing and would love to see it as an application soon.
Thumbs Up...