summaryrefslogtreecommitdiff
path: root/home/.sunshine-virtmon
blob: 1788087e36038fff6638d555680b2958bdbce750 (plain)
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
#!/bin/sh

if [[ $DISPLAY == :1 ]]; then
  echo "already on display :1"
  exit 0
fi

echo "killing sunshine..."
pkill -f "/home/aura/.local/share/sunshine/usr/bin/sunshine"

echo "starting secondary xorg instance..."
X :1 -config /etc/X11/xorg.conf.d/10-dummy.conf > /tmp/sunshine-virtmon.log &

echo "starting openbox on secondary screen..."
DISPLAY=:1 openbox > /tmp/sunshine-virtmon.log &

echo "starting x11vnc..."
DISPLAY=:1 x11vnc -display :1 -localhost -nopw -rfbport 5809 > /tmp/sunshine-virtmon.log &

echo "starting xfce4-panel..."
DISPLAY=:1 dbus-run-session xfce4-panel > /tmp/sunshine-virtmon.log &

sleep 1
DISPLAY=:1 xmodmap ~/.Xmodmap
DISPLAY=:1 xrdb ~/.Xresources
sleep 1
DISPLAY=:1 feh --bg-fill /home/aura/Pictures/Wall/a1.png

DEVICES=$(DISPLAY=:1 xinput list | rg Keychron | awk -F'id=' '{print $2}' | cut -f1)
for i in $DEVICES; do
  DISPLAY=:1 xinput disable $i
done

echo "starting sunshine..."
DISPLAY=:1 exec /home/aura/.local/bin/sunshine