2024-01-12 09:13:17 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-04-15 09:57:54 +02:00
|
|
|
# TODO! Enable wayland support by swapping x11 with auto! Currently broken.
|
|
|
|
# https://github.com/microsoft/vscode/issues/202072
|
|
|
|
|
2024-01-12 09:13:17 +01:00
|
|
|
set -x
|
2024-04-15 09:57:54 +02:00
|
|
|
if [ -f /usr/bin/code ]; then
|
2024-08-04 08:00:48 +02:00
|
|
|
/usr/bin/code --verbose --enable-features=WaylandWindowDecorations,UseOzonePlatform --ozone-platform=wayland "$@"
|
2024-04-15 09:57:54 +02:00
|
|
|
|
|
|
|
elif [ -f /snap/bin/code ]; then
|
|
|
|
# https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1951491/comments/104
|
|
|
|
#unset DBUS_SESSION_BUS_ADDRESS
|
|
|
|
# https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1951491/comments/105
|
|
|
|
#export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
|
2024-08-04 08:00:48 +02:00
|
|
|
snap run code --verbose --enable-features=WaylandWindowDecorations,UseOzonePlatform --ozone-platform=x11 "$@"
|
2024-04-15 09:57:54 +02:00
|
|
|
|
|
|
|
elif [ -f ~/.local/share/flatpak/exports/bin/run/com.visualstudio.code ]; then
|
2024-08-04 08:00:48 +02:00
|
|
|
flatpak run --user com.visualstudio.code --verbose --no-sandbox --ozone-platform=x11 --enable-features=WaylandWindowDecorations "$@"
|
2024-04-15 09:57:54 +02:00
|
|
|
|
|
|
|
elif [ -f ~/.local/share/flatpak/exports/bin/run/com.visualstudio.code ]; then
|
2024-08-04 08:00:48 +02:00
|
|
|
flatpak run com.visualstudio.code --verbose --no-sandbox --ozone-platform=x11 --enable-features=WaylandWindowDecorations "$@"
|
2024-04-15 09:57:54 +02:00
|
|
|
|
|
|
|
else
|
|
|
|
echo "code not found :("
|
|
|
|
fi
|
2024-01-12 09:13:17 +01:00
|
|
|
set +x
|