3
miral_server=miral-shell
4
launcher='gnome-terminal --app-id com.canonical.miral.Terminal'
8
if [ -n "${MIR_SOCKET}" ]
10
if [ ! -e "${MIR_SOCKET}" ]
12
echo "Error: Host endpoint '${MIR_SOCKET}' does not exists"; exit 1
14
i=0; while [ -e "${XDG_RUNTIME_DIR}/mir_socket{i}" ]; do let i+=1 ;done
15
socket=${XDG_RUNTIME_DIR}/mir_socket{i}
16
hostsocket='--host-socket ${MIR_SOCKET}'
18
socket=${XDG_RUNTIME_DIR}/mir_socket
23
if [ "$1" == "--help" -o "$1" == "-h" ]
25
echo "$(basename $0) - Handy launch script for a hosted miral \"desktop session\""
26
echo "Usage: $0 [options] [shell options]"
28
echo " -kiosk use miral-kiosk instead of ${miral_server}"
29
echo " -launcher <launcher> use <launcher> instead of '${launcher}'"
30
echo " -socket <socket> set the mir socket [${socket}]"
31
echo " -bindir <bindir> path to the miral executable"
33
elif [ "$1" == "-kiosk" ]; then miral_server=miral-kiosk
34
elif [ "$1" == "-launcher" ]; then shift; launcher=$1
35
elif [ "$1" == "-socket" ]; then shift; socket=$1
36
elif [ "$1" == "-bindir" ]; then shift; bindir=$1/
37
elif [ "${1:0:2}" == "--" ]; then break
42
if [ -e "${socket}" ]; then echo "Error: session endpoint '${socket}' already exists"; exit 1 ;fi
44
sh -c "${bindir}${miral_server} $* ${hostsocket} --file ${socket} --desktop_file_hint=miral-shell.desktop"&
46
while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done
48
unset QT_QPA_PLATFORMTHEME
49
MIR_SOCKET=${socket} GDK_BACKEND=mir QT_QPA_PLATFORM=ubuntumirclient SDL_VIDEODRIVER=mir dbus-run-session -- ${launcher}
50
killall ${bindir}${miral_server}