-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·75 lines (61 loc) · 1.94 KB
/
install.sh
File metadata and controls
executable file
·75 lines (61 loc) · 1.94 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# Install MSI Monitor Control to the system
set -e
INSTALL_DIR="/opt/msigd-gui"
BIN_LINK="/usr/local/bin/msigd-gui"
DESKTOP_FILE="/usr/share/applications/msigd-gui.desktop"
ICON_DIR="/usr/share/icons/hicolor"
# Check for root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (sudo ./install.sh)"
exit 1
fi
# Get script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check if binary exists
if [ ! -f "$SCRIPT_DIR/src-tauri/target/release/msigd-gui" ]; then
echo "Error: Binary not found. Run 'npm run tauri build' first."
exit 1
fi
echo "Installing MSI Monitor Control..."
# Create install directory
mkdir -p "$INSTALL_DIR"
# Copy binary
cp "$SCRIPT_DIR/src-tauri/target/release/msigd-gui" "$INSTALL_DIR/"
chmod +x "$INSTALL_DIR/msigd-gui"
# Create launcher script
cat > "$INSTALL_DIR/launch.sh" << 'EOF'
#!/bin/bash
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
export WEBKIT_DISABLE_COMPOSITING_MODE=1
fi
exec /opt/msigd-gui/msigd-gui "$@"
EOF
chmod +x "$INSTALL_DIR/launch.sh"
# Create symlink
ln -sf "$INSTALL_DIR/launch.sh" "$BIN_LINK"
# Install icons
for size in 32 128 256; do
mkdir -p "$ICON_DIR/${size}x${size}/apps"
done
cp "$SCRIPT_DIR/src-tauri/icons/32x32.png" "$ICON_DIR/32x32/apps/msigd-gui.png"
cp "$SCRIPT_DIR/src-tauri/icons/128x128.png" "$ICON_DIR/128x128/apps/msigd-gui.png"
cp "$SCRIPT_DIR/src-tauri/icons/128x128@2x.png" "$ICON_DIR/256x256/apps/msigd-gui.png"
# Install desktop file
cat > "$DESKTOP_FILE" << 'EOF'
[Desktop Entry]
Name=MSI Monitor Control
Comment=Control MSI gaming monitor settings
Exec=msigd-gui
Icon=msigd-gui
Terminal=false
Type=Application
Categories=Utility;Settings;HardwareSettings;
Keywords=monitor;msi;display;brightness;led;mystic;
StartupNotify=true
EOF
# Update icon cache
gtk-update-icon-cache -f -t "$ICON_DIR" 2>/dev/null || true
echo "Installation complete!"
echo ""
echo "You can now run 'msigd-gui' from the terminal or find it in your application menu."