-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathmaynard.in
44 lines (38 loc) · 1.18 KB
/
maynard.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
#! /bin/sh
PREFIX=@prefix@
LIBEXECDIR=$PREFIX/libexec
ABS_BUILDDIR=@abs_builddir@
DEFAULT_BACKGROUND=/usr/share/wallpapers/Hanami/contents/images/3872x2592.jpg
md5() {
cat "$1" 2> /dev/null | md5sum
}
check_install() {
local_maynard="$ABS_BUILDDIR/shell/maynard"
installed_maynard="$LIBEXECDIR/maynard"
if [ ! -e "$local_maynard" -o \
! -e "$installed_maynard" -o \
"`md5 \"$local_maynard\"`" != "`md5 \"$installed_maynard\"`" ]; then
echo "It looks like you forgot to run 'make install'." >&2
exit 1
fi
}
mkdir ~/.config > /dev/null 2>&1
if [ -z "${MAYNARD_BACKGROUND+_}" -a \
-e "$DEFAULT_BACKGROUND" ]; then
export MAYNARD_BACKGROUND="$DEFAULT_BACKGROUND"
fi
xdpyinfo > /dev/null 2>&1
if [ "$?" = "0" ]; then
# We are running under X, so let's assume this is a development
# installation.
if ! cat /etc/os-release 2> /dev/null | grep 'ID=raspbian' > /dev/null; then
# Non-Raspbian, we can launch weston under X.
check_install
XDG_DATA_DIRS=$XDG_DATA_DIRS:$PREFIX/share/ $PREFIX/bin/weston
else
echo "You cannot run Maynard under X." >&2
exit 1
fi
else
weston-launch
fi