mirror of
https://github.com/archlinux/aur.git
synced 2026-02-07 12:41:55 +01:00
* Set`_JAVA_AWT_WM_NONREPARENTING=1 on Wayland to Fix FileBot UI IssueSet `_JAVA_AWT_WM_NONREPARENTING=1` on Wayland to Fix blank FileBot UI Issue This commit addresses an issue where the FileBot window appears blank or grey when running under Wayland. The problem is related to Java's AWT not handling window reparenting correctly in Wayland environments. By setting the `_JAVA_AWT_WM_NONREPARENTING` environment variable to `1`, we can avoid this issue. This workaround is particularly relevant for window managers like Sway. More details can be found in the related bug report: https://github.com/arch-noob/filebot/issues/30. * Update missing export for filebot.sh run * add some comments for sway _JAVA_AWT_WM_NONREPARENTING
76 lines
2.9 KiB
Bash
Executable file
76 lines
2.9 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
FILEBOT_HOME="/usr/share/filebot"
|
|
|
|
# sanity check
|
|
if [ -z "${HOME}" ]; then
|
|
echo "\$HOME must be set"
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$(id -u)" = "0" ]; then
|
|
echo "$0 must NOT run as root"
|
|
fi
|
|
|
|
# select application data folder
|
|
APP_DATA="${HOME}/.config/filebot"
|
|
LIBRARY_PATH="${FILEBOT_HOME}/lib/$(uname -m):/lib64"
|
|
|
|
# Disable wayland and force xwayland
|
|
# workaround for bug https://www.filebot.net/forums/viewtopic.php?t=13567
|
|
# as of 09.03.2024 seems relevant under KDE 6.0 using Wayland and nvidia/amd gpu
|
|
WAYLAND_DISPLAY=
|
|
|
|
# Force _JAVA_AWT_WM_NONREPARENTING for wayland to avoid gray / blank screen
|
|
# see https://github.com/arch-noob/filebot/issues/30 and https://wiki.archlinux.org/title/Java
|
|
# relevant for sway or any other non-opiononated window manager
|
|
if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
fi
|
|
|
|
# shellcheck disable=SC2086
|
|
java \
|
|
-Dapplication.deployment=aur \
|
|
--add-modules ALL-MODULE-PATH \
|
|
-Dnet.filebot.archive.extractor=ShellExecutables \
|
|
--add-opens=java.base/java.lang=ALL-UNNAMED \
|
|
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
|
|
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED \
|
|
--add-opens=java.base/java.util=ALL-UNNAMED \
|
|
--add-opens=java.base/java.util.function=ALL-UNNAMED \
|
|
--add-opens=java.base/java.util.regex=ALL-UNNAMED \
|
|
--add-opens=java.base/java.net=ALL-UNNAMED \
|
|
--add-opens=java.base/java.io=ALL-UNNAMED \
|
|
--add-opens=java.base/java.nio=ALL-UNNAMED \
|
|
--add-opens=java.base/java.nio.file=ALL-UNNAMED \
|
|
--add-opens=java.base/java.nio.file.attribute=ALL-UNNAMED \
|
|
--add-opens=java.base/java.nio.channels=ALL-UNNAMED \
|
|
--add-opens=java.base/java.nio.charset=ALL-UNNAMED \
|
|
--add-opens=java.base/java.time=ALL-UNNAMED \
|
|
--add-opens=java.base/java.time.chrono=ALL-UNNAMED \
|
|
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED \
|
|
--add-opens=java.base/java.text=ALL-UNNAMED \
|
|
--add-opens=java.base/sun.nio.fs=ALL-UNNAMED \
|
|
--add-opens=java.logging/java.util.logging=ALL-UNNAMED \
|
|
--add-opens=java.desktop/java.awt=ALL-UNNAMED \
|
|
--add-opens=java.desktop/sun.awt=ALL-UNNAMED \
|
|
--add-opens=java.desktop/sun.swing=ALL-UNNAMED \
|
|
--add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED \
|
|
--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED \
|
|
-XX:+DisableAttachMechanism \
|
|
-Djna.boot.library.path="${LIBRARY_PATH}" \
|
|
-Djna.boot.library.name=jnidispatch \
|
|
-Djna.library.path="${LIBRARY_PATH}" \
|
|
-Djava.library.path="${LIBRARY_PATH}" \
|
|
-Dapplication.dir="${APP_DATA}" \
|
|
-Dapplication.cache="${APP_DATA}/cache" \
|
|
-Djava.io.tmpdir="${APP_DATA}/tmp" \
|
|
-Dfile.encoding="UTF-8" \
|
|
-Dsun.jnu.encoding="UTF-8" \
|
|
-Dawt.useSystemAAFontSettings=on \
|
|
-Dprism.order=sw \
|
|
-Dnet.filebot.theme=Darcula \
|
|
-DuseGVFS=true \
|
|
-Dnet.filebot.gio.GVFS="${XDG_RUNTIME_DIR}/gvfs" \
|
|
${JVM_OPTS} ${JAVA_OPTS} ${FILEBOT_OPTS} \
|
|
-jar "${FILEBOT_HOME}/jar/filebot.jar" \
|
|
"$@"
|