diff --git a/code.sh b/code.sh index de8d0ec..b89d78a 100755 --- a/code.sh +++ b/code.sh @@ -4,6 +4,7 @@ set -e shopt -s nullglob FIRST_RUN="${XDG_CONFIG_HOME}/flatpak-vscode-first-run" +WAYLAND_OPTS="" function msg() { echo "flatpak-vscode: $*" >&2 @@ -14,6 +15,17 @@ if [ ! -f ${FIRST_RUN} ]; then touch ${FIRST_RUN} fi +if [[ $XDG_SESSION_TYPE == "wayland" && -e "$WAYLAND_DISPLAY" ]] +then + WAYLAND_OPTS="$WAYLAND_OPTS --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer" + if [ -c /dev/nvidia0 ] + then + WAYLAND_OPTS="$WAYLAND_OPTS --disable-gpu-sandbox" + fi +else + WAYLAND_OPTS="$WAYLAND_OPTS --enable-features=WebRTCPipeWireCapturer" +fi + PYTHON_SITEDIR=$(python3 <