forked from paradoxxxzero/gnome-shell-system-monitor-applet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
executable file
·50 lines (43 loc) · 1.4 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
#!/bin/bash -e
srcdir=$(dirname $(readlink -f "$0"))
post()
{
glib-compile-schemas "$1"
}
for ((i = 1;i <= $#;i++)) ;do
case "${!i}" in
--post)
declare -f post
exit 0
;;
-p)
((i++))
prefix="${!i}"
;;
--nopost)
nopost=1
;;
esac
done
# TODO: Handle other distribs
if type lsb_release &> /dev/null && [[ $(lsb_release -i) =~ Ubuntu ]]; then
usr_dir="usr/local"
else
usr_dir="usr"
fi
mkdir -p "${prefix}/${usr_dir}/share/gnome-shell/extensions"
cp -vr "${srcdir}/[email protected]" "${prefix}/${usr_dir}/share/gnome-shell/extensions/"
mkdir -p "${prefix}/${usr_dir}/bin"
cp -v "${srcdir}/system-monitor-applet-config.py" "${prefix}/${usr_dir}/bin/system-monitor-applet-config"
mkdir -p "${prefix}/${usr_dir}/share/applications"
cp -v "${srcdir}/system-monitor-applet-config.desktop" "${prefix}/${usr_dir}/share/applications/"
for dir in "${srcdir}/"po/* ;do
[[ -d "$dir" ]] && {
lang=$(basename "$dir")
mkdir -p "${prefix}/${usr_dir}/share/locale/LC_MESSAGES/${lang}"
msgfmt "$dir/system-monitor-applet.po" -o "${prefix}/${usr_dir}/share/locale/LC_MESSAGES/${lang}/system-monitor-applet.mo"
}
done
mkdir -p "${prefix}/${usr_dir}/share/glib-2.0/schemas"
cp -v org.gnome.shell.extensions.system-monitor.gschema.xml "${prefix}/${usr_dir}/share/glib-2.0/schemas"
[[ -z $nopost ]] && post "${prefix}/${usr_dir}/share/glib-2.0/schemas" || true