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

# Format for entries `program,alternative_program:output_message`
# `alternative_program` and `message` are optional
check() {
  for entry in "$@"; do
	program_part=${entry%%:*}
	program1=${program_part%%,*}
	alt_program=${program_part#*,}

	msg=${entry#*:} 
	[ "${msg}" = "${entry}" ] && msg="${program1} is missing"

	if ! command -v "${program1}" > /dev/null 2>&1 && ! command -v "${alt_program}" > /dev/null 2>&1; then
		echo "$msg" >&2 
	fi
  done
}

# Programs
check \
	git     			\
	lf      			\
	fzf      			\
	mpv     			\
	picom   			\
	qutebrowser 			\
	zathura				\
	vim,nvim			\
	sxiv,nsxiv			\
	zsh,bash			\
	dunst				\
	scrot				\
	startx:"xorg-xinit is missing"

# Script dependencies
check \
	brightnessctl			\
	pactl:"pulseaudio is missing" 	\
	xinput				\
	xset				\
	xwallpaper			\
	xgamma

# Build dependencies
check \
	pkg-config			\
	curl				\
	tar				\
	make				\
	cc:"c compiler is missing" 	\
	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" >&2
fi