summaryrefslogtreecommitdiff
path: root/suckless/.local/src/compileSource
blob: cb239f9d4b99c31b9f2f6ac78e1d4fd9302cb690 (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh

###################
# Setting Up Vars #
###################

SRC=$(pwd)
KERNEL=$(uname)

#################################
# Cloning and Cleaning Programs #
#################################

git clone https://github.com/rafa-99/dmenu.git
git clone https://github.com/rafa-99/dwm.git
git clone https://github.com/rafa-99/pkg.git
git clone https://github.com/rafa-99/queryt.git
git clone https://github.com/rafa-99/slock.git
git clone https://github.com/rafa-99/st.git

if [ "$KERNEL" = "Linux" ]; then
	git clone https://github.com/rafa-99/farbfeld.git
	git clone https://github.com/rafa-99/surf.git
	git clone https://github.com/rafa-99/sent.git
	git clone https://github.com/rafa-99/slstatus.git
	git clone https://github.com/rafa-99/xmouseless.git
fi

cd "$SRC"/dmenu && git pull ;
cd "$SRC"/dwm && git pull ;
cd "$SRC"/pkg && git pull ;
cd "$SRC"/queryt && git pull ;
cd "$SRC"/slock && git pull ;
cd "$SRC"/st && git pull ;

if [ "$KERNEL" = "Linux" ]; then
	cd "$SRC"/farbfeld && git pull ;
	cd "$SRC"/surf && git pull ;
	cd "$SRC"/sent && git pull ;
	cd "$SRC"/slstatus && git pull ;
	cd "$SRC"/xmouseless && git pull ;
fi

##########################
# Setting Configurations #
##########################

[ ! -f "$SRC"/dmenu/config.h ] && cp -rf "$HOME"/.config/suckless/dmenu/config.h "$SRC"/dmenu/ ;
[ ! -f "$SRC"/dwm/config.h ] && cp -rf "$HOME"/.config/suckless/dwm/config.h "$SRC"/dwm/ ;
[ ! -f "$SRC"/slock/config.h ] && cp -rf "$HOME"/.config/suckless/slock/config.h "$SRC"/slock/ ;
[ ! -f "$SRC"/st/config.h ] && cp -rf "$HOME"/.config/suckless/st/config.h "$SRC"/st/ ;

if [ "$KERNEL" = "Linux" ]; then
	[ ! -f "$SRC"/surf/src/config.h ] && cp -rf "$HOME"/.config/suckless/surf/config.h "$SRC"/surf/ ;
	[ ! -f "$SRC"/sent/config.h ] && cp -rf "$HOME"/.config/suckless/sent/config.h "$SRC"/sent/ ;
	[ ! -f "$SRC"/slstatus/config.h ] && cp -rf "$HOME"/.config/suckless/slstatus/config.h "$SRC"/slstatus/ ;
	[ ! -f "$SRC"/xmouseless/config.h ] && cp -rf "$HOME"/.config/suckless/xmouseless/config.h "$SRC"/xmouseless/ ;
else
	#################
	# Apply Patches #
	#################

	cd "$SRC"/dwm && cat "$HOME"/.config/suckless/patches/dwm-openbsd.patch | patch -p1
	cd "$SRC"/dmenu && cat "$HOME"/.config/suckless/patches/dmenu-openbsd.patch | patch -p1
	cd "$SRC"/queryt && cat "$HOME"/.config/suckless/patches/queryt-openbsd.patch | patch -p1
	cd "$SRC"/slock && cat "$HOME"/.config/suckless/patches/slock-openbsd.patch | patch -p1
	cd "$SRC"/st && cat "$HOME"/.config/suckless/patches/st-openbsd.patch | patch -p1
fi

########################
# Recompiling Programs #
########################

cd "$SRC"/dwm && git pull ; doas make clean install ; make clean
cd "$SRC"/dmenu && git pull ; doas make clean install ; make clean
cd "$SRC"/pkg && git pull ; doas make clean install ; make clean
cd "$SRC"/queryt && git pull ; doas make clean install ; make clean
cd "$SRC"/slock && git pull ; doas make clean install ; make clean
cd "$SRC"/st && git pull ; doas make clean install ; make clean

if [ "$KERNEL" = "Linux" ]; then
	cd "$SRC"/farbfeld && git pull ; doas make clean install ; make clean
	cd "$SRC"/surf && git pull ; doas make clean install ; make clean
	cd "$SRC"/sent && git pull ; doas make clean install ; make clean
	cd "$SRC"/slstatus && git pull ; doas make clean install ; make clean
	cd "$SRC"/xmouseless && git pull ; doas make clean install ; make clean
fi