Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <<EOFPYTHON
import os
import site
Expand Down Expand Up @@ -67,4 +79,5 @@ fi
exec env ELECTRON_RUN_AS_NODE=1 PATH="${PATH}:${XDG_DATA_HOME}/node_modules/bin" \
/app/bin/zypak-wrapper.sh /app/extra/vscode/code /app/extra/vscode/resources/app/out/cli.js \
--ms-enable-electron-run-as-node --extensions-dir=${XDG_DATA_HOME}/vscode/extensions \
${WAYLAND_OPTS} \
"$@" ${WARNING_FILE}
3 changes: 2 additions & 1 deletion com.visualstudio.code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ finish-args:
- --require-version=0.10.3
- --share=network
- --share=ipc
- --socket=x11
- --socket=wayland
- --socket=fallback-x11
- --socket=pulseaudio
- --socket=ssh-auth
- --device=all
Expand Down