-
Notifications
You must be signed in to change notification settings - Fork 8
/
ekn-app-runner.in
51 lines (39 loc) · 1.31 KB
/
ekn-app-runner.in
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
#!/bin/bash
export GI_TYPELIB_PATH="%typelibdir%${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
export LD_LIBRARY_PATH="%pkglibdir%${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
if [ "$GJS_DEBUG_OUTPUT" == "" ]; then
export GJS_DEBUG_OUTPUT=stderr
fi
if [ "$GJS_DEBUG_TOPICS" == "" ]; then
export GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
fi
# This will undoubtedly change in the future, but for now we will disable some
# of our more costly animations on arm.
if [[ "$(uname -m)" == arm* ]]; then
export LOW_PERFORMANCE_MODE=1
fi
if [ "$RUN_DEBUG" != "" ]; then
DEBUG_COMMAND="gdb --args"
fi
if [ "$RUN_PROFILE" != "" ]; then
export EOS_PROFILE=1
fi
if [ "$RUN_PROFILE_FILE" != "" ]; then
export EOS_PROFILE="capture:$RUN_PROFILE_FILE"
fi
if [ "$#" -lt 2 ]; then
echo "Run this script by passing it an app ID and a gresource file"
exit 1
fi
APP_ID="$1" && shift
RESOURCE_PATH="$1" && shift
SCRIPT="const Gio = imports.gi.Gio;
Gio.Resource.load('%pkgdatadir%/eos-knowledge.gresource')._register();
imports.searchPath.unshift('resource:///com/endlessm/knowledge/js');
const Application = imports.framework.application;
let application = new Application.Application({
application_id: '$APP_ID',
resource_path: '$RESOURCE_PATH',
});
application.run(['$0'].concat(ARGV));"
$DEBUG_COMMAND gjs $GJS_ARGS -c "$SCRIPT" "$@"