-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInstallScript.sh
More file actions
executable file
·83 lines (72 loc) · 2.69 KB
/
InstallScript.sh
File metadata and controls
executable file
·83 lines (72 loc) · 2.69 KB
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
#!/bin/bash
#===============================================================================
#
# NOTE!
#
# If you are not me and have come accross this script, I can't stop you from
# running it, but be ware that this was written for personal use, if any harm
# comes from you running this script, it's not my fault.
#
#===============================================================================
#===============================
# Welcome prompt & safety check
#===============================
echo -n -e "Welcome to the dofiles install script. Please make sure that this script is not being run as root. Continue? \n(y/N) ==> "; read answer
if [[ $answer = "N" ]] ; then
echo "Please run this script as a normal user!" && exit
else
echo -n -e "Has the git repo been cloned in '~/Repos'? \n(y/N) ==> "; read answer2
if [[ $answer2 = "N" ]] ; then
echo "Please move the folder to its correct directory!" && exit
else
echo "All conditions have been met, the script will begin replacing dotfiles in 5 seconds." && sleep 5
fi
fi
#===========
# Variables
#===========
dotfiles_dir=~/Repos/dotfiles
log_file=~/dofilesInstallScriptLog.txt
#================================
# Deleting pre-existing dotfiles
#================================
sudo rm -rf ~/.Xdefaults
sudo rm -rf ~/.Xresources
sudo rm -rf ~/.gitconfig
sudo rm -rf ~/.config
sudo rm -rf ~/.scripts
sudo rm -rf ~/.vimrc
#=============================
# Creating Folders & SymLinks
#=============================
cd
mkdir .config
mkdir .scripts
mkdir .config/nvim
mkdir .config/i3
mkdir .config/polybar
mkdir .config/rofi
ln -sf $dotfiles_dir/.Xdefaults
ln -sf $dotfiles_dir/.Xresources
ln -sf $dotfiles_dir/.gitconfig
ln -sf $dotfiles_dir/.vimrc
ln -sf $dotfiles_dir/.config/ignore-lid-switch-tweak.desktop ~/.config
ln -sf $dotfiles_dir/.config/i3/config ~/.config/i3
ln -sf $dotfiles_dir/.config/polybar/config ~/.config/polybar
ln -sf $dotfiles_dir/.config/rofi/config ~/.config/rofi/config
ln -sf $dotfiles_dir/.config/rofi/sidestyle.rasi ~/.config/rofi/sidestyle.rasi
ln -sf $dotfiles_dir/.scripts/bat.sh ~/.scripts/
ln -sf $dotfiles_dir/.scripts/cpu ~/.scripts/
ln -sf $dotfiles_dir/.scripts/gnome-tweak-tool-lid-inhibitor ~/.scripts/
ln -sf $dotfiles_dir/.scripts/redshifttoggle.sh ~/.scripts/
ln -sf $dotfiles_dir/.scripts/weather ~/.scripts/
ln -sf $dotfiles_dir/.vimrc ~/.config/nvim/init.vim
#===================================
# Ask to run Package Install Script
#===================================
echo -n -e "The script was successful, congratulations! Would you like to run the Package Install Script? \n(y/N)==>"; read answer3
if [[ $answer3 = "N" ]] ; then
echo "Goodbye." && exit
else
bash PInstallScript.sh
fi