OSDN Git Service

Merge branch 'master' of https://github.com/instantos/instantOS
[instantos/instantOS.git] / depend.sh
1 #!/bin/bash
2
3 # installs dependencies for instantOS
4 # this is deprecated
5
6 export LINK="https://raw.githubusercontent.com/instantos/instantos/master"
7
8 # install on arch based system
9 pacinstall() {
10     for i in "$@"; do
11         { pacman -iQ "$i" || command -v "$i"; } &>/dev/null && continue
12         echo "Installing $i"
13         sudo pacman -S --noconfirm "$i" &>/dev/null
14     done
15 }
16
17 if ! command -v pacman &>/dev/null; then
18     echo "distro not supported"
19     exit
20 fi
21
22 # cross distro install command
23 ipkg() {
24     pacinstall "$@"
25 }
26
27 # on arch instantARCH takes care of this
28 if cat /etc/os-release | grep -qi 'manjaro'; then
29     if hwinfo --gfxcard --short | grep -iE 'nvidia.*(gtx|rtx|titan)'; then
30         echo "installing nvidia graphics drivers"
31         sudo mhwd -a pci nonfree 0300
32         if grep -Eiq 'instantos|manjaro' /etc/os-release; then
33             if pacman -iQ linux54; then
34                 pacinstall linux54-nvidia-440x
35             fi
36
37             if pacman -iQ linux419; then
38                 pacinstall linux419-nvidia-440xx
39             fi
40         else
41             if pacman -iQ linux-lts; then
42                 pacinstall nvidia-lts
43             fi
44             pacinstall nvidia
45         fi
46     fi
47 else
48     pacinstall xdg-desktop-portal-gtk
49 fi