-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
57 lines (46 loc) · 1.52 KB
/
install.sh
File metadata and controls
57 lines (46 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
set -euo pipefail
APP_NAME="quantum-auth-client"
INSTALL_DIR="$HOME/.local/bin"
DESKTOP_DIR="$HOME/.local/share/applications"
DESKTOP_FILE="$DESKTOP_DIR/${APP_NAME}.desktop"
echo "[QuantumAuth] Installing..."
# 1) Ensure dirs
mkdir -p "$INSTALL_DIR" "$DESKTOP_DIR"
# 2) Install binary from current directory
if [[ ! -f "./${APP_NAME}" ]]; then
echo "Error: ./{$APP_NAME} binary not found next to install.sh"
exit 1
fi
cp "./${APP_NAME}" "$INSTALL_DIR/$APP_NAME"
chmod +x "$INSTALL_DIR/$APP_NAME"
echo "[QuantumAuth] Binary installed to $INSTALL_DIR/$APP_NAME"
# 3) Create .desktop entry (wtypes:// handler)
cat > "$DESKTOP_FILE" <<EOF
[Desktop Entry]
Name=QuantumAuth Client
Comment=QuantumAuth local signing client
Exec=${INSTALL_DIR}/${APP_NAME} %u
Terminal=true
Type=Application
Categories=Security;Network;
MimeType=x-scheme-handler/qa;
EOF
echo "[QuantumAuth] Desktop file created at $DESKTOP_FILE"
# 4) Register wtypes:// scheme
xdg-mime default "${APP_NAME}.desktop" x-scheme-handler/types || true
update-desktop-database "$DESKTOP_DIR" || true
echo "[QuantumAuth] qa:// URL scheme registered"
# 5) Optional: remind user to add ~/.local/bin to PATH
case ":$PATH:" in
*":$HOME/.local/bin:"*) ;;
*)
echo ""
echo "[QuantumAuth] Note: $HOME/.local/bin is not in your PATH."
echo "Add this to your shell config (e.g. ~/.bashrc or ~/.zshrc):"
echo " export PATH=$HOME/.local/bin:$PATH"
;;
esac
echo ""
echo "[QuantumAuth] Install complete."
echo "Try opening this in your browser: qa://test"