scripts/bash/usr-local-bin/codium

27 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# TODO! Enable wayland support by swapping x11 with wayland! Currently broken.
# https://github.com/microsoft/vscode/issues/202072
set -x
if [ -f /usr/bin/codium ]; then
/usr/bin/codium --verbose --enable-features=WaylandWindowDecorations,UseOzonePlatform,WebContentsForceDark --ozone-platform=wayland "$@"
elif [ -f /snap/bin/codium ]; 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
snap run codium --verbose --enable-features=WaylandWindowDecorations,UseOzonePlatform,WebContentsForceDark --ozone-platform=x11 "$@"
elif [ -f ~/.local/share/flatpak/exports/bin/run/com.vscodium.codium ]; then
flatpak run --user com.vscodium.codium --verbose --no-sandbox --ozone-platform=x11 --enable-features=WaylandWindowDecorations,WebContentsForceDark "$@"
elif [ -f ~/.local/share/flatpak/exports/bin/run/com.vscodium.codium ]; then
flatpak run com.vscodium.codium --verbose --no-sandbox --ozone-platform=x11 --enable-features=WaylandWindowDecorations,WebContentsForceDark "$@"
else
echo "codium not found :("
fi
set +x