-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathlinux-assistant.sh
More file actions
executable file
·55 lines (48 loc) · 1.36 KB
/
Copy pathlinux-assistant.sh
File metadata and controls
executable file
·55 lines (48 loc) · 1.36 KB
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
#!/bin/bash
APP_DIR="" # leave it empty
# if the application is running as a Snap
# snap applications are installed in /snap/<appname>/<version> and the script is in bin
# so the lib dir is at $SNAP/bin/lib
# unset some variables to prevent conflicts
if [ -n "$SNAP" ]; then
APP_DIR="$SNAP/bin/lib"
# disable some variables
unset LD_LIBRARY_PATH
unset XDG_DATA_DIRS
unset GTK_PATH
unset GSETTINGS_SCHEMA_DIR
unset GI_TYPELIB_PATH
unset GIO_EXTRA_MODULES
unset GTK_USE_PORTAL
unset GDK_DISABLE_MEDIA
echo "[LA] Using snap"
# running as LA as flatpak
elif [ -d "/app/bin" ]; then
APP_DIR="/app/bin"
echo "[LA] Using flatpak"
# running LA local
elif [ -f "linux-assistant" ]; then
APP_DIR="."
echo "[LA] Using local"
else
# use /usr/lib as fallback
APP_DIR="/usr/lib/linux-assistant"
echo "[LA] Using standard installation"
fi
echo "[LA] App_DIR: $APP_DIR"
if [[ "$1" == "-v" || "$1" == "--version" ]]; then
VERSION=""
if [ -f "$APP_DIR/version" ]; then
VERSION=$( cat "$APP_DIR/version" )
fi
echo ""
echo "Linux-Assistant $VERSION"
echo "A daily linux helper with powerful integrated search, routines and checks."
echo "Homepage: https://www.linux-assistant.org"
exit 0
fi
if wmctrl -l | grep -q 'Linux Assistant'; then
wmctrl -a 'Linux Assistant'
else
"$APP_DIR/linux-assistant"
fi