diff --git a/main/postmarketos-ui-mate/APKBUILD b/main/postmarketos-ui-mate/APKBUILD new file mode 100644 index 000000000..c416fd9c5 --- /dev/null +++ b/main/postmarketos-ui-mate/APKBUILD @@ -0,0 +1,21 @@ +pkgname=postmarketos-ui-mate +pkgver=1 +pkgrel=0 +pkgdesc="(X11) MATE Desktop Environment, fork of GNOME2 (stylus recommended)" +url="http://mate-desktop.org/" +arch="noarch" +license="GPL3+" +depends="mate-desktop-environment xorg-server dbus-x11" +makedepends="" +install="$pkgname.post-install" +subpackages="" +source="start_mate.sh" +options="!check" + +package() { + # Autostart via autologin on TTY0 (until we have a display manager #656) + install -D -m644 "$srcdir"/start_mate.sh \ + "$pkgdir"/etc/profile.d/start_mate.sh +} + +sha512sums="a5a48821538b18069bad6528d488ed2dd5ae7d4f4fa095215c30d5399a41e645300f0c70bef1178be085e5fe8510fb4dda5446585663fd57193e938558b803de start_mate.sh" diff --git a/main/postmarketos-ui-mate/postmarketos-ui-mate.post-install b/main/postmarketos-ui-mate/postmarketos-ui-mate.post-install new file mode 100644 index 000000000..c87b4e9b1 --- /dev/null +++ b/main/postmarketos-ui-mate/postmarketos-ui-mate.post-install @@ -0,0 +1,12 @@ +#!/bin/sh + +# Autologin on tty1, let busybox autoconfigure 2-6 +autologin="$(getent passwd 1000 | cut -d ":" -f 1)" +for i in 1 2 3 4 5 6; do + old="^tty$i::respawn:/sbin/getty 38400 tty$i" + new="# tty$i::respawn:/sbin/getty 38400 tty$i" + [ "$i" = "1" ] && new="tty1::respawn:/bin/login -f $autologin" + sed -i -e "s.$old.$new.g" /etc/inittab +done + + diff --git a/main/postmarketos-ui-mate/start_mate.sh b/main/postmarketos-ui-mate/start_mate.sh new file mode 100644 index 000000000..5f1a9f84c --- /dev/null +++ b/main/postmarketos-ui-mate/start_mate.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Mate autostart on tty1 (Autologin on tty1 is enabled in +# /etc/inittab by postmarketos-base post-install.hook). +# This is a temporary solution, we'll need something like a +# display manager in the long run (#656). +if [ "$(id -u)" = "1000" ] && [ "$(tty)" = "/dev/tty1" ]; then + # Start X11 with Mate + startx /usr/bin/mate-session 2>&1 | logger -t "$(whoami):x11" + + + # In case of failure, restart after 1s + sleep 1 + exit +fi