emacs/emacs-desktop.sh
Peter Oliver 6a39a2112e Switch the default emacs binary to pure-GTK, suitable for Wayland
Rename the old default hybrid GTK/X11 binary to `emacs-gtk+x11`.
2023-09-25 19:23:31 +01:00

20 lines
493 B
Bash
Executable File

#!/bin/sh
# The pure GTK build of emacs is not supported on X11, so try to avoid
# using if there is an alternative.
if [ "$XDG_SESSION_TYPE" = 'x11' ]; then
emacs="$(readlink -f /usr/bin/emacs)"
emacs="${emacs##*/}"
emacs="${emacs%-*.*.*}"
if [ "$emacs" = 'emacs' ]; then
if type emacs-gtk+x11 >/dev/null; then
exec emacs-gtk+x11 "$@"
elif type emacs-lucid >/dev/null; then
exec emacs-lucid "$@"
fi
fi
fi
exec emacs "$@"