emacs: remove use of makeDesktopItem

Can generate the file directly to avoid the dependency on the
`makeDesktopItem` API.
This commit is contained in:
Robert Helgesson 2020-10-22 21:52:22 +02:00
parent 77913ff17e
commit 18429f1d1d
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 26 additions and 27 deletions

View file

@ -10,24 +10,24 @@ let
emacsVersion = getVersion emacsCfg.finalPackage;
# Adapted from upstream emacs.desktop
clientDesktopItem = pkgs.makeDesktopItem rec {
name = "emacsclient";
desktopName = "Emacs Client";
genericName = "Text Editor";
comment = "Edit text";
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 = "${emacsBinPath}/emacsclient ${
clientDesktopItem = pkgs.writeTextDir "share/applications/emacsclient.desktop"
(generators.toINI { } {
"Desktop Entry" = {
Type = "Application";
Exec = "${emacsBinPath}/emacsclient ${
concatStringsSep " " cfg.client.arguments
} %F";
icon = "emacs";
type = "Application";
terminal = "false";
categories = "Utility;TextEditor;";
extraEntries = ''
StartupWMClass=Emacs
'';
Terminal = false;
Name = "Emacs Client";
Icon = "emacs";
Comment = "Edit text";
GenericName = "Text Editor";
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++;";
Categories = "Utility;TextEditor;";
StartupWMClass = "Emacs";
};
});
# Match the default socket path for the Emacs version so emacsclient continues
# to work without wrapping it. It might be worthwhile to allow customizing the

View file

@ -1,12 +1,11 @@
[Desktop Entry]
Type=Application
Exec=@emacs@/bin/emacsclient -c %F
Terminal=false
Name=Emacs Client
Icon=emacs
Comment=Edit text
GenericName=Text Editor
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++;
Categories=Utility;TextEditor;
Comment=Edit text
Exec=@emacs@/bin/emacsclient -c %F
GenericName=Text Editor
Icon=emacs
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++;
Name=Emacs Client
StartupWMClass=Emacs
Terminal=false
Type=Application