forked from end-4/dots-hyprland
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·130 lines (120 loc) · 4.12 KB
/
setup
File metadata and controls
executable file
·130 lines (120 loc) · 4.12 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
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
#!/usr/bin/env bash
cd "$(dirname "$0")"
# Use REPO_ROOT instead of base - when scripts are sourced they do not need export to inherit vars
REPO_ROOT="$(pwd)"
source ./sdata/lib/environment-variables.sh
source ./sdata/lib/functions.sh
source ./sdata/lib/package-installers.sh
source ./sdata/lib/dist-determine.sh
prevent_sudo_or_root
set -e
#####################################################################################
showhelp_global(){
printf "${STY_CYAN}NOTE:
The old \"./install.sh\" is now \"./setup install\"
The old \"./update.sh\" is now \"./setup exp-update\"
The old \"./uninstall.sh\" is now \"./setup uninstall\"${STY_RST}
[$0]: Handle setup for illogical-impulse.
Syntax:
$0 <subcommand> [OPTIONS]...
Subcommands:
install (Re)Install/Update illogical-impulse.
Note: To update to the latest, manually run \"git stash && git pull\" first.
install-deps Run the install step \"1. Install dependencies\"
install-setups Run the install step \"2. Setup for permissions/services etc\"
install-files Run the install step \"3. Copying config files\"
resetfirstrun Reset firstrun state.
uninstall Uninstall illogical-impulse.
exp-update (Experimental) Update illogical-impulse without fully reinstall.
exp-merge (Experimental) Merge upstream changes with local configs using git rebase.
virtmon (For dev only) Create virtual monitors for testing multi-monitors.
checkdeps (For dev only) Check whether pkgs exist in AUR or repos of Arch.
help Show this help message.
For each <subcommand>, use -h for details:
$0 <subcommand> -h
${STY_BOLD}${STY_CYAN}Access ${STY_UNDERLINE}https://ii.clsty.link${STY_RST} ${STY_BOLD}${STY_CYAN}for documentation about illogical-impulse.${STY_RST}
"
}
case $1 in
# Global help
""|help|--help|-h)showhelp_global;exit;;
# Correct subcommand
install|uninstall|exp-update|exp-merge|resetfirstrun|checkdeps|virtmon)
SUBCMD_NAME=$1
SUBCMD_DIR=./sdata/subcmd-$1
shift;;
# Correct subcommand but not using ./sdata/subcmd-$1
install-deps|install-setups|install-files)
SUBCMD_NAME=$1
SUBCMD_DIR=./sdata/subcmd-install
shift;;
# Wrong subcommand
*)printf "${STY_RED}Unknown subcommand \"$1\".${STY_RST}\n";showhelp_global;exit 1;;
esac
#####################################################################################
if [[ -f "${SUBCMD_DIR}/options.sh" ]];
then source "${SUBCMD_DIR}/options.sh"
fi
case ${SUBCMD_NAME} in
install)
for function in ${print_os_group_id_functions[@]}; do
$function
done
pause
# Initialize sudo keepalive for the entire install process
sudo_init_keepalive
# Set trap to cleanup when this subcommand exits
trap sudo_stop_keepalive EXIT INT TERM
if [[ "${SKIP_ALLGREETING}" != true ]]; then
source ${SUBCMD_DIR}/0.greeting.sh
fi
if [[ "${SKIP_ALLDEPS}" != true ]]; then
source ${SUBCMD_DIR}/1.deps-router.sh
fi
if [[ "${SKIP_ALLSETUPS}" != true ]]; then
source ${SUBCMD_DIR}/2.setups.sh
fi
if [[ "${SKIP_ALLFILES}" != true ]]; then
source ${SUBCMD_DIR}/3.files.sh
fi
;;
install-deps)
for function in ${print_os_group_id_functions[@]}; do
$function
done
pause
# Initialize sudo keepalive for dependency installation
sudo_init_keepalive
# Set trap to cleanup when this subcommand exits
trap sudo_stop_keepalive EXIT INT TERM
if [[ "${SKIP_ALLDEPS}" != true ]]; then
source ${SUBCMD_DIR}/1.deps-router.sh
fi
;;
install-setups)
for function in ${print_os_group_id_functions[@]}; do
$function
done
pause
# Initialize sudo keepalive for setup steps
sudo_init_keepalive
# Set trap to cleanup when this subcommand exits
trap sudo_stop_keepalive EXIT INT TERM
if [[ "${SKIP_ALLSETUPS}" != true ]]; then
source ${SUBCMD_DIR}/2.setups.sh
fi
;;
install-files)
for function in ${print_os_group_id_functions[@]}; do
$function
done
pause
if [[ "${SKIP_ALLFILES}" != true ]]; then
source ${SUBCMD_DIR}/3.files.sh
fi
;;
*)
source ${SUBCMD_DIR}/0.run.sh
exit
;;
esac