Skip to content

Instantly share code, notes, and snippets.

@nbolton
Created February 25, 2026 09:34
Show Gist options
  • Select an option

  • Save nbolton/eb0589a4c543fc22ff01330798d10744 to your computer and use it in GitHub Desktop.

Select an option

Save nbolton/eb0589a4c543fc22ff01330798d10744 to your computer and use it in GitHub Desktop.
Install Element (from dev build)
#!/bin/bash
set -euo pipefail
INSTALL_DIR="/opt/Element"
DESKTOP_FILE="/usr/share/applications/element-desktop.desktop"
BUILD_DIR="dist/linux-unpacked"
if [[ "$*" == *-h* ]]; then
echo "Usage: ./install.sh [-d] [-h]"
echo " -d Print debug info (paths)"
echo " -h Show this help"
exit 0
fi
if [[ "$*" == *-d* ]]; then
echo "Build dir: $BUILD_DIR"
echo "Install dir: $INSTALL_DIR"
echo "Desktop file: $DESKTOP_FILE"
fi
if [ ! -d "$BUILD_DIR" ]; then
echo "Error: $BUILD_DIR not found. Run 'pnpm run build' first."
exit 1
fi
sudo rm -rf "$INSTALL_DIR"
sudo cp -r "$BUILD_DIR" "$INSTALL_DIR"
# Desktop file
sudo tee "$DESKTOP_FILE" > /dev/null <<'EOF'
[Desktop Entry]
Type=Application
Name=Element
GenericName=Chat Client
Comment=Secure and decentralized chat client
Exec=/opt/Element/element-desktop %u
Icon=/opt/Element/resources/build/icon.png
Terminal=false
StartupWMClass=Element
Categories=Network;InstantMessaging;
MimeType=x-scheme-handler/element;x-scheme-handler/io.element.desktop;
EOF
sudo update-desktop-database /usr/share/applications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment