-
Notifications
You must be signed in to change notification settings - Fork 0
/
elektropunk-install.sh
238 lines (197 loc) · 7.15 KB
/
elektropunk-install.sh
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#!/bin/bash
# Simple attempt to install elektropunk theme by @VaughnValle on a fresh install
VERSION="v0.1"
clear
greeting() {
printf "${PURPLE}%s\n" ""
printf "\n" " "
printf "%s\n" "|----------------------------------------------------------------------------------------------------------------------|"
printf "%s\n" "| |"
printf "%s\n" "| |"
printf "%s\n" "| /$$ /$$ /$$ /$$ |"
printf "%s\n" "| | $$ | $$ | $$ | $$ |"
printf "%s\n" "| /$$$$$$ | $$ /$$$$$$ | $$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$ | $$ /$$ |"
printf "%s\n" "| /$$__ $$| $$ /$$__ $$| $$ /$$/|_ $$_/ /$$__ $$ /$$__ $$ /$$__ $$| $$ | $$| $$__ $$| $$ /$$/ |"
printf "%s\n" "| | $$$$$$$$| $$| $$$$$$$$| $$$$$$/ | $$ | $$ \__/| $$ \ $$| $$ \ $$| $$ | $$| $$ \ $$| $$$$$$/ |"
printf "%s\n" "| | $$_____/| $$| $$_____/| $$_ $$ | $$ /$$| $$ | $$ | $$| $$ | $$| $$ | $$| $$ | $$| $$_ $$ |"
printf "%s\n" "| | $$$$$$$| $$| $$$$$$$| $$ \ $$ | $$$$/| $$ | $$$$$$/| $$$$$$$/| $$$$$$/| $$ | $$| $$ \ $$ |"
printf "%s\n" "| \_______/|__/ \_______/|__/ \__/ \___/ |__/ \______/ | $$____/ \______/ |__/ |__/|__/ \__/ |"
printf "%s\n" "| | $$ |"
printf "%s\n" "| | $$ |"
printf "%s\n" "| |__/ |"
printf "%s%s\n" "| $VERSION |"
printf "%s\n" "|----------------------------------------------------------------------------------------------------------------------|"
printf "\n" " "
printf "${RESET}\n%s" ""
}
if ! command -v tput &> /dev/null ; then
:
else
RESET=$(tput sgr0)
PURPLE=$(tput setaf 127)
greeting
fi
# Unlock sudo
sudo sleep 0.1
### INSTALLATION ###
deps_check() {
if pacman -Qi ${1} >/dev/null 2>&1 ; then
echo -e "\n${1} found!"
else
echo -e "\n${1} not found, installing"
sudo pacman -S ${1} --noconfirm 1>/dev/null 2>>~/errors.log
echo "Finished."
fi
}
install() {
echo -e "\nInstalling ${1}:"
sudo pacman -S "${1}" --noconfirm 1>/dev/null 2>>~/errors.log
echo -e "Done."
}
yay_install() {
echo -e "\nInstalling yay AUR helper..."
git clone https://aur.archlinux.org/yay.git 1>/dev/null 2>>~/errors.log
cd yay
makepkg -si --noconfirm --noprogressbar 1>/dev/null 2>>~/errors.log
cd .. && rm -rf yay/
echo -e "\nDone."
}
aur_install() {
echo -e "\nInstalling ${1}:"
yay -S "${1}" --noconfirm --noprogressbar 1>/dev/null 2>>~/errors.log
echo -e "Done."
}
dribbblish_install() {
if ! pacman -Qi spicetify-themes-git >/dev/null 2>&1 ; then
exit
fi
# Workaround to get Dribbblish folder only
cd /tmp && mkdir foo && cd foo
git clone https://github.com/morpheusthewhite/spicetify-themes.git
cd spicetify-themes
cp -r Dribbblish/ "$(dirname "$(spicetify -c)")/Themes/"
cd "$(dirname "$(spicetify -c)")/Themes/Dribbblish"
cp dribbblish.js ../../Extensions
spicetify config extensions dribbblish.js
spicetify config current_theme Dribbblish color_scheme base
spicetify config inject_css 1 replace_colors 1 overwrite_assets
spicetify backup apply
rm -rf /tmp/foo
} 1>/dev/null 2>>~/errors.log
deps=(
"base-devel"
"git"
"curl"
"wget"
)
pkgs=(
"bspwm"
"sxhkd"
"rofi"
"rxvt-unicode"
"zsh"
"vim"
"slim"
"feh"
"python"
"python-gobject"
"python-pillow"
"python-pywal"
"xsettingsd"
"gtk-engine-murrine"
"dunst"
"ranger"
"youtube-dl"
)
aur_pkgs=(
"polybar"
"rofi"
"spotify"
"spicetify-cli"
"nerd-fonts-complete"
"wpgtk-git"
"spicetify-themes-git"
)
# Checking dependencies
echo -e "\nChecking depedencies..."
for ((k = 0 ; k < "${#deps[@]}" ; k++))
do
deps_check "${deps[${k}]}"
done
# Installing packages
for ((i = 0 ; i < "${#pkgs[@]}" ; i++))
do
#echo -e "\nPackage number ${i}"
install "${pkgs[${i}]}"
done
# Import spotify GPG key
curl -sS https://download.spotify.com/debian/pubkey.gpg | sudo gpg --import - 1>/dev/null 2>>~/errors.log
# Installing yay
yay_install
# Installing AUR packages:
dir=~/tempbuild
if [[ ! -e $dir ]]; then
mkdir $dir
fi
cd $dir
for ((j = 0 ; j < "${#aur_pkgs[@]}" ; j++))
do
aur_install "${aur_pkgs[${j}]}"
if [ "${aur_pkgs[$j]}" == "spotify" ]; then
yay -S spotify --noconfirm --noprogressbar --nopgpfetch 1>/dev/null 2>>~/errors.log
sudo chmod a+wr /opt/spotify 1>/dev/null 2>>~/errors.log
sudo chmod a+wr /opt/spotify/Apps -R 1>/dev/null 2>>~/errors.log
fi
done
cd ..
rm -rf $dir
# oh-my-zsh install
echo -e "\nInstalling oh-my-zsh!"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 1>/dev/null 2>>~/errors.log
echo "Done."
# Dribbblish theme install
echo -e "\nInstalling spicetify Dribbblish theme"
dribbblish_install
echo "Done."
# powerlevel10k install
echo -e "\nInstalling powerlevel10k theme..."
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k 1>/dev/null 2>>~/errors.log
echo "source ~/powerlevel10k/powerlevel10k.zsh-theme" >>! ~/.zshrc
echo -e "\nInstalling theme fonts..."
wget -P ~/.local/share/fonts -q https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf 1>/dev/null 2>>~/errors.log
wget -P ~/.local/share/fonts -q https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf 1>/dev/null 2>>~/errors.log
wget -P ~/.local/share/fonts -q https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf 1>/dev/null 2>>~/errors.log
wget -P ~/.local/share/fonts -q https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf 1>/dev/null 2>>~/errors.log
echo "Done."
# SLIM configuration
echo -e "\nSetting slim as login manager..."
sudo systemctl enable slim.service 1>/dev/null 2>>~/errors.log
sudo systemctl start slim.service 1>/dev/null 2>>~/errors.log
echo "Done."
### RICING ###
# Cloning elektropunk repo
echo -e "\nGetting elektropunk dotfiles..."
git clone https://github.com/VaughnValle/elektropunk.git 1>/dev/null 2>>~/errors.log
cd elektropunk
# Getting hands dity
cp -r {bspwm,discord,dunst,nvim,images,picom,polybar,ranger,rofi-wifi-menu,scripts,spicetify,wpg} ~/.config/
cp .{Xresources,vimrc} ~/
# Make launch scripts executables
chmod +x ~/.config/polybar/launch.sh
chmod +x ~/.config/wpg/wp_init.sh
# Configure slim
sudo cp slim/slim.conf /etc/slim.conf
sed -i 's/\<vaughnvalle\>/"$USER"/' /etc/slim.conf
sudo cp -r slim/slimlock/punk /usr/share/slim/themes/
cd ..
echo "Done."
# Recommendation
echo -e "\n\nJust a friendly reminder:\nMake sure to keep everything up to date"
# Show errors
if [[ ! -s ~/errors.log ]]; then
echo -e "\nOh no there were some errors, see ~/errors.log"
else
echo -e "\nEverything installed correctly, enjoy your rice!"
fi
# Finished
exit