mirror of
https://github.com/LukeHagar/omarchy.git
synced 2025-12-06 04:20:23 +00:00
Better Zoom Webapp Support for meeting links (#1542)
* Support for exec and mime types. Zoom integration
In order to better support webapp zoom:
- Added optional params for omarchy-webapp-install
- exec, defaults to omarchy-launch-webapp
- mimetypes, defaults blank
- added zoom webapp launcher that parses meeting links and transforms
them and calls launch webapp to join meeting links
- migration to convert existing zoom installs to the new custom
handler
- updated the base installer to call new zoom handler and set
mimetypes
* default should be in the else
* Add new line at end of file
* Missed new line on migration
* Updated conditionals to be a little more clean
* This is a rare setup so let's just save it for the direct CLI
* Use new bash conditionals
* Rename to fit under the existing namespace of cmds
* Fix after merge
* Use new syntax and add missing segment comments
* Cleanup a bit
* Use local icon for zoom with migration
* Fix regexp
* Refer to raw local icon references
---------
Co-authored-by: David Heinemeier Hansson <david@hey.com>
This commit is contained in:
20
bin/omarchy-webapp-handler-zoom
Executable file
20
bin/omarchy-webapp-handler-zoom
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
url="$1"
|
||||
web_url="https://app.zoom.us/wc/home"
|
||||
|
||||
if [[ $url =~ ^zoom(mtg|us):// ]]; then
|
||||
confno=$(echo "$url" | sed -n 's/.*[?&]confno=\([^&]*\).*/\1/p')
|
||||
|
||||
if [[ -n $confno ]]; then
|
||||
pwd=$(echo "$url" | sed -n 's/.*[?&]pwd=\([^&]*\).*/\1/p')
|
||||
|
||||
if [[ -n $pwd ]]; then
|
||||
web_url="https://app.zoom.us/wc/join/$confno?pwd=$pwd"
|
||||
else
|
||||
web_url="https://app.zoom.us/wc/join/$confno"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exec omarchy-launch-webapp "$web_url"
|
||||
@@ -1,49 +1,69 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$#" -ne 3 ]; then
|
||||
if [ "$#" -lt 3 ]; then
|
||||
echo -e "\e[32mLet's create a new web app you can start with the app launcher.\n\e[0m"
|
||||
APP_NAME=$(gum input --prompt "Name> " --placeholder "My favorite web app")
|
||||
APP_URL=$(gum input --prompt "URL> " --placeholder "https://example.com")
|
||||
ICON_URL=$(gum input --prompt "Icon URL> " --placeholder "See https://dashboardicons.com (must use PNG!)")
|
||||
ICON_REF=$(gum input --prompt "Icon URL> " --placeholder "See https://dashboardicons.com (must use PNG!)")
|
||||
CUSTOM_EXEC=""
|
||||
MIME_TYPES=""
|
||||
INTERACTIVE_MODE=true
|
||||
else
|
||||
APP_NAME="$1"
|
||||
APP_URL="$2"
|
||||
ICON_URL="$3"
|
||||
ICON_REF="$3"
|
||||
CUSTOM_EXEC="$4" # Optional custom exec command
|
||||
MIME_TYPES="$5" # Optional mime types
|
||||
INTERACTIVE_MODE=false
|
||||
fi
|
||||
|
||||
if [[ -z "$APP_NAME" || -z "$APP_URL" || -z "$ICON_URL" ]]; then
|
||||
# Ensure valid execution
|
||||
if [[ -z "$APP_NAME" || -z "$APP_URL" || -z "$ICON_REF" ]]; then
|
||||
echo "You must set app name, app URL, and icon URL!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop"
|
||||
|
||||
if [[ ! "$ICON_URL" =~ ^https?:// ]] && [ -f "$ICON_URL" ]; then
|
||||
ICON_PATH="$ICON_URL"
|
||||
else
|
||||
ICON_PATH="$ICON_DIR/$APP_NAME.png"
|
||||
mkdir -p "$ICON_DIR"
|
||||
if ! curl -sL -o "$ICON_PATH" "$ICON_URL"; then
|
||||
# Refer to local icon or fetch remotely from URL
|
||||
if [[ $ICON_REF =~ ^https?:// ]]; then
|
||||
if curl -sL -o "$ICON_PATH" "$ICON_REF"; then
|
||||
ICON_PATH="$ICON_DIR/$APP_NAME.png"
|
||||
else
|
||||
echo "Error: Failed to download icon."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
ICON_PATH="$HOME/.local/share/applications/icons/$ICON_REF"
|
||||
fi
|
||||
|
||||
# Use custom exec if provided, otherwise default behavior
|
||||
if [[ -n $CUSTOM_EXEC ]]; then
|
||||
EXEC_COMMAND="$CUSTOM_EXEC"
|
||||
else
|
||||
EXEC_COMMAND="omarchy-launch-webapp $APP_URL"
|
||||
fi
|
||||
|
||||
# Create application .desktop file
|
||||
DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop"
|
||||
|
||||
cat >"$DESKTOP_FILE" <<EOF
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Name=$APP_NAME
|
||||
Comment=$APP_NAME
|
||||
Exec=omarchy-launch-webapp $APP_URL
|
||||
Exec=$EXEC_COMMAND
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=$ICON_PATH
|
||||
StartupNotify=true
|
||||
EOF
|
||||
|
||||
# Add mime types if provided
|
||||
if [[ -n $MIME_TYPES ]]; then
|
||||
echo "MimeType=$MIME_TYPES" >>"$DESKTOP_FILE"
|
||||
fi
|
||||
|
||||
chmod +x "$DESKTOP_FILE"
|
||||
|
||||
if [ "$#" -ne 3 ]; then
|
||||
if [[ $INTERACTIVE_MODE == true ]]; then
|
||||
echo -e "You can now find $APP_NAME using the app launcher (SUPER + SPACE)\n"
|
||||
fi
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
|
||||
omarchy-webapp-install "HEY" https://app.hey.com "$ICON_DIR/HEY.png"
|
||||
omarchy-webapp-install "Basecamp" https://launchpad.37signals.com "$ICON_DIR/Basecamp.png"
|
||||
omarchy-webapp-install "WhatsApp" https://web.whatsapp.com/ "$ICON_DIR/WhatsApp.png"
|
||||
omarchy-webapp-install "Google Photos" https://photos.google.com/ "$ICON_DIR/Google Photos.png"
|
||||
omarchy-webapp-install "Google Contacts" https://contacts.google.com/ "$ICON_DIR/Google Contacts.png"
|
||||
omarchy-webapp-install "Google Messages" https://messages.google.com/web/conversations "$ICON_DIR/Google Messages.png"
|
||||
omarchy-webapp-install "ChatGPT" https://chatgpt.com/ "$ICON_DIR/ChatGPT.png"
|
||||
omarchy-webapp-install "YouTube" https://youtube.com/ "$ICON_DIR/YouTube.png"
|
||||
omarchy-webapp-install "GitHub" https://github.com/ "$ICON_DIR/GitHub.png"
|
||||
omarchy-webapp-install "X" https://x.com/ "$ICON_DIR/X.png"
|
||||
omarchy-webapp-install "Figma" https://figma.com/ "$ICON_DIR/Figma.png"
|
||||
omarchy-webapp-install "Discord" https://discord.com/channels/@me "$ICON_DIR/Discord.png"
|
||||
omarchy-webapp-install "Zoom" https://app.zoom.us/wc/home "$ICON_DIR/Zoom.png"
|
||||
omarchy-webapp-install "HEY" https://app.hey.com HEY.png
|
||||
omarchy-webapp-install "Basecamp" https://launchpad.37signals.com Basecamp.png
|
||||
omarchy-webapp-install "WhatsApp" https://web.whatsapp.com/ WhatsApp.png
|
||||
omarchy-webapp-install "Google Photos" https://photos.google.com/ "Google Photos.png"
|
||||
omarchy-webapp-install "Google Contacts" https://contacts.google.com/ "Google Contacts.png"
|
||||
omarchy-webapp-install "Google Messages" https://messages.google.com/web/conversations "Google Messages.png"
|
||||
omarchy-webapp-install "ChatGPT" https://chatgpt.com/ ChatGPT.png
|
||||
omarchy-webapp-install "YouTube" https://youtube.com/ YouTube.png
|
||||
omarchy-webapp-install "GitHub" https://github.com/ GitHub.png
|
||||
omarchy-webapp-install "X" https://x.com/ X.png
|
||||
omarchy-webapp-install "Figma" https://figma.com/ Figma.png
|
||||
omarchy-webapp-install "Discord" https://discord.com/channels/@me Discord.png
|
||||
omarchy-webapp-install "Zoom" https://app.zoom.us/wc/home Zoom.png "omarchy-webapp-handler-zoom %u" "x-scheme-handler/zoommtg;x-scheme-handler/zoomus"
|
||||
|
||||
3
migrations/1757435811.sh
Normal file
3
migrations/1757435811.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
echo "Copy Omarchy default app icons to .local/share/icons"
|
||||
|
||||
source $OMARCHY_PATH/install/packaging/icons.sh
|
||||
6
migrations/1757435812.sh
Normal file
6
migrations/1757435812.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
echo "Update Zoom webapp to handle zoommtg:// and zoomus:// protocol links"
|
||||
|
||||
if [[ -f ~/.local/share/applications/Zoom.desktop ]]; then
|
||||
omarchy-webapp-remove Zoom
|
||||
omarchy-webapp-install Zoom https://app.zoom.us/wc/home Zoom.png "omarchy-webapp-handler-zoom %u" "x-scheme-handler/zoommtg;x-scheme-handler/zoomus"
|
||||
fi
|
||||
Reference in New Issue
Block a user