Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 41 lines (33 sloc) 964 Bytes
#!/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
name="cpufreq"
uuid="cpufreq-applet@yyc1992.gmail.com"
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}/${uuid}" "${prefix}/${usr_dir}/share/gnome-shell/extensions/"
mkdir -p "${prefix}/${usr_dir}/bin"
mkdir -p "${prefix}/${usr_dir}/share/glib-2.0/schemas"
cp -v "org.gnome.shell.extensions.${name}.gschema.xml" "${prefix}/${usr_dir}/share/glib-2.0/schemas"
[[ -z $nopost ]] && post "${prefix}/${usr_dir}/share/glib-2.0/schemas" || true