-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·43 lines (35 loc) · 986 Bytes
/
Copy pathdeploy.sh
File metadata and controls
executable file
·43 lines (35 loc) · 986 Bytes
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
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# Deploy sidecar to ~/.config/sunshine/
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DEST_DIR="$HOME/.config/sunshine"
echo "Deploying sidecar..."
# Copy main script
cp "$SCRIPT_DIR/sidecar.py" "$DEST_DIR/sidecar-tray.py"
chmod +x "$DEST_DIR/sidecar-tray.py"
echo "Deployed to $DEST_DIR/sidecar-tray.py"
# Install autostart entry
AUTOSTART_DIR="$HOME/.config/autostart"
mkdir -p "$AUTOSTART_DIR"
cat > "$AUTOSTART_DIR/sidecar.desktop" << EOF
[Desktop Entry]
Type=Application
Name=Sidecar
Comment=Virtual display streaming tray
Exec=$DEST_DIR/sidecar-tray.py
Icon=video-display
Terminal=false
Categories=Utility;
X-KDE-autostart-phase=2
EOF
echo "Installed autostart entry"
# Restart if running
if pgrep -f "sidecar-tray.py" > /dev/null; then
echo "Restarting sidecar-tray..."
pkill -f "sidecar-tray.py" || true
sleep 1
"$DEST_DIR/sidecar-tray.py" &
echo "Restarted"
fi
echo "Done"