-
Notifications
You must be signed in to change notification settings - Fork 37
/
install.sh
executable file
·80 lines (65 loc) · 2 KB
/
install.sh
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
#! /bin/sh
ROOT_CMD=""
if which "doas" > /dev/null 2>&1
then
ROOT_CMD="doas"
else
if which "sudo" > /dev/null 2>&1
then
ROOT_CMD="sudo";
else
echo '`sudo` or `doas` needs to be installed';
exit 1;
fi
fi
echo 'Lemurs install script'
echo
# Compile lemurs
echo 'Compile Lemurs'
cargo build --release
if [ $? -ne 0 ]; then exit 1; fi
# Move lemurs to /usr/bin
echo 'Move lemurs into /usr/bin'
$ROOT_CMD cp -f "target/release/lemurs" "/usr/bin/lemurs"
if [ $? -ne 0 ]; then exit 1; fi
# Create lemurs directory
echo 'Create lemurs configuration directory'
echo 'NOTE: You still have to move your X or Wayland startup into the proper directories'
$ROOT_CMD mkdir -p "/etc/lemurs/wms"
$ROOT_CMD mkdir -p "/etc/lemurs/wayland"
if [ $? -ne 0 ]; then exit 1; fi
# Copy over configuration file
echo 'Copy over default configuration'
$ROOT_CMD cp -f "extra/config.toml" "/etc/lemurs/config.toml"
if [ $? -ne 0 ]; then exit 1; fi
# Copy over xsetup
echo 'Copy over more files'
$ROOT_CMD cp -f "extra/xsetup.sh" "/etc/lemurs/xsetup.sh"
if [ $? -ne 0 ]; then exit 1; fi
# Copy over default xinitrc
if [ -z "${XINITRC}" ]
then
XINITRC="$HOME/.xinitrc"
fi
if [ -f "$XINITRC" ]
then
echo 'Copy over existing xinitrc'
$ROOT_CMD cp -f "$XINITRC" "/etc/lemurs/wms/xinitrc"
fi
# Cache the current user
echo 'Copy over PAM service'
$ROOT_CMD cp -f "extra/lemurs.pam" "/etc/pam.d/lemurs"
# Cache the current user
echo 'Caching the current user'
$ROOT_CMD /bin/bash -c "echo 'xinitrc\n$USER' > /var/cache/lemurs"
# Disable previous Display Manager
echo 'Disabling the current display-manager. This might throw an error if no display manager is set up.'
$ROOT_CMD systemctl disable display-manager.service
# Copy over systemd service
echo 'Setting up lemurs service'
$ROOT_CMD cp -f extra/lemurs.service /usr/lib/systemd/system/lemurs.service
if [ $? -ne 0 ]; then exit 1; fi
# Enable lemurs
echo 'Enable the lemurs service'
$ROOT_CMD systemctl enable lemurs.service
if [ $? -ne 0 ]; then exit 1; fi