This repository was archived by the owner on Nov 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdependencies.sh
More file actions
72 lines (53 loc) · 1.56 KB
/
dependencies.sh
File metadata and controls
72 lines (53 loc) · 1.56 KB
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
# Returns -1 if not subset
strindex() {
x="${1%%$2*}"
[[ "$x" = "$1" ]] && echo -1 || echo "${#x}"
}
# get os-type to select multiple package managers
ID_LIKE=`awk -F= '/^ID_LIKE/{print $2}' /etc/os-release`
ID=`awk -F= '/^ID/{print $2}' /etc/os-release`
VERSION_ID=`awk -F= '/^VERSION_ID/{print $2}' /etc/os-release`
# Get the distro family
DEBIAN=`strindex "$ID_LIKE" 'debian'`
FEDORA=`strindex "$ID_LIKE" 'fedora'`
SUSE=`strindex "$ID_LIKE" 'suse'`
# if debian based
if [ "$DEBIAN" -ne -1 ]; then
INSTALL='apt-get install'
YES='-y'
# if fedora/redhat/centos based
elif [ "$FEDORA" -ne -1 ] || [ "$ID" == "fedora" ]; then
INSTALL='yum install'
YES='-y'
# if suse based
elif [ "$SUSE" -ne -1 ]; then
INSTALL='zypper install -y'
YES=''
# otherwise its arch?
else
INSTALL='pacman -S'
YES='--noconfirm'
fi
# fedora 22 and later uses dnf
if [ "$ID" == "fedora" ] && [ "$VERSION_ID" -ge "22" ]; then
INSTALL='dnf install'
YES='-y'
fi
# install vim
eval "sudo $INSTALL vim $YES"
# install tmux
eval "sudo $INSTALL tmux $YES"
# install git
eval "sudo $INSTALL git $YES"
# htop
eval "sudo $INSTALL htop $YES"
# install i3 and other dependencies
eval "sudo $INSTALL i3 i3status dmenu i3lock xbacklight feh conky $YES"
# install urxvt
eval "sudo $INSTALL rxvt-unicode $YES"
# install nmtui
eval "sudo $INSTALL NetworkManager-tui $YES"
# install ntpdate (for vm timesyncing)
#eval "sudo $INSTALL ntpdate $YES"
# Example for installing Vundle, the Vim dependency manager
git clone https://github.com/ctrlpvim/ctrlp.vim.git ~/.vim/bundle/ctrlp.vim