summaryrefslogtreecommitdiff
path: root/dep.sh
blob: 7ce898fb108ad6da5b124411936499e9d072ba11 (plain)
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
#!/bin/sh

check()
{
	for program in "${@}"; do
		if ! command -v "${program}" > /dev/null 2>&1; then
			echo "'${program}' is missing." >&2 
		fi
	done;
}
check_double()
{
	if ! command -v "${1}" > /dev/null 2>&1 && ! command -v "${2}" > /dev/null 2>&1; then
			echo "'${1}' is missing." >&2 
	fi
}
check_with_msg()
{
	if ! command -v "${1}" > /dev/null 2>&1; then
			echo "${2}" >&2 
	fi
}

# Configurated programs
check \
	git     	\
	lf      	\
	fzf      	\
	mpv     	\
	picom   	\
	qutebrowser 	\
	zathura

check_double vim nvim # If at least one exists don't print error
check_double sxiv nsxiv
check_double zsh bash

# Programs required by the scripts 
check \
	dunst		\
	scrot		\
	brightnessctl

check_with_msg pactl "'pulseaudio' is missing."

# X11 dependencies
check \
	xinput      	\
	xset		\
	xgamma

check_with_msg startx "'xorg-xinit' is missing."

# C X11 dependencies

check_with_msg cc "c compiler is missing"
check_with_msg ld "linker is missing"

if ! command -v ld -L/usr/X11R6/lib -lX11 -lXinerama -lfontconfig -lXft > /dev/null 2>&1;then
	echo "Xorg library files missing" 
fi