Linux user notes -- open Zoom meetings in one click

It's been almost two years since I wrote the post on how to automate Zoom with Alfred and Apple Scripts. Sadly enough, the situation has not improved at all, you still have to click on the link for the Zoom meeting and then wait for it to launch your Zoom app.

The need for a simple way to join Zoom meetings (on Linux)

The goal is to open Zoom directly and join the meeting without going through the browser.

I have started using my Linux laptop to join a Zoom meeting regularly recently, and I simply can't tolerate having to click on the same link over and over again each time I want to join the meeting -- I just wish there is a simpler way to open Zoom with one click without going through the browser.

The magic of xdg-open

xdg-open -- opens a file or URL in the user's preferred application

If you are a Linux user, you might be already familiar with this xdg-open thing. To put it in short, if you give xdg-open uses the default application that is registered in the system to handle the URL or link or files that was passed to it.

As an example, if you run xdg-open mailto:[email protected] in a terminal, this will open the email application that was registered on your system to handle email, note the mailto is a URL schema for emails. There is another command called xdg-settings. If you are interested in checking what is your current default browser, you can do xdg-settings get default-web-browser

You may wonder how would this has anything to do with opening Zoom on Linux. As a matter of fact, when you click on the Zoom meeting link, it will take you to a web page, which uses some JavaScript under the hood and opens the URL that Zoom application registers to in Linux (and this is why you will usually get a pop-up on after you click on the zoom link which will you if you want to open the link with xdg-open).

It turns out this scheme is the same across both Linux and MacOS (perhaps it's the same across mobile and Windows as well). You can verify this by running xdg-settings get default-url-scheme-handler zoommtg in a terminal. If you had Zoom installed on your machine, the result of this command should be Zoom.desktop.

Understanding the Zoom URL scheme

The zoom url scheme starts with zoommtg, it contains the information of the meeting id and the password

The Zoom URL scheme is not that difficult to understand, if you want to use the URL scheme to join a meeting, you can use the following:

1
zoommtg://zoom.us/join?confno={confno}&pwd={pwd}`

where the confno is the number part of the Zoom meeting link you received and the pwd part is whatever comes after the pwd part in the URL.

Now is the time to combine xdg-open and the URL scheme, you can do something like xdg-open zoommtg://zoom.us/join?confno=123456&pwd=65432 in the terminal. Note that using it like that will start Zoom in the current terminal, meaning you won't be able to do anything in the current terminal which is less than ideal. The correct way to open zoom in the background would be (xdg-open zoommtg://zoom.us/join?confno=123456&pwd=65432 &)

Opening Zoom without browser

Now that we are clear on the Zoom scheme, we can think of several different ways to open Zoom quickly:

This is definitely a quick and cheap way to achieve what I wanted, it is as simple as adding something like this to my .zshrc or wherever I put my aliases:

1
alias meeting="xdg-open zoommtg://zoom.us/join?confno=123456&pwd=654321"

The issue with this way is obvious, it will be a bit troublesome to add different meetings, you will end up creating a lot of aliases for meetings which is not something I'm willing to spend time on.

This solution requires polybar and rofi

This is the solution that I went with, it is a bit more setup work at the beginning, but I'm quite happy with it.

The first thing I did was creating a file called .zoom_meetings.conf in my home directory. Inside this file, I have something like this

1
Example zoommtg://zoom.us/join?confno=123456&pwd=654321

Next step is to create a script in where you put your rofi config, as an example, I put it in .config/rofi/zoom/launcher.sh

This file will have the following:

1
xdg-open $( cat ~/.zoom_meetings.conf | rofi -dmenu -p 'Select Zoom meeting' | cut --fields=2 --delimiter=" ") & disown

This is a quite straightforward script, what it does is to open the content of the conf file, and pipe it to rofi, and then use cut to get the second part of that line which is the URL schema link

Once we get this file ready, we will start adding an icon to polybar as a shortcut, here's what I did:

1
2
3
4
5
6
7
8
[module/launcher]
type = custom/text

content = 異
content-background = black
content-foreground = green

click-left = ~/.config/rofi/zoom/launcher.sh

After you reload your polybar, click on the 異, this will bring you the rofi, with the links in your .zoom_meetings.conf file listed, you can choose to click on them or use arrow key to navigate and press enter. You will join the meeting immediately without going through the browser.

Obviously, there are several improvements that can be done for this solution as well. Here are some of them, they are order by the difficulty to achieve

  • Instead of saving the URL scheme link, it would be easier to save the actual zoom link, and do some URL transformation on the fly. -- this is probably only achievable with some actual coding.
  • Instead of creating a config file, grab the zoom links from online (maybe Google Calendar) or something? (This is probably not. -- this is probably only achievable with some actual coding.

References

  • polybar documentation
  • rofi documentation
  • xdg-open