This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
executable file
·80 lines (66 loc) · 2.28 KB
/
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
#!/bin/zsh
DOTS=$(pwd)
make_home_dir() {
mkdir "$1"/.config || true
mkdir "$1"/.cache || true
mkdir -p "$1"/.local/share/fonts || true
}
back_up_configure() {
echo "\e[32mBakuping configures..."
mkdir $HOME/.oldconfig
mv -v $HOME/.config/{bat,btop,cava,dunst,fcitx5,hypr,mpd,ncmpcpp,nemo,neofetch,rofi,waybar,wezterm,zsh} $HOME/.oldconfig/
echo "\e[32mBakuping local files..."
mkdir $HOME/.oldconfig/local
mv -v $HOME/.local/share/fcitx5 $HOME/.oldconfig/local/
echo "\e[32mBakuping zsh configures..."
mv -v $HOME/{.zshenv,.p10k.zsh} $HOME/.oldconfig/
echo "\e[32mDone, you can find your backups at \e[33m$HOME/.oldconfig"
}
echo "\e[32mPreparing stuff..."
make_home_dir ${HOME} 2>/dev/null
echo "\e[32mDone"
echo "\e[31mWARNING: Is the hyprdots folder at \e[33m$(pwd)? \e[32m(y/N)"
read input
if [[ "$input" == "y" ]] || [[ "$input" == "Y" ]]; then
if [[ -d "$HOME/.oldconfig" ]]; then
echo ""
echo "\e[31mWARNING: There seems to already be a backup at \e[33m'$HOME/.oldconfig'"
echo "\e[33mDo you wanna overwrite it \e[32m(y/N)?"
read input
if [[ "$input" == "y" ]] || [[ "$input" == "Y" ]]; then
rm -rf "$HOME/.oldconfig"
echo "\e[32mRedoing directory tree..."
back_up_configure
else
echo "\e[31mDelete \e[33m$HOME/.oldconfig \e[31mmanually before installing"
echo "\e[32mInstallation aborted"
exit
fi
else
back_up
fi
echo "\e[32mInstall fonts..."
ln -sv $DOTS/local/fonts $HOME/.local/share/fonts/10_hyprdots_fonts
echo "\e[32mDone"
echo "\e[32mInstall Configures..."
ln -sv $DOTS/config/{bat,btop,cava,dunst,fcitx5,hypr,mpd,ncmpcpp,nemo,neofetch,rofi,waybar,wezterm,zsh} $HOME/.config/
echo "\e[32mDone"
echo "\e[32m(root)Install MediaControl script..."
sudo cp ./MediaControl /usr/bin/
sudo chmod +x /usr/bin/MediaControl
echo "\e[32mDone"
echo "\e[32mInstall local files..."
ln -sv $DOTS/local/fcitx5 $HOME/.local/share/
echo "\e[32mDone"
echo "\e[32mInstall zsh configures"
ln -sv $DOTS/.zshenv $HOME/
ln -sv $HOME/.config/zsh/.p10k.zsh $HOME/.p10k.zsh
echo "\e[32mDone"
echo "\e[32mInstall finished"
echo "\e[33mThere's no need to run this again, to update just run \e[32mgit pull \e[31in $(pwd)"
echo "\e[32mEnjoy my rice :)"
else
echo "\e[32mPlase change in hyprdots folder and run this"
echo "\e[32mInstallation aborted"
exit
fi