#!/bin/sh
#
# lxtaz-session - start the LXTaz desktop.
#
# lxsession with the LXTaz profile: it exports XDG_CURRENT_DESKTOP=LXTaz,
# so the XDG autostart entries pick their session (OnlyShowIn=LXTaz for
# the lxtaz tools, NotShowIn=LXTaz for pcmanfm and the LXDE panel).
#
# Copyright (C) 2026 SliTaz GNU/Linux - BSD License
# Author: Christophe Lincoln <pankso@slitaz.org>
# AI assistant: Claude (Anthropic)
#

export XDG_CONFIG_HOME="$HOME/.config"
export XDG_MENU_PREFIX="lxde-"

# One lxsession config for LXDE and LXTaz (theme, keyboard, window
# manager): the user's LXTaz profile is a link to the LXDE one.
conf="$XDG_CONFIG_HOME/lxsession"
if [ -d "$conf/LXDE" ] && [ ! -e "$conf/LXTaz" ]; then
	ln -s LXDE "$conf/LXTaz"
fi

# Session bus, when the login manager did not start one
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
	eval $(dbus-launch --sh-syntax --exit-with-session)
fi

exec lxsession -s LXTaz -e LXTaz
