-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindie-dawg-dots.sh
executable file
·155 lines (133 loc) · 2.83 KB
/
indie-dawg-dots.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
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
#!/usr/bin/env bash
source "scripts/utils.sh"
source "scripts/os.sh"
source "scripts/gitconfig.sh"
source "scripts/kitty.sh"
source "scripts/tmux.sh"
source "scripts/privileges.sh"
source "scripts/arch_system.sh"
source "scripts/hyprland.sh"
source "scripts/waybar.sh"
source "scripts/lazygit.sh"
source "scripts/yay.sh"
install_dotfiles() {
clear
# PRIVILEGES
log_info " - Getting root privileges.."
get_privileges
# TEMP FOLDERS
create_temp_folders
clear
log_info "The Indie Dawg Dotfiles - Install Script"
log_section_separator
# GIT
generate_gitconfig
# OS SPECIFIC
#
local os=$(detect_os)
case "$os" in
arch)
log_info "** ARCH SPECIFIC CONFIG **"
log_section_separator
# SYSTEM
log_info "** SYSTEM **"
log_section_separator
set_hostname
log_section_separator
# PACKAGES
install_kitty
install_yay
install_tmux
install_hyprland
install_waybar
install_lazygit
log_section_separator
;;
macos)
log_info "** MACOS SPECIFIC CONIG **"
;;
esac
}
uninstall_dotfiles() {
clear
# PRIVILEGES
log_info "Getting root privileges.."
get_privileges
clear
log_info "The Indie Dawg Dotfiles - Uninstall Script"
log_section_separator
# GIT
remove_gitconfig # GIT
# OS SPECIFIC
#
local os=$(detect_os)
case "$os" in
arch)
log_info "** ARCH SPECIFIC CONFIG **"
log_section_separator
# SYSTEM
log_info "** SYSTEM **"
log_section_separator
unset_hostname
log_section_separator
# PACKAGES
uninstall_lazygit
uninstall_waybar
uninstall_hyprland
uninstall_tmux
uninstall_yay
uninstall_kitty
log_section_separator
;;
macos)
log_info "** MACOS SPECIFIC CONIG **"
;;
esac
}
main() {
if [ "$#" -gt 0 ]; then
case "$1" in
"--help" | "-h")
echo "Usage: $0 [option]"
echo "Options:"
echo " install Install dotfiles into user's home directory"
echo " uninstall Remove dotfiles from user's home directory"
echo " reinstall Reinstall dotfiles from user's home directory"
echo " logs Tail logs"
echo " resetlogs Reset logs directory"
echo " --help, -h Show this help message"
exit 0
;;
"install")
install_dotfiles
;;
"uninstall")
uninstall_dotfiles
;;
"reinstall")
# UNINSTALL
uninstall_dotfiles
log_operation_separator
# INSTALL
install_dotfiles
log_operation_separator
;;
"logs")
tail -f "logs/operations.log"
;;
"resetlogs")
remove_operations_log
;;
*)
log_error "Unknown option: $1"
echo "Use --help to see available options"
exit 1
;;
esac
else
log_error "No option provided"
echo "Use --help to see available options"
exit 1
fi
}
main "$@"