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