- README.md: Vollständig dokumentiert (alle Tools, Services, udev-Regeln, COSMIC Applet, Razer Naga Swap, eGPU Tuning, Installation) - install.sh: Automatisiertes Full-Setup-Script (Applet build, udev, Services, Tools, eGPU, DMS Widget) - Verzeichnisstruktur aktualisiert
101 lines
4.3 KiB
Bash
101 lines
4.3 KiB
Bash
#!/usr/bin/env bash
|
|
# install.sh — Full setup for OneXPlayer Super X on Arch Linux
|
|
# Run from the repo root: ./install.sh
|
|
set -euo pipefail
|
|
|
|
DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
echo "=== SuperX-goes-Arch Installer ==="
|
|
echo ""
|
|
|
|
# ── 1. COSMIC Applet ──────────────────────────────────────────────────────
|
|
if command -v cosmic-comp &>/dev/null; then
|
|
echo "--- COSMIC Applet ---"
|
|
cd "$DIR/cosmic-applet-superx"
|
|
if [ -f target/release/cosmic-applet-superx ]; then
|
|
echo " Binary exists, skipping build"
|
|
else
|
|
echo " Building..."
|
|
cargo build --release
|
|
fi
|
|
install -Dm755 target/release/cosmic-applet-superx ~/.local/bin/cosmic-applet-superx
|
|
install -Dm644 com.system76.CosmicAppletSuperX.desktop ~/.local/share/applications/com.system76.CosmicAppletSuperX.desktop
|
|
|
|
# systemd user service
|
|
mkdir -p ~/.config/systemd/user
|
|
cat > ~/.config/systemd/user/cosmic-applet-superx.service << 'SERVICEEOF'
|
|
[Unit]
|
|
Description=Super X Control COSMIC Applet
|
|
After=graphical-session.target
|
|
PartOf=graphical-session.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStart=%h/.local/bin/cosmic-applet-superx
|
|
Restart=on-failure
|
|
RestartSec=3
|
|
|
|
[Install]
|
|
WantedBy=graphical-session.target
|
|
SERVICEEOF
|
|
systemctl --user daemon-reload
|
|
systemctl --user enable --now cosmic-applet-superx.service 2>/dev/null || true
|
|
echo " ✅ COSMIC Applet installed & enabled"
|
|
else
|
|
echo " ⏭️ COSMIC not detected, skipping applet"
|
|
fi
|
|
|
|
# ── 2. udev-Regeln ────────────────────────────────────────────────────────
|
|
echo ""
|
|
echo "--- udev Rules ---"
|
|
sudo cp "$DIR/udev/99-superx-hid.rules" /etc/udev/rules.d/ 2>/dev/null || true
|
|
sudo cp "$DIR/udev/99-razer-naga-swap.rules" /etc/udev/rules.d/ 2>/dev/null || true
|
|
sudo udevadm control --reload-rules
|
|
sudo udevadm trigger
|
|
echo " ✅ udev rules installed"
|
|
|
|
# ── 3. Razer Naga Swap Daemon ─────────────────────────────────────────────
|
|
echo ""
|
|
echo "--- Razer Naga Left Handed Button Swap ---"
|
|
sudo cp "$DIR/tools/razer-naga-swap.py" /usr/local/bin/
|
|
sudo chmod +x /usr/local/bin/razer-naga-swap.py
|
|
sudo cp "$DIR/configs/razer-naga-swap.service" /etc/systemd/system/
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable razer-naga-swap.service 2>/dev/null || true
|
|
sudo systemctl restart razer-naga-swap.service 2>/dev/null || true
|
|
echo " ✅ Razer Naga swap daemon installed"
|
|
|
|
# ── 4. eGPU Performance Tuning ────────────────────────────────────────────
|
|
echo ""
|
|
echo "--- eGPU Performance ---"
|
|
if lspci -nn 2>/dev/null | grep -q "7590"; then
|
|
sudo cp "$DIR/configs/amdgpu-egpu.conf" /etc/modprobe.d/ 2>/dev/null || true
|
|
sudo cp "$DIR/tools/superx-egpu-perf.sh" /usr/local/bin/ 2>/dev/null || true
|
|
sudo chmod +x /usr/local/bin/superx-egpu-perf.sh 2>/dev/null || true
|
|
echo " ✅ eGPU config installed (reboot required for modprobe.d)"
|
|
else
|
|
echo " ⏭️ No eGPU detected, skipping"
|
|
fi
|
|
|
|
# ── 5. Tools nach ~/.local/bin ────────────────────────────────────────────
|
|
echo ""
|
|
echo "--- CLI Tools ---"
|
|
mkdir -p ~/.local/bin
|
|
ln -sf "$DIR/tools/superx-ctrl.py" ~/.local/bin/superx-ctrl.py 2>/dev/null || true
|
|
ln -sf "$DIR/tools/tablet-rgb.py" ~/.local/bin/tablet-rgb.py 2>/dev/null || true
|
|
echo " ✅ symlinks created in ~/.local/bin/"
|
|
|
|
# ── 6. DMS Widget (optional) ─────────────────────────────────────────────
|
|
echo ""
|
|
echo "--- DMS Widget ---"
|
|
if [ -d ~/.config/DankMaterialShell ]; then
|
|
mkdir -p ~/.config/DankMaterialShell/plugins/SuperXCtrl
|
|
cp "$DIR/dms/plugins/SuperXCtrl/"* ~/.config/DankMaterialShell/plugins/SuperXCtrl/ 2>/dev/null || true
|
|
echo " ✅ DMS widget installed"
|
|
else
|
|
echo " ⏭️ DMS not detected, skipping"
|
|
fi
|
|
|
|
echo ""
|
|
echo "=== Done! ==="
|
|
echo "Reboot recommended for eGPU modprobe settings to take effect."
|
|
echo "After reboot: check COSMIC Panel Settings → Applets → add 'Super X Control'"
|