Commit d9483d4f authored by Natanael Copa's avatar Natanael Copa
Browse files

setup-desktop: new setup script

this replaces setup-xfce-desktop

The script should set up a minimal, but usable desktop environment with
some sane defaults.
parent 7ff651fd
......@@ -12,6 +12,7 @@ SBIN_FILES := copy-modloop\
setup-apkcache\
setup-apkrepos\
setup-bootable\
setup-desktop\
setup-devd\
setup-disk\
setup-dns\
......
#!/bin/sh
PREFIX=@PREFIX@
: ${LIBDIR=$PREFIX/lib}
. "$LIBDIR/libalpine.sh"
usage() {
cat <<-__EOF__
usage: setup-desktop [-h] [xfce|gnome]
Install a standard desktop
options:
-h Show this help
__EOF__
exit $1
}
while getopts "h" opt; do
case $opt in
h) usage 0;;
'?') usage "1" >&2;;
esac
done
shift $(($OPTIND - 1))
if [ $# -gt 1 ]; then
usage "1" >&2
fi
de="$1"
shift
while [ $# -ne 1 ] && ! isin "$de" xfce gnome none; do
ask "Which desktop environment? ('gnome', 'xfce' or 'none')" none
de="$resp"
done
case "$de" in
none)
exit 0
;;
xfce)
setup-xorg-base xfce4 ${BROWSER:-firefox} \
consolekit2 \
gvfs \
lightdm \
lightdm-gtk-greeter \
polkit \
xfce4-terminal \
"$@"
rc-update add lightdm
;;
gnome)
setup-xorg-base ${BROWSER:-firefox} gnome gnome-apps-core "$@"
rc-update add gdm
;;
*)
usage "1" >&2
;;
esac
users=$(awk -F: '{if ($3<65000 && $3 >= 1000) print $1}' "$ROOT"/etc/passwd)
if [ -z "$users" ]; then
echo "WARNING: You need to create a user account. Please run:" >&2
echo "" >&2
echo " adduser -g 'Fistname Lastname' <username>" >&2
echo "" >&2
fi
#!/bin/sh
videodrivers=$(apk search --quiet --exact xf86-video* | grep -v -- '-doc$')
setup-xorg-base $videodrivers xfce4 firefox slim
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment