#!/bin/execlineb -WP # SPDX-License-Identifier: EUPL-1.2+ # SPDX-FileCopyrightText: 2021, 2023, 2025-2026 Alyssa Ross importas -Siu WAYLAND_DISPLAY piperw 4 3 background { fdclose 3 if { fdmove -c 0 4 redirfd -w 1 /dev/null head -c 1 } fdclose 4 if { chmod -- 0770 $WAYLAND_DISPLAY } if { chgrp -- wayland $WAYLAND_DISPLAY } fdmove -c 1 5 echo } fdclose 4 fdclose 5 if { install -do wayland -g wayland -m 0770 /run/wayland } if { chown wayland /dev/tty0 /dev/tty1 } export XDG_CONFIG_HOME /etc/xdg redirfd -r 0 /dev/tty1 if { udevadm settle } s6-notify-fd-from-socket -33 s6-setuidgid wayland bwrap # no --unshare-net, broke Weston's udev hotplug and readiness notification # uses abstract namespace socket. --unshare-ipc --unshare-uts --unshare-cgroup --cap-add CAP_SYS_TTY_CONFIG --dev-bind /dev /dev --bind /run /run --ro-bind /etc /etc --ro-bind /nix /nix --ro-bind /usr /usr --ro-bind /lib /lib --ro-bind /bin /bin --ro-bind /sbin /sbin # For /run/seatd.sock --tmpfs /run # For OpenGL/Vulkan/etc --ro-bind /run/opengl-driver /run/opengl-driver # For udev --ro-bind /run/udev /run/udev --bind /run/root-terminal /run/root-terminal --tmpfs /tmp --tmpfs /dev/shm # Filtered /proc (without nasty stuff) --proc /proc --ro-bind /proc/sys /proc/sys --tmpfs /proc/fs --remount-ro /proc/fs --tmpfs /proc/irq --remount-ro /proc/irq --ro-bind /dev/null /proc/kallsyms --ro-bind /sys /sys --dev /dev # GPUs --dev-bind /dev/dri /dev/dri # Input devices --dev-bind /dev/input /dev/input # Virtual consoles --dev-bind /dev/tty1 /dev/tty1 --dev-bind /dev/tty0 /dev/tty0 # Kernel console --dev-bind /dev/console /dev/console # Listening socket --bind /run/wayland /run/wayland # Workaround for https://github.com/pop-os/cosmic-comp/pull/2547 --dir /run/systemd/system -- cosmic-comp --no-xwayland --socket-path $WAYLAND_DISPLAY