#!/usr/bin/sh

# Add sddm config file to the arguments 
set -- --config /etc/sway/sddm-greeter.config "$@"

# Try to use a wrapper script from sway-config-fedora
if [ -x /usr/bin/start-sway ]; then
    # shellcheck source=../sway/start-sway
    . /usr/bin/start-sway
    # unreachable
    exit 1
fi

# Set some compatibility variables in case if sway-config-fedora is not present
if systemd-detect-virt --quiet --vm; then
    export WLR_NO_HARDWARE_CURSORS=1
    export WLR_RENDERER=pixman
fi

exec /usr/bin/sway "$@"
