-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·127 lines (103 loc) · 4.89 KB
/
setup.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
#!/bin/bash
export XDG_DATA_HOME=$HOME/.local/share
export XDG_CONFIG_HOME=$HOME/.config
export XDG_STATE_HOME=$HOME/.local/state
export XDG_CACHE_HOME=$HOME/.cache
export ZSH="$XDG_DATA_HOME"/oh-my-zsh
export ZSH_CUSTOM="$ZSH"/custom
# custom_home_dir () {
# homedir=${homedir:-rexshell}
# # mkdir ${curdir}/$homedir && echo -e "created ${curdir}/$homedir"
# # echo ${curdir}/$homedir
# git clone https://github.com/RexAckermann/shell.git
# mv shell ${curdir}/$homedir
# cd ${curdir}/$homedir
# export HOME=$(pwd)
# curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh | bash # installs oh-my-zsh
# git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# git clone https://github.com/Pilaton/OhMyZsh-full-autoupdate.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ohmyzsh-full-autoupdate
# git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# echo -e "Do you want to get the history and private ? y/n "
# read -s -n 1 confirmation
# if [[ $confirmation == "y" ]] ; then
# echo -e "On it !"
# export GNUPGHOME="$(pwd)"/.gnupg
# # mv ~/.zsh_history ~/.zsh_history.$(date +%s)
# gpg -d .zsh_history.gpg >> "$HOME"/.zsh_history
# # mv ~/.zshrc_private ~/.zshrc_private.$(date +%s)
# gpg -d .zshrc_private.gpg >> "$HOME"/.zshrc_private
# else
# echo ""
# fi
# zsh
# }
user_home_dir () {
cd ~/ || exit
mv "$ZSH" "$ZSH"."$(date +%s)"
curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh | bash # installs oh-my-zsh
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/themes/powerlevel10k
git clone https://github.com/Pilaton/OhMyZsh-full-autoupdate.git "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}"/plugins/ohmyzsh-full-autoupdate
git clone https://github.com/zsh-users/zsh-autosuggestions "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}"/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}"/plugins/zsh-syntax-highlighting
git clone https://github.com/qoomon/zsh-lazyload "$ZSH_CUSTOM"/plugins/zsh-lazyload
mv -fv ~/.config/zsh ~/.config/zsh."$(date +%s)"
mv -fv ~/.zshenv ~/.zshenv."$(date +%s)"
mkdir -p ~/.config
git clone --depth 1 https://github.com/RexAckermann/shell.git ~/.config/zsh
cd ~/.config/zsh || exit
ln -s .zshenv ~/.zshenv
ln -s .profile ~/.profile
# mv ~/.zshrc ~/.zshrc.$(date +%s) ; ln -s ~/shell/.zshrc ~/.zshrc
# mv "$XDG_CONFIG_HOME"/zsh/.zshrc "$XDG_CONFIG_HOME"/zsh/.zshrc."$(date +%s)"
# cp -s ~/shell/.zshrc "$XDG_CONFIG_HOME"/zsh/.zshrc
# mv ~/.p10k.zsh ~/.p10k.zsh.$(date +%s) ; ln -s ~/shell/.p10k.zsh ~/.p10k.zsh
echo -e "Do you want to get the history and private ? y/n "
read -rs -n 1 confirmation
if [[ $confirmation == "y" ]] ; then
echo -e "On it !"
export GNUPGHOME=~/shell/.gnupg
# mv ~/.zsh_history ~/.zsh_history."$(date +%s)"
gpg -d .zsh_history.gpg >> history
# mv ~/.zshrc_private ~/.zshrc_private."$(date +%s)"
gpg -d .zsh_private.gpg >> .zshrc_private
else
echo skipped
fi
}
termuxexec() {
if [[ $(uname -a | awk '{print $14}') == "Android" ]]; then
echo -e "termux detected"
# echo "/data/data/com.termux/files/usr/bin/sshd -p 43434" >> ~/.zshrc
# sed 's/my_cpu_temp\ \ /\#\ my_cpu_temp\ \ /' ~/shell/.p10k.zsh > ~/shell/.p10k.tmp
# mv ~/shell/.p10k.tmp ~/shell/.p10k.zsh
# echo "sed 's/my_cpu_temp/\#\ my_cpu_temp/' .p10k.zsh > .p10k.zsh"
fi
}
user_home_dir
termuxexec
# curdir=$(pwd)
# echo -e "Press y to create a custom temporary home dirrectory called rexshell here and rice that."
# echo -e "Press n to use custom name"
# echo -e "Press o to use your home dirrectory. Warning: It will move your configs to name.unixtime format"
# read -s -n 1 permission
# if [[ $permission == o ]] ; then
# echo -e "using user home dirrectory"
# echo -e "Are you sure ? y/n"
# read -s -n 1 response
# if [[ $response == y ]] ; then
# echo "Going Through"
# else
# echo -e "Cancelled"
# exit
# fi
# user_home_dir
# elif [[ $permission == n ]] ; then
# echo -e "enter new name of the dirrectory"
# echo -e "Enter Custom Home Dir name"
# read homedir
# custom_home_dir
# elif [[ $permission == y ]] ; then
# echo -e "Using name rexshell for custom homedir"
# custom_home_dir
# fi