#!/usr/bin/env bash # Start BackOneUI tray from your desktop session (GNOME/Wayland or X11). set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" DEPROOT="${BACKONE_UI_DEPROOT:-$HOME/backone-ui-build-deps}" export DISPLAY="${DISPLAY:-:0}" export WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}" export XDG_CURRENT_DESKTOP="${XDG_CURRENT_DESKTOP:-ubuntu:GNOME}" export LD_LIBRARY_PATH="${DEPROOT}/usr/lib/x86_64-linux-gnu:${LD_LIBRARY_PATH:-}" BIN="${BACKONE_UI_BIN:-$ROOT/target/release/backone_desktop_ui}" if [[ ! -x "$BIN" ]]; then BIN="$ROOT/target/debug/backone_desktop_ui" fi if [[ ! -x "$BIN" ]]; then echo "BackOneUI binary not found. Run: make linux or bash scripts/linux-build.sh" >&2 exit 1 fi if ! gsettings get org.gnome.shell enabled-extensions 2>/dev/null | grep -q ubuntu-appindicators; then echo "Tip: enable GNOME tray support:" echo " gsettings set org.gnome.shell enabled-extensions \"['ubuntu-appindicators@ubuntu.com', ...]\"" echo " Or: Extensions app → enable 'Ubuntu AppIndicators'" fi pkill -f "$BIN" 2>/dev/null || true sleep 0.3 nohup "$BIN" >>/tmp/backone_desktop_ui.log 2>&1 & sleep 1 if pgrep -f "$BIN" >/dev/null; then echo "BackOneUI started (PID $(pgrep -f "$BIN" | head -1))" echo "Look for the tray icon in the top bar (may be under the ^ hidden-icons menu)." echo "Log: /tmp/backone_desktop_ui.log" else echo "BackOneUI failed to start. Last log lines:" >&2 tail -20 /tmp/backone_desktop_ui.log >&2 || true exit 1 fi