176 lines
5.4 KiB
Bash
Executable file
176 lines
5.4 KiB
Bash
Executable file
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
# ==============================================================================
|
|
# Frame Wallet Installation Script
|
|
# ==============================================================================
|
|
# Installs Frame - A privacy-focused, system-wide web3 wallet
|
|
#
|
|
# Features:
|
|
# - Hardware wallet support (Ledger, Trezor, GridPlus)
|
|
# - Multi-chain support (Ethereum, Optimism, Arbitrum, etc.)
|
|
# - Native OS integration (system tray, browser extension not required)
|
|
# - Privacy-focused (no tracking, open source)
|
|
#
|
|
# Threat Model:
|
|
# - Protects against browser extension attacks
|
|
# - Hardware wallet isolation from browser
|
|
# - No phone-home or analytics
|
|
# - Open source and auditable
|
|
#
|
|
# Source: https://frame.sh/
|
|
# GitHub: https://github.com/floating/frame
|
|
# ==============================================================================
|
|
|
|
# Colors
|
|
readonly GREEN='\033[0;32m'
|
|
readonly YELLOW='\033[1;33m'
|
|
readonly RED='\033[0;31m'
|
|
readonly BLUE='\033[0;34m'
|
|
readonly NC='\033[0m'
|
|
|
|
log() { echo -e "${GREEN}[INFO]${NC} $*"; }
|
|
warn() { echo -e "${YELLOW}[WARN]${NC} $*"; }
|
|
error() { echo -e "${RED}[ERROR]${NC} $*"; exit 1; }
|
|
header() { echo -e "${BLUE}=== $* ===${NC}"; }
|
|
|
|
header "Frame Wallet Installation"
|
|
echo ""
|
|
echo "Frame is a privacy-focused system-wide web3 wallet"
|
|
echo ""
|
|
echo "This script will:"
|
|
echo " 1. Install Frame from official .deb package"
|
|
echo " 2. Create launcher with Wayland compatibility"
|
|
echo " 3. Add desktop entry with proper Electron flags"
|
|
echo ""
|
|
read -p "Continue? [Y/n]: " confirm
|
|
[[ "${confirm:-Y}" =~ ^[Nn] ]] && exit 0
|
|
|
|
# ==============================================================================
|
|
# Check if already installed
|
|
# ==============================================================================
|
|
if command -v frame &>/dev/null; then
|
|
log "Frame is already installed at $(which frame)"
|
|
echo ""
|
|
read -p "Reinstall/update? [y/N]: " reinstall
|
|
[[ ! "${reinstall:-N}" =~ ^[Yy] ]] && exit 0
|
|
fi
|
|
|
|
# ==============================================================================
|
|
# Install Frame
|
|
# ==============================================================================
|
|
header "Installing Frame"
|
|
|
|
# Method 1: Try apt repository first
|
|
log "Checking for Frame in apt..."
|
|
if apt-cache show frame &>/dev/null 2>&1; then
|
|
log "Installing from apt repository..."
|
|
sudo apt update
|
|
sudo apt install -y frame
|
|
else
|
|
# Method 2: Download .deb from GitHub releases
|
|
log "Downloading from GitHub releases..."
|
|
|
|
LATEST_URL=$(curl -s https://api.github.com/repos/floating/frame/releases/latest \
|
|
| grep "browser_download_url.*amd64.deb" \
|
|
| cut -d '"' -f 4 \
|
|
| head -1)
|
|
|
|
if [ -z "$LATEST_URL" ]; then
|
|
error "Could not find latest Frame .deb release"
|
|
fi
|
|
|
|
log "Downloading from: $LATEST_URL"
|
|
cd /tmp
|
|
curl -L -o frame.deb "$LATEST_URL"
|
|
|
|
log "Installing .deb package..."
|
|
sudo apt install -y ./frame.deb
|
|
rm frame.deb
|
|
fi
|
|
|
|
# ==============================================================================
|
|
# Create X11 Launcher (Wayland has issues with Electron)
|
|
# ==============================================================================
|
|
header "Creating X11 Launcher"
|
|
|
|
mkdir -p ~/bin
|
|
|
|
cat > ~/bin/frame << 'EOF'
|
|
#!/bin/bash
|
|
# Frame launcher - Force X11 for stability (Wayland has issues with Electron)
|
|
exec /opt/Frame/frame --ozone-platform=x11 "$@"
|
|
EOF
|
|
chmod +x ~/bin/frame
|
|
|
|
log "Created ~/bin/frame launcher"
|
|
|
|
# ==============================================================================
|
|
# Create desktop entry
|
|
# ==============================================================================
|
|
header "Creating Desktop Entry"
|
|
|
|
mkdir -p ~/.local/share/applications
|
|
|
|
cat > ~/.local/share/applications/frame.desktop << 'EOF'
|
|
[Desktop Entry]
|
|
Name=Frame
|
|
Comment=System-wide web3 wallet
|
|
Exec=/home/e/bin/frame %U
|
|
Terminal=false
|
|
Type=Application
|
|
Icon=frame
|
|
StartupWMClass=Frame
|
|
Categories=Utility;Finance;
|
|
EOF
|
|
|
|
# Update icon path
|
|
sed -i "s|/home/e|$HOME|g" ~/.local/share/applications/frame.desktop
|
|
|
|
log "Created desktop entry"
|
|
|
|
# ==============================================================================
|
|
# Verify Installation
|
|
# ==============================================================================
|
|
header "Verifying Installation"
|
|
|
|
echo ""
|
|
if [ -f /opt/Frame/frame ]; then
|
|
echo " ✅ Frame binary installed at /opt/Frame/frame"
|
|
else
|
|
echo " ❌ Frame binary not found"
|
|
fi
|
|
|
|
if [ -f ~/bin/frame ]; then
|
|
echo " ✅ Wayland launcher created at ~/bin/frame"
|
|
else
|
|
echo " ❌ Launcher not created"
|
|
fi
|
|
|
|
if [ -f ~/.local/share/applications/frame.desktop ]; then
|
|
echo " ✅ Desktop entry created"
|
|
else
|
|
echo " ❌ Desktop entry not created"
|
|
fi
|
|
|
|
# ==============================================================================
|
|
# Usage Instructions
|
|
# ==============================================================================
|
|
echo ""
|
|
header "Installation Complete"
|
|
echo ""
|
|
echo "Usage:"
|
|
echo " frame - Launch Frame wallet"
|
|
echo ""
|
|
echo "Features:"
|
|
echo " - Connect hardware wallets (Ledger, Trezor, GridPlus)"
|
|
echo " - Multi-chain support (ETH, OP, ARB, MATIC, etc.)"
|
|
echo " - System tray integration"
|
|
echo " - Privacy-focused (no tracking)"
|
|
echo ""
|
|
echo "Wayland Notes:"
|
|
echo " - Launcher uses --ozone-platform-hint=auto for auto-detection"
|
|
echo " - Edit ~/bin/frame if you need to force X11 or Wayland mode"
|
|
echo ""
|
|
echo "📖 Documentation: https://docs.frame.sh/"
|
|
echo "🔗 GitHub: https://github.com/floating/frame"
|