blob: 145fffbd56f298b6856b3de9a24640ca34e2b6b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/sh
# launch a text editor
exec_editor() {
if [ -n "$1" ] && [ $(basename "$1") != "editor" ] \
&& which "$1" > /dev/null 2>&1
then
exec "$@"
fi
}
exec_editor "$TEXTEDITOR" "$@"
exec_editor "$VISUAL" "$@"
exec_editor "$EDITOR" "$@"
[ -n "$GNOME_DESKTOP_SESSION_ID" ] && exec_editor gedit "$@"
[ -n "$KDE_FULL_SESSION" ] && exec_editor kwrite "$@"
exec_editor kwrite "$@"
exec_editor gedit "$@"
exec_editor emacs "$@"
exec_editor vim "$@"
exec_editor nano "$@"
echo "no text editor detected" >&2
exit 1
|