Created
June 30, 2022 21:50
-
-
Save acruise/e11f72341e2fabdf75b3cc6cd5319672 to your computer and use it in GitHub Desktop.
SwiftBar script to put zoom mic/camera status in the menu bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/osascript | |
| # <bitbar.title>Mute/Video/Screen State for Zoom</bitbar.title> | |
| # <bitbar.version>v1.0</bitbar.version> | |
| # <bitbar.author>nickjvturner</bitbar.author> | |
| # <bitbar.author.github>nickjvturner</bitbar.author.github> | |
| # <bitbar.desc>Mute/Video/Screen State for Zoom</bitbar.desc> | |
| # <bitbar.dependencies>Applescript</bitbar.dependencies> | |
| # <swiftbar.hideAbout>true</swiftbar.hideAbout> | |
| # <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal> | |
| # <swiftbar.hideLastUpdated>true</swiftbar.hideLastUpdated> | |
| # <swiftbar.hideDisablePlugin>true</swiftbar.hideDisablePlugin> | |
| # <swiftbar.hideSwiftBar>false</swiftbar.hideSwiftBar> | |
| property muteBtnTitle : "Mute audio" | |
| property videoBtnTitle : "Stop Video" | |
| property shareBtnTitle : "Start Share" | |
| if application "zoom.us" is running then | |
| tell application "System Events" | |
| tell application process "zoom.us" | |
| if exists (menu bar item "Meeting" of menu bar 1) then | |
| if exists (menu item MuteBtnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then | |
| set muteState to "\\\\e[31;1mLIVE MIC\\\\e[0m" | |
| else | |
| set muteState to "\\\\e[32;1mMUTED\\\\e[0m" | |
| end if | |
| if exists (menu item videoBtnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then | |
| set videoState to "\\\\e[31;1mVIDEO ACTIVE\\\\e[0m" | |
| set pad1 to " " | |
| else | |
| set videoState to "\\\\e[32;1mNO VIDEO\\\\e[0m" | |
| set pad1 to " " | |
| end if | |
| if exists (menu item shareBtnTitle of menu 1 of menu bar item "Meeting" of menu bar 1) then | |
| set shareState to "" | |
| set pad2 to "" | |
| else | |
| set shareState to "\\\\e[31;1mSCREEN SHARE ACTIVE\\\\e[0m" | |
| set pad2 to " " | |
| end if | |
| else | |
| set muteState to "" | |
| set videoState to "" | |
| set shareState to "" | |
| set pad1 to "" | |
| set pad2 to "" | |
| end if | |
| end tell | |
| end tell | |
| else | |
| set muteState to "" | |
| set videoState to "" | |
| set shareState to "" | |
| set pad1 to "" | |
| set pad2 to "" | |
| end if | |
| return shareState & pad2 & videoState & pad1 & muteState & "| size=18 ansi=true | |
| --- | |
| Mute/Video/Screen State for Zoom" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment