-
Notifications
You must be signed in to change notification settings - Fork 1
/
installscript
192 lines (151 loc) · 5.91 KB
/
installscript
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
#!/usr/bin/env bash
# Script to install my dotfiles
# Author: komi7
# url: https://github.com/pxledit
CRE=$(tput setaf 1)
CYE=$(tput setaf 3)
CGR=$(tput setaf 2)
CBL=$(tput setaf 4)
BLD=$(tput bold)
CNC=$(tput sgr0)
OK='\n\033[0;32m OK...\033[0m'
logo () {
local text="${1:?}"
echo -en "
%%%
%%%%%//%%%%%
%%************%%%
(%%//############*****%%
%%%%%**###&&&&&&&&&###**//
%%(**##&&&#########&&&##**
%%(**##*****#####*****##**%%%
%%(**## ***** ##**
//## @@** @@ ##//
## **### ##
####### #####//
###**&&&&&**###
&&& &&&
&&&//// &&
&&//@@@**
..***
Script\n\n"
printf ' %s [%s%s %s%s %s]%s\n\n' "${CRE}" "${CNC}" "${CYE}" "${text}" "${CNC}" "${CRE}" "${CNC}"
sleep 2
}
logo "Welcome!"
printf '%sThis script will install needed dependencies and copy my dotfiles to your bspwm setup.%s\n\n' "${CRE}" "${CNC}"
sleep 3
while true; do
read -rp " Do you wish to continue? [y/N]: " yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
* ) printf " Error: just write 'y' or 'n'\n\n";;
esac
done
clear
logo "Checking if yay is installed"
if pacman -Qi yay >/dev/null 2>&1; then
printf "Yay is installed\n\n"
else
printf "installing yay..\n\n"
sudo pacman -Syu git && git clone https://aur.archlinux.org/yay-bin && cd yay-bin && makepkg -si && cd
fi
sleep 2
clear
logo "Installing needed packages.."
sudo pacman -Syu bspwm polybar sxhkd dunst rofi jq polkit-gnome git \
playerctl mpd ncmpcpp mpc picom feh ueberzug \
maim pamixer libwebp webp-pixbuf-loader xorg-xkill papirus-icon-theme \
ttf-jetbrains-mono ttf-jetbrains-mono-nerd ttf-terminus-nerd ttf-inconsolata ttf-joypixels \
ffmpegthumbnailer fzf gnome-disk-utility jq man-db mpv ntfs-3g copyq xclip xsel \
android-tools bat btop geany gnome-disk-utility git-lfs gvfs gvfs-mtp gvfs-smb \
gvfs-nfs man-db tldr mpv neofetch nitrogen pacman-contrib rofi-calc rofi-emoji \
scrcpy ttf-hack-nerd xorg-xinit yad zsh-syntax-highlighting zsh termite
clear
logo "Cloning Rice!"
printf "Cloning rice from https://github.com/pxledit/dotfile\n\n"
git clone --depth=1 https://github.com/pxledit/dotfile
sleep 2
clear
logo "Backup your files"
printf "Backup files will be stored in %s%s/.RiceBackup%s \n\n" "${CRE}" "$HOME" "${CNC}"
sleep 5
if [ -d "$HOME/.RiceBackup" ]; then
break
else
mkdir "${HOME}"/.RiceBackup
fi
[ -e ~/.config/bspwm ] && mv ~/.config/bspwm ~/.RiceBackup/bspwm-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/termite ] && mv ~/.config/termite ~/.RiceBackup/termite-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/picom ] && mv ~/.config/picom ~/.RiceBackup/picom-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/rofi ] && mv ~/.config/rofi ~/.RiceBackup/rofi-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/polybar ] && mv ~/.config/polybar ~/.RiceBackup/eww-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/sxhkd ] && mv ~/.config/sxhkd ~/.RiceBackup/sxhkd-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/dunst ] && mv ~/.config/dunst ~/.RiceBackup/dunst-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/gtk-3.0 ] && mv ~/.config/gtk-3.0 ~/.RiceBackup/gtk-3.0-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/mpd ] && mv ~/.config/mpd ~/.RiceBackup/mpd-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/ncmpcpp ] && mv ~/.config/ncmpcpp ~/.RiceBackup/ncmpcpp-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/nvim ] && mv ~/.config/nvim ~/.RiceBackup/nvim-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/ranger ] && mv ~/.config/ranger ~/.RiceBackup/ranger-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -e ~/.config/zsh ] && mv ~/.config/zsh ~/.RiceBackup/zsh-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
[ -f ~/.zshrc ] && mv ~/.zshrc ~/.RiceBackup/.zshrc-backup-"$(date +%Y.%m.%d-%H.%M.%S)"
printf "\n\nDone\n\n"
sleep 2
clear
logo "Copying Rice.."
printf "Copying files to respective directories..\n\n"
if [ -d "$HOME/.config" ]; then
cp -r ~/dotfile/config/* ~/.config/
else
mkdir -p ~/.config && cp -r ~/dotfile/config/* ~/.config
fi
#if [ -d "$HOME/.local/bin" ]; then
# cp -r ~/dotfile/misc/bin/* ~/.local/bin
#else
# mkdir -p ~/.local/bin && cp -r ~/dotfiles/misc/bin/* ~/.local/bin
#fi
#if [ -d "$HOME/.local/share/applications" ]; then
# cp -r ~/dotfile/misc/applications/* ~/.local/share/applications
#else
# mkdir -p ~/.local/share/applications && cp -r ~/dotfiles/misc/applications/* ~/.local/share/applications
#fi
#if [ -d "$HOME/.local/share/asciiart" ]; then
# cp -r ~/dotfiles/misc/asciiart/* ~/.local/share/asciiart
#else
# mkdir -p ~/.local/share/asciiart && cp -r ~/dotfiles/misc/asciiart/* ~/.local/share/asciiart
#fi
#if [ -d "$HOME/.local/share/fonts" ]; then
# cp -r ~/dotfiles/misc/fonts/* ~/.local/share/fonts
#else
# mkdir -p ~/.local/share/fonts && cp -r ~/dotfiles/misc/fonts/* ~/.local/share/fonts
#fi
cp -r $HOME/dotfile/home/picom.conf ~/
cp -r $HOME/dotfile/home/.xinitrc ~/
cp -r $HOME/dotfile/home/.themes ~/
cp -r $HOME/dotfile/home/.fonts ~/
cp -r $HOME/dotfile/home/.zshenv ~/
#cp -r /dotfiles/misc/firefox/chrome ~/.mozilla/firefox/*.default-release/
#cp -r /dotfiles/misc/firefox/user.js ~/.mozilla/firefox/*.default-release/
printf "\n\nFiles copied succesfully\n\n"
sleep 2
clear
logo "Reloading fonts.."
printf "Reloading fonts to make it usable \n\n"
## Reloading fonts
fc-cache -rv
printf "\n\nFonts reloaded succesfully!\n\n"
sleep 2
clear
logo "Enabling MPD service"
# For automatically launching mpd on login
systemctl --user enable mpd.service
systemctl --user start mpd.service
printf "\n\nDone\n\n"
sleep 2
clear
cd &&
sudo chown -R "$username:$username" "/home/$username" &&
cd .config/polybar/scripts/ && sudo chmod +x popup-calendar.sh && cd
logo "Installation finished"
printf "%sNow logout your session, select bspwm and log in.%s \n\n" "${CRE}" "${CNC}"