diff options
author | Artemis Everfree <artemis@artemis.sh> | 2024-01-02 22:29:40 -0800 |
---|---|---|
committer | Artemis Everfree <artemis@artemis.sh> | 2024-01-02 22:29:40 -0800 |
commit | 47d6aa9a9b0f1005f4fd592e6d6372c6f18b606d (patch) | |
tree | a57c28db66a28412301adcb03b17d349e7d7c9c3 /app-office | |
parent | app-backup/pika-backup: drop 0.6.1 (diff) | |
download | guru-47d6aa9a9b0f1005f4fd592e6d6372c6f18b606d.tar.gz guru-47d6aa9a9b0f1005f4fd592e6d6372c6f18b606d.tar.bz2 guru-47d6aa9a9b0f1005f4fd592e6d6372c6f18b606d.zip |
app-office/obsidian: Provide X11 and Wayland .desktop files together
For some users, Obsidian works fine with native wayland. For others, it
crashes. See https://bugs.gentoo.org/915899
To make this easier for users to deal with, provide both .desktop files
in the installation so they can switch between them to see what works.
Warn during install that they should try this if they see crashes.
Signed-off-by: Artemis Everfree <artemis@artemis.sh>
Diffstat (limited to 'app-office')
-rw-r--r-- | app-office/obsidian/obsidian-1.4.16-r1.ebuild (renamed from app-office/obsidian/obsidian-1.4.16.ebuild) | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/app-office/obsidian/obsidian-1.4.16.ebuild b/app-office/obsidian/obsidian-1.4.16-r1.ebuild index b07d924ff..8baafd637 100644 --- a/app-office/obsidian/obsidian-1.4.16.ebuild +++ b/app-office/obsidian/obsidian-1.4.16-r1.ebuild @@ -31,7 +31,7 @@ LICENSE="Obsidian-EULA" SLOT="0" KEYWORDS="~amd64 ~arm64" -IUSE="appindicator wayland" +IUSE="appindicator" RDEPEND=" >=app-accessibility/at-spi2-core-2.46.0:2 @@ -97,11 +97,38 @@ src_prepare() { pushd "${S_OBSIDIAN}/locales/" >/dev/null || die "location change for language cleanup failed" chromium_remove_language_paks popd >/dev/null || die "location reset for language cleanup failed" - if use wayland; then - sed -i '/Exec/s/obsidian/obsidian --ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations/' \ - "usr/share/applications/obsidian.desktop" || - die "sed failed for wayland" - fi + + # Create separate .desktop file for launching Obsidian with native wayland + # support. + # + # Obsidian is an Electron app, and Electron can be instructed to run in + # native-wayland mode by turning on the Ozone platform. However, doing this + # causes Obsidian to crash on some users' systems, while it works fine for + # others. (see https://bugs.gentoo.org/915899) + # + # It appears VSCode may have encountered a similar issue, because VSCode + # installs two separate .desktop files, one for launching with wayland + # support and one for launching without. We will do the same here. + + # Create a copy of upstream's .desktop + cp usr/share/applications/obsidian.desktop \ + usr/share/applications/obsidian-wayland.desktop \ + || die "failed to create obsidian-wayland.desktop file" + + # Edit the Exec & Name + sed -i \ + ' + # Add Electron ozone enable flags to obsidian execution + /Exec/s/obsidian /obsidian --ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations / + + # Give this .desktop file a new name/desc of "Obsidian Wayland" + /^Name/s/$/ Wayland/ + + # comment field + /^Comment/s/$/ with Wayland support enabled/ + ' \ + 'usr/share/applications/obsidian-wayland.desktop' || + die "sed failed for obsidian-wayland.desktop file" } src_install() { @@ -133,8 +160,19 @@ src_install() { fi domenu usr/share/applications/obsidian.desktop + domenu usr/share/applications/obsidian-wayland.desktop for size in 16 32 48 64 128 256 512; do doicon --size ${size} usr/share/icons/hicolor/${size}x${size}/apps/${PN}.png done } + +pkg_postinst() { + ewarn "Some users have reported that running Obsidian with native Wayland" + ewarn "support causes the software to crash. Others have it working" + ewarn "without issue. See https://bugs.gentoo.org/915899" + ewarn "" + ewarn "This package now provides application entries for both Obsidian and" + ewarn "Obsidian Wayland. If Obsidian Wayland breaks for you under Wayland," + ewarn "try the other Obsidian entry to launch with XWayland" +} |