diff --git a/crates/zed/resources/zed.desktop b/crates/zed/resources/zed.desktop index fe3aa1ace4..7920e63fd7 100644 --- a/crates/zed/resources/zed.desktop +++ b/crates/zed/resources/zed.desktop @@ -11,4 +11,3 @@ Icon=zed Categories=TextEditor;Development;IDE; Keywords=zed; MimeType=text/plain;inode/directory; -StartupWMClass=dev.zed.Zed diff --git a/script/install.sh b/script/install.sh index bd90c90059..84c8ce7a22 100755 --- a/script/install.sh +++ b/script/install.sh @@ -51,15 +51,42 @@ linux() { suffix="-$channel" fi + appid="" + case "$channel" in + stable) + appid="dev.zed.Zed" + ;; + nightly) + appid="dev.zed.Zed-Nightly" + ;; + preview) + appid="dev.zed.Zed-Preview" + ;; + dev) + appid="dev.zed.Zed-Dev" + ;; + *) + echo "Unknown release channel: ${channel}. Using stable app ID." + appid="dev.zed.Zed" + ;; + esac + + # Unpack rm -rf "$HOME/.local/zed$suffix.app" mkdir -p "$HOME/.local/zed$suffix.app" tar -xzf "$temp/zed-linux-$arch.tar.gz" -C "$HOME/.local/" + # Setup ~/.local directories mkdir -p "$HOME/.local/bin" "$HOME/.local/share/applications" + + # Link the binary ln -sf ~/.local/zed$suffix.app/bin/zed ~/.local/bin/ - cp ~/.local/zed$suffix.app/share/applications/zed$suffix.desktop ~/.local/share/applications/ - sed -i "s|Icon=zed|Icon=$HOME/.local/zed$suffix.app/share/icons/hicolor/512x512/apps/zed.png|g" ~/.local/share/applications/zed$suffix.desktop - sed -i "s|Exec=zed|Exec=$HOME/.local/zed$suffix.app/bin/zed|g" ~/.local/share/applications/zed$suffix.desktop + + # Copy .desktop file + desktop_file_path="$HOME/.local/share/applications/${appid}.desktop" + cp ~/.local/zed$suffix.app/share/applications/zed$suffix.desktop "${desktop_file_path}" + sed -i "s|Icon=zed|Icon=$HOME/.local/zed$suffix.app/share/icons/hicolor/512x512/apps/zed.png|g" "${desktop_file_path}" + sed -i "s|Exec=zed|Exec=$HOME/.local/zed$suffix.app/bin/zed|g" "${desktop_file_path}" if which zed >/dev/null 2>&1; then echo "Zed has been installed. Run with 'zed'"