Tôi đang sử dụng Ubuntu, vì vậy vị trí của tệp máy tính để bàn có thể khác nhau nhưng tôi nghĩ nội dung nên giống nhau.
$ cat ~/.local/share/applications/emacsclient.desktop 
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Name=GNU Emacs 24
GenericName=Text Editor
Comment=View and edit files
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=/usr/bin/emacsclient -c -a "" %F
Icon=/usr/share/icons/hicolor/scalable/apps/emacs-snapshot.svg
Type=Application
Terminal=false
Categories=Utility;Development;TextEditor;
StartupWMClass=Emacs
Name[en_US]=GNU Emacs 24
Phần quan trọng là:
Exec=/usr/bin/emacsclient -c -a "" %F
Để làm rõ điều đó có lẽ nên:
Exec=/usr/bin/emacsclient --create-frame --alternate-editor "" %F
Từ tài liệu về emacsclient, các công tắc đó thực hiện như sau:
-c, --create-frame      Create a new frame instead of trying to
                        use the current Emacs frame
-a EDITOR, --alternate-editor=EDITOR
                        Editor to fallback to if the server is not running
                        If EDITOR is the empty string, start Emacs in daemon
                        mode and try connecting again
Vì vậy, nó tạo một khung mới bằng cách sử dụng -cvà sau đó nếu emacs chưa được daemon hóa, nó bắt đầu một daemon emacs mới với -a "". Cuối cùng, %Fbản sửa lỗi để bạn có thể kéo tệp văn bản vào biểu tượng và nó sẽ mở nó.
Cũng như một bên bạn cũng có thể xem xét bao gồm -F "((fullscreen . maximized))"để buộc khung hình tối đa hóa khi khởi chạy. Thật không may, tôi không thể nhớ phiên bản nào của emacs được yêu cầu để nó hoạt động.