Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
18 changes: 18 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,22 @@ if [ ! -f ${FIRST_RUN} ]; then
touch ${FIRST_RUN}
fi

if [ ! -f ${FIRST_RUN} ]; then
WARNING_FILE="/app/share/vscode/flatpak-warning.txt"
touch ${FIRST_RUN}
fi
Comment on lines +18 to +21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is defined few lines above


if [[ $XDG_SESSION_TYPE == "wayland" && -e "$XDG_RUNTIME_DIR/$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 +84,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}
1 change: 1 addition & 0 deletions com.visualstudio.code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ finish-args:
- --share=network
- --share=ipc
- --socket=x11
- --socket=wayland
- --socket=pulseaudio
- --socket=ssh-auth
- --device=all
Expand Down