Skip to content

Commit 9c0ac7d

Browse files
author
psadi
committed
fix: fallback to x11 gdk backend on error
1 parent ef94ea8 commit 9c0ac7d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ repos:
2929
- repo: https://github.com/rhysd/actionlint
3030
rev: v1.7.6
3131
hooks:
32-
- id: actionlint-system
32+
- id: actionlint
3333

3434
- repo: https://github.com/woodruffw/zizmor
35-
rev: v0.5.0
35+
rev: v0.8.0
3636
hooks:
3737
- id: zizmor
3838
files: ^\.github/workflows/.*\.ya?ml$

build.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,17 @@ HERE="$(dirname "$(readlink -f "$0")")"
7575
export TERM=xterm-256color
7676
export GHOSTTY_RESOURCES_DIR="${HERE}/usr/share/ghostty"
7777
78-
exec "${HERE}"/ld-linux-x86-64.so.2 --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@"
78+
79+
command=("${HERE}/ld-linux-x86-64.so.2" --library-path "${HERE}/usr/lib" "${HERE}/usr/bin/ghostty" "$@")
80+
81+
# Check if WAYLAND_DISPLAY is set, attempt normally or fallback GDK_BACKEND to x11
82+
if [ -z "$WAYLAND_DISPLAY" ]; then
83+
if ! "${command[@]}"; then
84+
GDK_BACKEND=x11 "${command[@]}"
85+
fi
86+
else
87+
"${command[@]}"
88+
fi
7989
EOF
8090

8191
chmod +x AppRun

0 commit comments

Comments
 (0)