Repository navigation
Expand file tree
/
Copy pathinstall-lua-session.sh
More file actions
executable file
·57 lines (50 loc) · 1.98 KB
/
Copy pathinstall-lua-session.sh
File metadata and controls
executable file
·57 lines (50 loc) · 1.98 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
#!/bin/bash
# Install mango-lua alongside upstream mango.
# Run with: sudo ./install-lua-session.sh
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
BUILD_DIR="$SCRIPT_DIR/build"
if [ ! -f "$BUILD_DIR/mango" ]; then
echo "ERROR: Build not found at $BUILD_DIR/mango"
echo "Run 'ninja -C build' first."
exit 1
fi
# Install binary as mango-lua (not replacing upstream mango)
install -Dm755 "$BUILD_DIR/mango" /usr/local/bin/mango-lua
echo "Installed /usr/local/bin/mango-lua"
# Build + install the mango-ui companion daemon (Phase 4a: stub, hello+ping).
# Gracefully skip if the ui/ tree or cargo is unavailable — the compositor
# still runs, mango.ui.* calls will just return "ui not available".
if [ ! -d "$SCRIPT_DIR/ui" ]; then
echo "ui/ not present in this tree; skipping mango-ui build (mango.ui.* will be disabled)"
elif command -v cargo >/dev/null 2>&1; then
(cd "$SCRIPT_DIR/ui" && cargo build --release --bin mango-ui) && \
install -Dm755 "$SCRIPT_DIR/ui/target/release/mango-ui" /usr/local/bin/mango-ui
echo "Installed /usr/local/bin/mango-ui"
else
echo "cargo not found; skipping mango-ui build (mango.ui.* will be disabled)"
fi
# Create session file
cat > /usr/share/wayland-sessions/mango-lua.desktop << 'EOF'
[Desktop Entry]
Encoding=UTF-8
Name=Mango (Lua)
DesktopNames=mango;wlroots
Comment=MangoWC with Lua plugin system
Exec=mango-lua
Icon=mango
Type=Application
EOF
echo "Installed /usr/share/wayland-sessions/mango-lua.desktop"
# Use the same portals config as upstream mango
if [ ! -f /usr/share/xdg-desktop-portal/mango-lua-portals.conf ]; then
cp /usr/share/xdg-desktop-portal/mango-portals.conf \
/usr/share/xdg-desktop-portal/mango-lua-portals.conf 2>/dev/null || true
fi
echo ""
echo "Done. You now have two session options:"
echo " - Mango (upstream, /usr/bin/mango)"
echo " - Mango (Lua) (your fork, /usr/local/bin/mango-lua)"
echo ""
echo "Both read ~/.config/mango/config.conf"
echo "Only Mango (Lua) loads ~/.config/mango/lua/init.lua"