Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Last active March 16, 2023 00:48
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jordansissel/e9e73b8f7d176055c3ed8c6714fb2edb to your computer and use it in GitHub Desktop.
Save jordansissel/e9e73b8f7d176055c3ed8c6714fb2edb to your computer and use it in GitHub Desktop.
Zoom on Linux notes

In a zoom?

xdotool search --name "Zoom Meeting ID:"

This will exit non-zero if no meeting matching this name is found. "Zoom Meeting ID:"

This window exists regardless of sharing or not sharing, in my tests.

Zooming event

While in a zoom, do some thing. WHen not in zoom, do something else.

while true; do 
  # search --sync waits for the window to show up.
  if xdotool search --sync --name "Zoom Meeting ID:" > /dev/null; then 
    echo "In zoom :)"
  else
    echo "No zoom"
  fi
  sleep 1
done

Am I sharing?

A window named "as_toolbar" will appear (this is the "stop share" tool bar window when sharing your screen)

pid=$(xdotool search --sync --name "Zoom Meeting ID:" getwindowpid); xdotool search --all --pid $pid --name as_toolbar
@geekpete
Copy link

I saw an odd error when testing this:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x58000dc
  Serial number of failed request:  10825
  Current serial number in output stream:  10825
No zoom
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x7a00003
  Serial number of failed request:  25135
  Current serial number in output stream:  25135
No zoom
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  15 (X_QueryTree)
  Resource id in failed request:  0x28b7b9c
  Serial number of failed request:  274133
  Current serial number in output stream:  274133
No zoom
In zoom :)
In zoom :)
In zoom :)
In zoom :)
In zoom :)
In zoom :)
In zoom :)
In zoom :)
In zoom :)
In zoom :)
In zoom :)
In zoom :)
In zoom :)
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x5800026
  Serial number of failed request:  150
  Current serial number in output stream:  150
No zoom

Details:

xdotool version 3.20160805.1

> cat /etc/os-release
NAME="Ubuntu"
VERSION="18.10 (Cosmic Cuttlefish)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.10"
VERSION_ID="18.10"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=cosmic
UBUNTU_CODENAME=cosmic

and

uname -a
Linux peter-ThinkPad-X1-Extreme 5.0.21-050021-generic #201906040731 SMP Tue Jun 4 07:33:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment