Код: Выделить всё
#!/bin/sh
s=$(ps -eo "%a" | grep -v grep | grep /usr/bin/emacs)
if [ ${#s} -eq 0 ] && [ ! "$1" = "-fs" ]
then
/usr/bin/emacs --daemon
sleep 3
fi
if [ ${#s} -eq 0 ] && [ "$1" = "-fs" ]
then
/usr/bin/emacs --eval "(server-start)" -fs &
shift 1
sleep 3
fi
if [ ! $# -eq 0 ] && echo "$s" | grep -q "/usr/bin/emacs --daemon"
then emacsclient -c -F "((fullscreen . fullboth))" "$1"
else emacsclient -e '(find-file "'"$1"'")'
fi
exit
Пинать можно))