ehooks() { ################## taken from systemd.eclass ################### _systemd_get_dir() { [[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} " local variable=${1} fallback=${2} d # https://github.com/pkgconf/pkgconf/issues/205 local -x PKG_CONFIG_FDO_SYSROOT_RULES=1 if $(tc-getPKG_CONFIG) --exists systemd; then d=$($(tc-getPKG_CONFIG) --variable="${variable}" systemd) || die d=${d#${EPREFIX}} else d=${fallback} fi echo "${d}" } _systemd_get_userunitdir() { _systemd_get_dir systemduserunitdir /usr/lib/systemd/user } systemd_douserunit() { debug-print-function ${FUNCNAME} "${@}" ( insopts -m 0644 insinto "$(_systemd_get_userunitdir)" doins "${@}" ) } ################################################################ # 'startx' visible via the XSESSION variable # exeinto /etc/X11/Sessions newexe "${EHOOKS_FILESDIR}/unity.xsession" unity # Set Unity XDG desktop session variables # exeinto /etc/X11/xinit/xinitrc.d newexe "${EHOOKS_FILESDIR}/15-xdg-data-unity" 15-xdg-data-unity # Enables and fills $DESKTOP_SESSION variable for sessions started using 'startx' exeinto /etc/X11/xinit/xinitrc.d/ newexe "${EHOOKS_FILESDIR}/05-unity-desktop-session" 05-unity-desktop-session # Start gnome-session using systemd # exeinto /usr/libexec doexe "${S}/debian/data/run-systemd-session" # Install systemd unit files to enable starting desktop sessions via systemd # sed -i "s/ --builtin//" "${S}/debian/data/gnome-session.service" || die systemd_douserunit "${S}/debian/data/gnome-session.service" systemd_douserunit "${S}/debian/data/unity-session.target" insinto /etc/lightdm/lightdm.conf.d doins "${S}/debian/data/50-unity.conf" # Allow Nemo to manage Unity7 desktop and icons # sed -i "/NoDisplay/{s/false/true/}" "${S}/debian/data/nemo-unity-autostart.desktop" || die insinto /etc/xdg/autostart newins "${S}/debian/data/nemo-unity-autostart.desktop" unity-nemo-desktop.desktop insinto /usr/share/nemo/actions doins "${S}/debian/data/change-background-unity.nemo_action" doins "${S}/debian/data/set-as-background-unity.nemo_action" # Remove Ubuntu only session files # rm "${ED}"/usr/share/wayland-sessions/ubuntu*.desktop rm "${ED}"/usr/share/xsessions/ubuntu*.desktop rm "${ED}"/usr/share/gnome-session/sessions/ubuntu.session # Unity default mimeapps # newmenu "${EHOOKS_FILESDIR}/defaults.list" unity-mimeapps.list }