pax_global_header00006660000000000000000000000064143674764040014531gustar00rootroot0000000000000052 comment=94a0d8d12e63fd4a298fb4cdce5f11e0a20bdb8c lomiri-session-0.2/000077500000000000000000000000001436747640400143465ustar00rootroot00000000000000lomiri-session-0.2/AUTHORS000066400000000000000000000000711436747640400154140ustar00rootroot00000000000000Cat-master21 Jami Kettunen Marius Gripsgard Mike Gabriel lomiri-session-0.2/CMakeLists.txt000066400000000000000000000016611436747640400171120ustar00rootroot00000000000000cmake_minimum_required(VERSION 3.5.0) project(lomiri-session VERSION 0.2) option(ENABLE_TOUCH_SESSION "Include support for touch session and lightdm integration" ON) find_program(LOMIRI_BIN lomiri) if(NOT LOMIRI_BIN) message(WARNING "make sure you have the lomiri shell installed at runtime!") endif() find_program(INOTIFYWAIT_BIN inotifywait) if(NOT INOTIFYWAIT_BIN) message(WARNING "inotifywait binary not found, it's required for X11 support!") endif() install(PROGRAMS lomiri-session DESTINATION bin) find_package(PkgConfig) pkg_check_modules(PC_SYSTEMD libsystemd) if(PC_SYSTEMD_FOUND) add_subdirectory(systemd) if(ENABLE_TOUCH_SESSION) find_program(LSC_BIN lomiri-system-compositor REQUIRED) add_subdirectory(touch) endif() elseif(ENABLE_TOUCH_SESSION) set(ENABLE_TOUCH_SESSION OFF) message(WARNING "Support for touch session was enabled but it depends on systemd which wasn't found!") endif() add_subdirectory(desktop) lomiri-session-0.2/ChangeLog000066400000000000000000000044351436747640400161260ustar00rootroot000000000000002023-02-04 Mike Gabriel * Release 0.2 (HEAD -> main, tag: 0.2) 2023-02-03 Marius Gripsgard * Merge branch 'personal/sunweaver/lomiri-not-required-for-building' into 'main' (712e988) 2023-02-03 Mike Gabriel * CMakeLists.txt: Don't require Lomiri Shell for building this project. (3a7d8d8) 2023-02-03 Marius Gripsgard * Merge branch 'personal/sunweaver/rename-project' into 'main' (5ba6272) 2023-02-03 Mike Gabriel * CMakeLists.txt: Rename project to lomiri-session. (58965bf) * Release 0.1 (e05f989) (tag: 0.1) 2022-12-31 Marius Gripsgard * Merge branch 'cat-master21-main-patch-40337' into 'main' (781609b) 2022-12-30 cat-master21 * fix(lomiri-touch-session): fix the correct path to run-systemd-session (69c7088) 2022-07-02 Mike Gabriel * Merge branch 'cmake' into 'main' (21c4642) 2022-06-21 Jami Kettunen * Add CMake build system (67e494d) 2022-06-24 Jami Kettunen * touch: Rename usc to lsc (a0678f6) 2022-06-21 Jami Kettunen * Move lomiri.service & run-systemd-session into systemd subdir (05a7176) * Drop old install scripts and deps file (c46e30f) 2022-06-07 Marius Gripsgard * Merge branch 'void-fixes' into 'main' (97f5579) 2022-06-07 Jami Kettunen * lomiri-session: Fix launching under QEMU/KVM (8a2201b) 2022-06-05 Jami Kettunen * lomiri-session: Make X11 support optional (2faba95) * lomiri-session: Default to BINARY=lomiri (f1929b4) 2022-06-07 Marius Gripsgard * Add LICENSE (7dbcf6d) 2021-01-15 Marius Gripsgard * deps (99746e7) * Add x11 support and add improved envs (737fc4f) 2020-08-10 Marius Gripsgard * Start ayatana indicators on start (d24bcfb) 2020-08-07 Marius Gripsgard * Add qt scaling (a65ae4b) * Claim the user wayland display (5647633) * Make sure to export grid values (e16098c) * Update session to match newer lomiri (66174eb) * Move lomiri-session to common files (f85e846) 2020-07-24 Marius Gripsgard * Add a touch session (fd0c915) 2020-07-20 Marius Gripsgard * Update lomiri-session (425eb3e) 2020-07-15 Marius Gripsgard * Fixup (e121b15) * Initial commit (06a107b) lomiri-session-0.2/LICENSE000066400000000000000000000167441436747640400153670ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. lomiri-session-0.2/desktop/000077500000000000000000000000001436747640400160175ustar00rootroot00000000000000lomiri-session-0.2/desktop/CMakeLists.txt000066400000000000000000000001651436747640400205610ustar00rootroot00000000000000install(PROGRAMS dm-lomiri-session DESTINATION bin) install(FILES lomiri.desktop DESTINATION share/wayland-sessions) lomiri-session-0.2/desktop/dm-lomiri-session000077500000000000000000000020261436747640400213170ustar00rootroot00000000000000#!/bin/sh # -*- Mode: sh; indent-tabs-mode: nil; tab-width: 2 -*- # TODO: The following block is to work around the OOBE wizard for the phone. # See LP: #1435877. # From mterry: This should be removed, I think; I believe our wizard should run # for the user even on the desktop (it does in snappy, and # should on classic too). But I'm writing this late in the # zesty cycle and don't want to change anything now. if [ ! -f $HOME/.config/ubuntu-system-settings/wizard-has-run ]; then mkdir -p $HOME/.config/ubuntu-system-settings touch $HOME/.config/ubuntu-system-settings/wizard-has-run fi systemctl --user import-environment dbus-update-activation-environment --systemd QT_QPA_PLATFORM=wayland dbus-update-activation-environment --systemd UBUNTU_PLATFORM_API_BACKEND=desktop_mirclient /usr/lib/lomiri-session/run-systemd-session lomiri.service dbus-update-activation-environment --systemd QT_QPA_PLATFORM= dbus-update-activation-environment --systemd UBUNTU_PLATFORM_API_BACKEND= exit 0 lomiri-session-0.2/desktop/lomiri.desktop000066400000000000000000000001651436747640400207070ustar00rootroot00000000000000[Desktop Entry] Name=Lomiri Exec=dm-lomiri-session Type=Application X-LightDM-Allow-Greeter=true DesktopNames=Lomiri lomiri-session-0.2/lomiri-session000077500000000000000000000074341436747640400172600ustar00rootroot00000000000000#!/bin/bash # -*- Mode: sh; indent-tabs-mode: nil; tab-width: 2 -*- # Ensure the shell always gets unthrottled touch events, so that applications # who want full speed low-latency input can get it (LP: #1497105) and so that # apps can use QML touch compression safely (the QML touch compression # algorithm does not support nesting well - LP: #1486341, LP: #1556763 - so # must be fed by the raw input event stream from Unity8). export QML_NO_TOUCH_COMPRESSION=1 export MIR_SERVER_PROMPT_FILE=1 # Hard code socket path because our snappy apparmor profile # only lets us put the socket in one place. And consumers expect it there. # (XDG_RUNTIME_DIR isn't typical under snappy) export MIR_SERVER_FILE=/run/user/$(id -u)/mir_socket rm -f "$MIR_SERVER_FILE" rm -f "${MIR_SERVER_FILE}_trusted" #if [ "$XDG_SESSION_DESKTOP" = "ubuntu-touch" ]; then # On Ubuntu Touch, we currently use a trick where we auto-login the # user without a LightDM greeter at all. In this case, we want to # start with the lockscreen visible. Once we switch to using a # proper greeter for the first login, we can remove this code path. #MODE=full-greeter #else MODE=full-shell #fi if [ -x "$(command -v device-info)" ]; then export GRID_UNIT_PX=$(device-info get GridUnit) export QTWEBKIT_DPR=$(device-info get WebkitDpr) export NATIVE_ORIENTATION=$(device-info get PrimaryOrientation) export QT_WAYLAND_FORCE_DPI=$((12 * ${GRID_UNIT_PX})) dbus-update-activation-environment --systemd QT_WAYLAND_FORCE_DPI=${QT_WAYLAND_FORCE_DPI} dbus-update-activation-environment --systemd GRID_UNIT_PX=${GRID_UNIT_PX} fi # Tell unity-mir to raise SIGSTOP after we start, which we use to tell # systemd when we are done starting up. export UNITY_MIR_EMITS_SIGSTOP=1 # Hack for virtual machines that fails to probe modeset if ([ -x "$(command -v hostnamectl)" ] && [ "$(hostnamectl status | grep 'Chassis: vm')" ]) \ || grep -wq hypervisor /proc/cpuinfo; then export MIR_MESA_KMS_DISABLE_MODESET_PROBE=1 fi # Set some envs export QT_QPA_PLATFORM=wayland export QT_IM_MODULE=maliit export MALIIT_FORCE_DBUS_CONNECTION=1 export UITK_ICON_THEME=suru dbus-update-activation-environment --systemd UITK_ICON_THEME=suru dbus-update-activation-environment --systemd MALIIT_FORCE_DBUS_CONNECTION=1 dbus-update-activation-environment --systemd QT_IM_MODULE=maliit dbus-update-activation-environment --systemd GTK_IM_MODULE=maliit dbus-update-activation-environment --systemd QT_QPA_PLATFORM=wayland dbus-update-activation-environment --systemd SDL_VIDEODRIVER=wayland dbus-update-activation-environment --systemd QT_WAYLAND_DISABLE_WINDOWDECORATION=1 dbus-update-activation-environment --systemd QT_ACCESSIBILITY=1 dbus-update-activation-environment --systemd QT_AUTO_SCREEN_SCALE_FACTOR=0 dbus-update-activation-environment --systemd GTK_CSD=0 # We need to be sure we dont use mir-on-mir unset MIR_SERVER_HOST_SOCKET # start with clean displays unset DISPLAY # Claim the user wldisplay export WAYLAND_DISPLAY=wayland-0 dbus-update-activation-environment --systemd WAYLAND_DISPLAY=${WAYLAND_DISPLAY} if [ -z "$NO_X11" ]; then x11_display_file=$(mktemp) export MIR_SERVER_ENABLE_X11=1 export MIR_SERVER_X11_DISPLAYFD=5 ${BINARY:-lomiri} --mode=$MODE "$@" 5>${x11_display_file}& else ${BINARY:-lomiri} --mode=$MODE "$@" & fi child=$! if [ -z "$NO_X11" ]; then if inotifywait -qq --timeout 5 --event close_write "${x11_display_file}" && [ -s "${x11_display_file}" ] then export DISPLAY=:$(cat "${x11_display_file}") dbus-update-activation-environment --systemd DISPLAY=$DISPLAY rm "${x11_display_file}" echo "got DISP $DISPLAY" else echo "ERROR: Failed to get X11 display" rm "${x11_display_file}" fi fi # Wait for SIGSTOP in child while [ $(ps --no-headers -o state $child) != "T" ]; do sleep 0.1 done kill -CONT $child exit 0 lomiri-session-0.2/systemd/000077500000000000000000000000001436747640400160365ustar00rootroot00000000000000lomiri-session-0.2/systemd/CMakeLists.txt000066400000000000000000000002001436747640400205660ustar00rootroot00000000000000install(PROGRAMS run-systemd-session DESTINATION lib/lomiri-session) install(FILES lomiri.service DESTINATION lib/systemd/user) lomiri-session-0.2/systemd/lomiri.service000066400000000000000000000006571436747640400207230ustar00rootroot00000000000000[Unit] Description=Lomiri Shell BindsTo=graphical-session.target Before=graphical-session.target Requires=dbus.socket After=dbus.socket Before=indicators.target Wants=indicators.target Before=ayatana-indicators.target Wants=ayatana-indicators.target [Service] Type=forking ExecStart=/usr/bin/lomiri-session ExecStopPost=/usr/bin/dbus-update-activation-environment --systemd WAYLAND_DISPLAY= Restart=on-failure TimeoutStartSec=120 lomiri-session-0.2/systemd/run-systemd-session000077500000000000000000000034361436747640400217450ustar00rootroot00000000000000#!/bin/sh set -e # clean-up upstart env, if the last session was run with upstart # without session systemd restart unset UPSTART_SESSION systemctl --user unset-environment UPSTART_SESSION # some old Qt programs still check this long-deprecated env var dbus-update-activation-environment --systemd GNOME_DESKTOP_SESSION_ID=this-is-deprecated # stop any lingering active units from a previous session systemctl --user stop graphical-session.target graphical-session-pre.target # robustness: if the previous graphical session left some failed units, # reset them so that they don't break this startup for unit in $(systemctl --user --no-legend --state=failed list-units | cut -f1 -d' '); do if [ "$(systemctl --user show -p PartOf --value $unit)" = "graphical-session.target" ]; then systemctl --user reset-failed $unit fi done # FIXME: synthesize After=graphical-session-pre.target dependencies until this # can be done declaratively (https://github.com/systemd/systemd/issues/3750) # This could be a generator, but we don't want to penalize non-graphical logins # with this. systemctl --user list-unit-files --no-legend | while read unit status _; do [ "${unit%.service}" != "$unit" ] || continue [ "$status" != "$disabled" ] || continue if [ "$(systemctl --user show -p PartOf --value $unit)" = "graphical-session.target" ]; then mkdir -p "$XDG_RUNTIME_DIR/systemd/user/${unit}.d" printf '[Unit]\nAfter=graphical-session-pre.target\n' > "$XDG_RUNTIME_DIR/systemd/user/${unit}.d/graphical-session-pre.conf" fi done systemctl --user daemon-reload systemctl --user start --wait "$1" dbus-update-activation-environment --systemd GNOME_DESKTOP_SESSION_ID= # Delay killing the X server until all graphical units stopped systemctl --user stop graphical-session-pre.target lomiri-session-0.2/touch/000077500000000000000000000000001436747640400154705ustar00rootroot00000000000000lomiri-session-0.2/touch/52-lomiri-touch.conf000066400000000000000000000002331436747640400211740ustar00rootroot00000000000000[Seat:*] type=wayland-system-compositor user-session=lomiri-touch wayland-compositor-command=/usr/share/lomiri-session/lsc-wrapper [LightDM] minimum-vt=1 lomiri-session-0.2/touch/CMakeLists.txt000066400000000000000000000004121436747640400202250ustar00rootroot00000000000000install(PROGRAMS lomiri-touch-session DESTINATION bin) install(PROGRAMS lsc-wrapper DESTINATION share/lomiri-session) install(FILES 52-lomiri-touch.conf DESTINATION share/lightdm/lightdm.conf.d) install(FILES lomiri-touch.desktop DESTINATION share/lightdm/sessions) lomiri-session-0.2/touch/lomiri-touch-session000077500000000000000000000004331436747640400215120ustar00rootroot00000000000000#!/bin/sh systemctl --user import-environment dbus-update-activation-environment --systemd XDG_SESSION_DESKTOP="ubuntu-touch" dbus-update-activation-environment --systemd MIR_SERVER_WAYLAND_HOST=/tmp/wayland-root /usr/lib/lomiri-session/run-systemd-session lomiri.service exit 0 lomiri-session-0.2/touch/lomiri-touch.desktop000066400000000000000000000002461436747640400215000ustar00rootroot00000000000000[Desktop Entry] Name=Lomiri Touch Exec=lomiri-touch-session TryExec=lomiri-touch-session Type=Application X-LightDM-Session-Type=wayland X-LightDM-DesktopName=Lomiri lomiri-session-0.2/touch/lsc-wrapper000077500000000000000000000015341436747640400176600ustar00rootroot00000000000000#!/bin/bash # We need to grab ANDROID_ROOT from /etc/environment, because Mir uses # it to find input configuration files and autopilot won't work without that. . /etc/environment export ANDROID_ROOT export COMPOSITOR_BACKEND=wayland export WAYLAND_DISPLAY=wayland-root export XDG_RUNTIME_DIR=/tmp # Hack for virtual machines that fails to probe modeset if [ "$(hostnamectl status | grep 'Chassis: vm')" ]; then export MIR_MESA_KMS_DISABLE_MODESET_PROBE=1 fi function do_while { while [ ! -e "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}" ]; do echo "waiting for ${WAYLAND_DISPLAY}" sleep 0.1 done chmod 777 "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" } do_while & exec lomiri-system-compositor --enable-num-framebuffers-quirk=true --disable-overlays=false --console-provider=vt --spinner=$SNAP/usr/bin/lomiri-system-compositor-spinner $@