From 9c3db8283d488a36767eac8091f1ed41128b54f4 Mon Sep 17 00:00:00 2001 From: Andrea Rogers Date: Sun, 4 Aug 2024 18:18:34 -0500 Subject: [PATCH] profile.linux: Auto-start Sway on TTY1 after login --- .profile.linux | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.profile.linux b/.profile.linux index f1d2007..98513cd 100644 --- a/.profile.linux +++ b/.profile.linux @@ -1 +1,15 @@ -export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/tmp/runtime-`id -u`} +#!/usr/bin/env bash + +# Make compositor behave on Alpine +if [ -z "$XDG_RUNTIME_DIR" ]; then + export XDG_RUNTIME_DIR=/tmp/runtime-$UID + mkdir -p /tmp/runtime-$UID + + export XDG_SESSION_TYPE=wayland + export XDG_CURRENT_DESKTOP=sway + export LIBSEAT_BACKEND=seatd + + if [ -z "$WAYLAND_DISPLAY" ] && [ "$(tty)" == '/dev/tty1' ]; then + exec dbus-run-session sway -d |& tee /tmp/sway-$UID.log + fi +fi