forked from bkbilly/lnxlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·56 lines (48 loc) · 1.68 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
#!/bin/bash
# Global
basedir=/opt/lnxlink
if [ -f /etc/debian_version ]; then
installcommand='apt-get --yes --force-yes install'
system='debian/ubuntu'
sudo apt-get update
elif [ -d /etc/yum.repos.d ]; then
installcommand='dnf install -y'
system='redhat/fedora'
elif [ -d /etc/pacman.d ]; then
installcommand='pacman -S --noconfirm '
system='arch/manjaro'
else
echo 'Warning! System type not recognized. Trying apt package manager.'
installcommand='apt-get --yes --force-yes install'
system='debian/ubuntu'
fi
# Installing system packages
echo -e "\e[35mLooking for Python3...\e[0m"
if [ -z $(which python3) ]; then
echo -e "\e[31mPython3 not found, installing from $system package manager:\e[0m"
sudo $installcommand python3
fi
echo -e "\e[35mLooking for PIP3...\e[0m"
if [ -z $(which pip3) ]; then
echo -e "\e[31mPIP3 not found, installing from $system package manager:\e[0m"
if [ system=='arch/manjaro' ]; then
sudo $installcommand python-pip
else
sudo $installcommand python3-pip
fi
fi
echo -e "\e[35mInstalling system dependencies...\e[0m"
if [ "$system" == "redhat/fedora" ]; then
# python3-devel and needed on fedora to install evdev (a dependency of pynput)
sudo $installcommand kernel-headers-$(uname -r) python3-devel gcc
fi
if [ system != 'debian/ubuntu' ]; then
echo -e "\n\n\e[31mSystem dependencies might not be correct...\e[0m"
fi
sudo $installcommand patchelf meson libdbus-glib-1-dev libglib2.0-dev libasound2-dev xdotool xprintidle xdg-utils
# Install Python requirements
echo -e "\e[35mInstalling LNXlink from PyPi...\e[0m"
sudo pip3 install -U lnxlink
# Done
echo -e "\n\n\nAll done!"
echo "Enjoy!!!"