-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathinstall
executable file
·65 lines (54 loc) · 1.26 KB
/
install
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
#!/bin/sh
set -e
if [ "$(id -u)" != "0" ]; then
exec sudo "${0}" "${@}"
fi
themes_dir="/usr/share/plymouth/themes"
theme_name="vortex-ubuntu"
install() {
set -x
cp -r "$(dirname "${0}")/${theme_name}" "${themes_dir}/"
update-alternatives \
--install \
"${themes_dir}/default.plymouth" \
default.plymouth \
"${themes_dir}/${theme_name}/${theme_name}.plymouth" \
100
update-alternatives \
--set \
default.plymouth \
"${themes_dir}/${theme_name}/${theme_name}.plymouth"
update-initramfs -u
}
uninstall() {
set -x
update-alternatives \
--remove \
default.plymouth \
"${themes_dir}/${theme_name}/${theme_name}.plymouth"
# Prompt user for a different theme
update-alternatives \
--config \
default.plymouth
update-initramfs -u
rm -rvf "${themes_dir:?}/${theme_name:?}/"
}
usage() {
echo "Usage: ${0} [uninstall]" >&2
exit 1
}
if [ "${1}" = "-h" ] || [ "${1}" = "--help" ] || [ "${1}" = "help" ]; then
usage
fi
if [ ! -d "${themes_dir}" ]; then
echo "\"${themes_dir}\" directory does not exist" >&2
exit 1
fi
case "${1}" in
"")
install;;
uninstall)
uninstall;;
*)
usage;;
esac