Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
19 lines (14 sloc)
733 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 $@ |