-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vine): begin implementation of wayland support
- Loading branch information
Showing
13 changed files
with
187 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2023 Ho Kim ([email protected]). All rights reserved. | ||
# Use of this source code is governed by a GPL-3-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# Prehibit errors | ||
set -e -o pipefail | ||
# Verbose | ||
set -x | ||
|
||
# Configure environment variables | ||
echo "export MOZ_ENABLE_WAYLAND=\"1\"" >>"${__ENV_HOME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2024 Ho Kim ([email protected]). All rights reserved. | ||
# Use of this source code is governed by a GPL-3-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# Prehibit errors | ||
set -e -o pipefail | ||
# Verbose | ||
set -x | ||
|
||
# Configure environment variables | ||
export DISPLAY="${DISPLAY:-:0}" | ||
export WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}" | ||
|
||
echo "export DISPLAY=\"${DISPLAY}\"" >>"${__ENV_HOME}" | ||
# FIXME: Vulkan support is not stable on Wayland backend | ||
# echo "export WAYLAND_DISPLAY=\"${WAYLAND_DISPLAY}\"" >>"${__ENV_HOME}" | ||
|
||
# Create an empty X11 socket directory, if not exists | ||
mkdir -p "/tmp/.X11-unix" | ||
|
||
# Create a xwayland session, if not exists | ||
if [ ! -S "/tmp/.X11-unix/X$(echo $DISPLAY | grep -Po '[0-9]+$')" ]; then | ||
# Configure wayland | ||
WAYLAND_BACKEND_RDP='rdp-backend.so' | ||
|
||
WAYLAND_ARGS="${WAYLAND_ARGS} --shell=kiosk-shell.so" | ||
# FIXME: Vulkan support is not stable on Wayland backend | ||
# WAYLAND_ARGS="${WAYLAND_ARGS} --socket=${WAYLAND_DISPLAY}" | ||
WAYLAND_ARGS="${WAYLAND_ARGS} --xwayland" | ||
WAYLAND_BACKEND="${WAYLAND_BACKEND:-$WAYLAND_BACKEND_RDP}" | ||
|
||
# Configure RDP | ||
if [ "x${WAYLAND_BACKEND}" == "x${WAYLAND_BACKEND_RDP}" ]; then | ||
# Generate a TLS key pair | ||
WAYLAND_RDP_TLS_HOME="${HOME}/.rdp" | ||
if [ ! -f "${WAYLAND_RDP_TLS_HOME}/${HOSTNAME}.crt" ] || | ||
[ ! -f "${WAYLAND_RDP_TLS_HOME}/${HOSTNAME}.key" ]; then | ||
mkdir -p "${WAYLAND_RDP_TLS_HOME}" | ||
chmod 700 "${WAYLAND_RDP_TLS_HOME}" | ||
winpr-makecert -rdp -path "${WAYLAND_RDP_TLS_HOME}" >/dev/null | ||
fi | ||
|
||
# Register the RDP TLS key pair | ||
WAYLAND_ARGS="${WAYLAND_ARGS} --rdp-tls-cert ${WAYLAND_RDP_TLS_HOME}/${HOSTNAME}.crt" | ||
WAYLAND_ARGS="${WAYLAND_ARGS} --rdp-tls-key ${WAYLAND_RDP_TLS_HOME}/${HOSTNAME}.key" | ||
fi | ||
|
||
# Detect GPU Devices | ||
if nvidia-smi >/dev/null 2>/dev/null; then | ||
export __GLX_VENDOR_LIBRARY_NAME="nvidia" | ||
export __NV_PRIME_RENDER_OFFLOAD="1" | ||
export VK_DRIVER_FILES="/usr/share/vulkan/icd.d/nvidia_icd.json" | ||
export VK_ICD_FILENAMES="${VK_DRIVER_FILES}" | ||
|
||
# Make these environment variables persistent | ||
echo "export __GLX_VENDOR_LIBRARY_NAME=\"${__GLX_VENDOR_LIBRARY_NAME}\"" >>"${__ENV_HOME}" | ||
echo "export __NV_PRIME_RENDER_OFFLOAD=\"${__NV_PRIME_RENDER_OFFLOAD}\"" >>"${__ENV_HOME}" | ||
echo "export VK_DRIVER_FILES=\"${VK_DRIVER_FILES}\"" >>"${__ENV_HOME}" | ||
echo "export VK_ICD_FILENAMES=\"${VK_ICD_FILENAMES}\"" >>"${__ENV_HOME}" | ||
fi | ||
|
||
weston --backend="${WAYLAND_BACKEND}" ${WAYLAND_ARGS} & | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2024 Ho Kim ([email protected]). All rights reserved. | ||
# Use of this source code is governed by a GPL-3-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# Prehibit errors | ||
set -e -o pipefail | ||
# Verbose | ||
set -x | ||
|
||
# Configure environment variables | ||
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}" | ||
|
||
# Make these environment variables persistent | ||
echo "export XDG_RUNTIME_DIR=\"${XDG_RUNTIME_DIR}\"" >>"${__ENV_HOME}" | ||
|
||
# Create an empty XDG runtime directory, if not exists | ||
mkdir -p "${XDG_RUNTIME_DIR}" | ||
chmod 700 "${XDG_RUNTIME_DIR}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.