Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
executable file 19 lines (14 sloc) 733 Bytes
#!/bin/sh
set -oue pipefail
export FLATPAK_ID="${FLATPAK_ID:-md.obsidian.Obsidian}"
export TMPDIR="${XDG_RUNTIME_DIR}/app/${FLATPAK_ID}"
# Wayland support can be optionally enabled like so:
# flatpak override --user --env=OBSIDIAN_USE_WAYLAND=1 md.obsidian.Obsidian
declare -i OBSIDIAN_USE_WAYLAND="${OBSIDIAN_USE_WAYLAND:-0}"
declare -i EXIT_CODE=0
if [[ "${OBSIDIAN_USE_WAYLAND}" -eq 1 && "${XDG_SESSION_TYPE}" == "wayland" ]]; then
zypak-wrapper /app/obsidian --enable-features=UseOzonePlatform --ozone-platform=wayland $@ || EXIT_CODE=$?
# Fall back to x11 if Obsidian failed to launch under Wayland. Otherwise, exit normally
[[ "${EXIT_CODE}" -ne 133 ]] && exit "${EXIT_CODE}"
fi
zypak-wrapper /app/obsidian $@