-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathAppRun
64 lines (54 loc) · 1.7 KB
/
AppRun
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
#!/bin/bash
#
# AppRun: SigDigger's multitool launcher
#
# Copyright (C) 2021 Gonzalo José Carracedo Carballal
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program. If not, see
# <http://www.gnu.org/licenses/>
#
SELF=$(readlink -f "$0")
HERE=${SELF%/*}
ARGV0=`basename "$ARGV0"`
export SUSCAN_CONFIG_PATH="${HERE}/../share/suscan/config"
export LD_LIBRARY_PATH="${HERE}/../lib:${HERE}/../lib64:$LD_LIBRARY_PATH"
SIGDIGGER_EXEC="${HERE}"/SigDigger.app
SIGDIGGER_ARGS=
RMSVIEWER_EXEC="$SIGDIGGER_EXEC"
RMSVIEWER_ARGS="-t RMSViewer"
SUSCLI_EXEC="${HERE}"/suscli
SUSCLI_ARGS=""
EXEC="$SIGDIGGER_EXEC"
ARGS="$SIGDIGGER_ARGS"
# Detect tool
case "$ARGV0" in
RMSViewer*)
EXEC="$RMSVIEWER_EXEC"
ARGS="$RMSVIEWER_ARGS"
;;
suscli*)
EXEC="$SUSCLI_EXEC"
ARGS="$SUSCLI_ARGS"
;;
esac
# Detect bundle type. If SoapySDR has been bundled to the AppImage,
# a directory named SoapySDR must exist under usr/lib/
if [ -d "${HERE}"/../lib/SoapySDR ]; then
export SOAPY_SDR_ROOT="${HERE}/.."
if [ "x$SIGDIGGER_SOAPY_SDR_ROOT" != "x" ]; then
export SOAPY_SDR_ROOT="$SIGDIGGER_SOAPY_SDR_ROOT"
fi
fi
# Launch tool
exec -a "$ARGV0" "$EXEC" `echo $ARGS` "$@"