-
Notifications
You must be signed in to change notification settings - Fork 1
/
launcher
executable file
·93 lines (75 loc) · 2.85 KB
/
launcher
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
#
#############################
# QT launcher specific part #
#############################
# Qt Platform to Mir
#export QTCHOOSER_NO_GLOBAL_DIR=1
if [ "$SNAP_ARCH" == "amd64" ]; then
ARCH="x86_64-linux-gnu"
elif [ "$SNAP_ARCH" == "armhf" ]; then
ARCH="arm-linux-gnueabihf"
else
ARCH="$SNAP_ARCH-linux-gnu"
fi
export XKB_CONFIG_ROOT=$SNAP/usr/share/X11/xkb
export LIBGL_DRIVERS_PATH=$SNAP/usr/lib/$ARCH/dri
# Qt Libs and Modules
export LD_LIBRARY_PATH=$SNAP/lib:$SNAP/usr/lib/$ARCH/qt5/libs:$SNAP/usr/lib/$ARCH/dri:$LD_LIBRARY_PATH
export QT_PLUGIN_PATH=$SNAP//plugins
export QML2_IMPORT_PATH=$SNAP/qml:$SNAP/:$SNAP/lib/$ARCH:$QML2_IMPORT_PATH
export MIR_CLIENT_PLATFORM_PATH=$SNAP/usr/lib/$ARCH/mir/client-platform
# Set XDG_DATA_HOME to local path
export XDG_DATA_HOME=$SNAP_USER_DATA/.local/share
export XDG_DATA_DIRS=$XDG_DATA_HOME:$XDG_DATA_DIRS
mkdir -p $XDG_DATA_HOME
# Set cache folder to local path
export XDG_CACHE_HOME=$SNAP_USER_DATA/.cache
mkdir -p $XDG_CACHE_HOME
# Font Config and themes
export FONTCONFIG_PATH=$SNAP/etc/fonts/conf.d
export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf
rm -rf $XDG_DATA_HOME/{fontconfig,fonts,fonts-*,themes,.themes}
ln -sf $SNAP/usr/share/{fontconfig,fonts,fonts-*,themes} $XDG_DATA_HOME
ln -sfn $SNAP/usr/share/themes $SNAP_USER_DATA/.themes
# Necessary for the SDK to find the translations directory
export APP_DIR=$SNAP
# Removes Qt warning: Could not find a location
# of the system Compose files
export QTCOMPOSE=$SNAP/usr/share/X11/locale
# Use GTK styling for running under Unity 7
export GTK_PATH=$SNAP/usr/lib/$ARCH/gtk-2.0
# Gdk-pixbuf loaders
export GDK_PIXBUF_MODULE_FILE=$XDG_CACHE_HOME/gdk-pixbuf-loaders.cache
export GDK_PIXBUF_MODULEDIR=$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/2.10.0/loaders
export LOCPATH=$SNAP/usr/lib/locale
#if [ $needs_update = true ]; then
# rm -f $GDK_PIXBUF_MODULE_FILE
# if [ -f $SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders ]; then
# $SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders > $GDK_PIXBUF_MODULE_FILE
# fi
#fi
# Keep an array of data dirs, for looping through them
#IFS=':' read -r -a data_dirs_array <<< "$XDG_DATA_DIRS"
# Icon themes cache
#if [ $needs_update = true ]; then
# rm -rf $XDG_DATA_HOME/icons
# mkdir -p $XDG_DATA_HOME/icons
# for d in "${data_dirs_array[@]}"; do
# for i in $d/icons/*; do
# if [ -d "$i" ]; then
# theme_dir=$XDG_DATA_HOME/icons/$(basename "$i")
# if [ ! -d "$theme_dir" ]; then
# mkdir -p "$theme_dir"
# ln -s $i/* "$theme_dir"
# if [ -f $SNAP/usr/sbin/update-icon-caches ]; then
# $SNAP/usr/sbin/update-icon-caches "$theme_dir"
# elif [ -f $SNAP/usr/sbin/update-icon-cache.gtk2 ]; then
# $SNAP/usr/sbin/update-icon-cache.gtk2 "$theme_dir"
# fi
# fi
# fi
# done
# done
#fi
exec "$SNAP/bin/qmlscene" "$SNAP/qtapp2/Main.qml"