-
Notifications
You must be signed in to change notification settings - Fork 50
/
install.sh
executable file
·68 lines (59 loc) · 2.1 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
#!/bin/sh
# script to automatically do the following steps:
# - install the dependencies to compile the program, i.e. install 'gcc', 'make' and 'libhidapi-dev'
# remark: once the program is compiled, 'libhidapi-dev' isn't required any more, only 'libhidapi-libusb0' is
# - compile the program
# - move the program 'msiklm' to '/usr/local/bin/msiklm'
# - run 'msiklm' with 'test' option to check if the keyboard is detected
echo 'Installation script for MSIKLM - MSI Keyboard Light Manager'
echo '###########################################################'
sleep 1
echo 'Installing dependencies...'
sleep 2
if (sudo apt install -y gcc make libhidapi-dev); then
echo 'Dependencies successfully installed'
sleep 2
elif (sudo dnf install -y gcc make hidapi-devel); then
echo 'Dependencies successfully installed'
sleep 2
elif (sudo yum install -y gcc make hidapi-devel); then
echo 'Dependencies successfully installed'
sleep 2
elif (sudo pacman -S --noconfirm gcc make hidapi); then
echo 'Dependencies successfully installed'
sleep 2
elif (sudo zypper install gcc make libhidapi-devel); then
echo 'Dependencies successfully installed'
sleep 2
else
echo 'Dependencies could not be installed'
exit 1
fi
echo 'Compiling MSIKLM...'
sleep 2
# compile
if (make); then
echo 'Compiling finished successfully'
sleep 2
else
echo 'Compiling failed'
exit 1
fi
# install 'msiklm' to '/usr/local/bin/msiklm' which also makes it callable via the msiklm command
if (sudo make install); then
make delete
echo 'Installation of MSIKLM finished successfully'
sleep 2
else
echo 'Installation of MSIKLM failed'
exit 1
fi;
echo 'Testing MSIKLM...'
sleep 1
if (sudo msiklm test); then
echo "To configure the keyboard run 'msiklm' with your configuartion of choice, for a list of valid commands run 'msiklm help'."
echo "If you want to enable the autostart, run 'autostart.sh' with your configuartion of choice, to uninstall 'msiklm' run 'uninstall.sh'."
echo 'Thank you for using MSIKLM and have fun with it! :-)'
else
echo 'Testing of MSIKLM failed'
fi