Tuesday, March 21, 2023

Linux: Mute Notifications while on a Zoom Conference.

 

There is a problem while on a zoom share suddenly notification message pops-up however you do not want other to see.

The following script will check if the zoom is on a meeting and disable notifications for dunst and gnome. Bonus: This will also disable hide the top bar if the extension 'hidetopbar@mathieu.bidon.ca' is installed.


#!/bin/bash

meetingrunning="false"
while [ true ]; do
  meetingon=$(sudo netstat -anp | grep zoom | grep ESTABLISHED | grep udp | wc -l)

  sleep 10

  if [[ $meetingon = "0" ]] ; then
    if [[ $meetingrunning = "true" ]] ; then
      #echo meeting over
      # send the message late after enabling the the notification
      dunstctl set-paused false
      gsettings set org.gnome.desktop.notifications show-banners true
      gnome-extensions disable hidetopbar@mathieu.bidon.ca
      notify-send "Zoom Meeting Over, Check your notifications."
      meetingrunning="false"
    fi

  else
    if [[ $meetingrunning = "false" ]] ; then
      echo meeting started
      # send the message before disabling the notification
      # notify-send "Zoom Meeting Started"
      gsettings set org.gnome.desktop.notifications show-banners false
      dunstctl set-paused true
      gnome-extensions enable hidetopbar@mathieu.bidon.ca
      meetingrunning="true"
    fi
  fi

done

No comments:

Post a Comment