-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnasadiya_sukta
executable file
·112 lines (90 loc) · 2.6 KB
/
nasadiya_sukta
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
# Pre-requsite
mkdir ~/.logs
### Functions
shloka () {
var=$(cat ~/dotfiles/first_time/shloka.txt)
for (( i=0; i<${#var}; i++ )); do
sleep 0.03 | echo -ne "$(tput setaf 2)${var:$i:1}$(tput sgr 0)"
done
echo ""
}
install_packages () {
# Restore packages
sudo pacman -Syu
cat ~/dotfiles/backup/pacman.bak | xargs sudo pacman -S --noconfirm --needed 2> ~/packages.log
#sudo pacman -S --needed - < pacman.bak
}
yay() {
# Install yay
sudo pacman -S --needed base-devel --noconfirm
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd ..
rm -rf yay
}
#yay --save --answerclean All --answerdiff All
check_yay() {
sudo pacman -Q | grep yay
echo $? > yaystatus.log
check yaystatus.log
}
foreign_packages () {
# Restore foreign packages
cat ~/dotfiles/backup/yay.bak | xargs yay -S --needed --noconfirm 2> yay.log
}
#yay -S --needed < yay.bak
#yay -S --needed --asdeps < pacmam-optdep.bak
config() {
# Restore user config folder
#git clone https://github.com/jd1t25/dotfiles.git
#cd dotfiles
stow -d ~/dotfiles/ -t ~
cd ~/dotfiles/config
stow --adopt -t ~/.config .config
}
#check() {
# if [ -s $1 ]
# then
# tput setaf 1; printf "Error in ${1%.*} Installed$(tput sgr 0)\n"
# else
# tput setaf 2; printf "Error in ${1%.*} Installed$(tput sgr 0)\n"
# fi
#}
# Restore Conf
#cd ~/dotfiles/bak/
#cp blacklist.conf.bak /etc/modprobe.d/blacklist.conf
#cp logind.conf.bak /etc/systemd/logind.conf
#cp system.pa.bak /etc/pulse/system.pa
#cp 50-usb_power_save.rules.bak /etc/udev/rules.d/50-usb_power_save.rules
#cp sudoers.bak /etc/sudoers
#cd ..
#cd ..
# Oh-my-zsh
#sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
#cd ~
#
#git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git \
# ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
#git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
#git clone https://github.com/agkozak/zsh-z $ZSH_CUSTOM/plugins/zsh-z
#echo $(pacman -Qentq) > pacman.bak
#echo $(pacman -Qemtq) > yay.bak
#echo $(pacman -Qdq) > pacman-optdep.bak
### Main
main() {
shloka
yes | install_packages > ~/.logs/packages.log 2>&1
printf "\n$(tput setaf 2) Packages Done$(tput sgr 0)"
# check packages.log
yes | yay > ~/.logs/yaystatus.log 2>&1
printf "\n$(tput setaf 2) Yay Done$(tput sgr 0)"
# check_yay
yes | foreign_packages > ~/.logs/yay.log 2>&1
# check yay.log
config > ~/.logs/config.log 2>&1
printf "\n$(tput setaf 2) Configs Done$(tput sgr 0)"
echo ""
}
### Main Script
main