(Re)Create .desktop file using Project Options? lazarus / 6-IDE-CodeTools ---------------------------------------------------------------------- dsiders · 2024-06-23 17:50 The idea is to add a frame to Project Options which enables creation (or recreation) of the .desktop file on supported platforms when the project is built. The major Linux DEs (Gnome and KDE) seem to be reliant on them. Not sure what macOS or other platforms require. The frame / page could contain edit controls for the required and optional name/value pairs in the Desktop Entry Specification (https://specifications.freedesktop.org/desktop-entry-spec/desktop- entry-spec-latest.html). It could write the .desktop file to the same directory as the executable when the project is built. Obviously the IDE and LazBuild (and make files?) would need to support the new feature. I convinced myself that this was a good idea. But I am relatively new to the Linux environment, I realize it is just an INI-style file... but it would be convenient to automate it. Is there an existing tool or mechanism to do this already? I could not find one... ---------------------------------------------------------------------- MarkMLl · 2024-06-23 18:37 I agree that it would be a useful thing to have, provision of .desktop file editors is... erratic. I suggest familiarising yourself with the various related programs: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ apropos xdg exmendis (1)         - enable or disable extra menus for GNOME, KDE and other XDG menu-spec compliant desktopsexmenen (1)          - enable or disable extra menus for GNOME, KDE and other XDG menu-spec compliant desktopssystemd-xdg-autostart-generator (8) - User unit generator for XDG autostart filesuser-dirs.conf (5)   - configuration for xdg-user-dirs-updateuser-dirs.defaults (5) - default settings for XDG user dirsuser-dirs.dirs (5)   - settings for XDG user dirsxdg- dbus-proxy (1)   - D-Bus proxyxdg-desktop-icon (1) - command line tool for (un)installing icons to the desktopxdg-desktop-menu (1) - command line tool for (un)installing desktop menu itemsxdg-email (1)        - command line tool for sending mail using the user's preferred e-mail composerxdg-icon-resource (1) - command line tool for (un)installing icon resourcesxdg-mime (1)         - command line tool for querying information about file type handling and adding descriptions for new file typesxdg-open (1)         - opens a file or URL in the user's preferred applicationxdg-screensaver (1)  - command line tool for controlling the screensaverxdg-settings (1)     - get various settings from the desktop environmentxdg-user-dir (1)     - Find an XDG user dirxdg-user-dirs-update (1) - Update XDG user dir configuration  MarkMLl ---------------------------------------------------------------------- dsiders · 2024-06-23 19:17 Quote from: MarkMLl on June 23, 2024, 08:37:51 pmI agree that it would be a useful thing to have, provision of .desktop file editors is... erratic. I was only considering creation... not deployment. Like the path for the executable, that's hard to automate for the various Linuxes . Quote from: MarkMLl on June 23, 2024, 08:37:51 pmI suggest familiarising yourself with the various related programs: Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ apropos xdg(elided)  XDG seems to be a lot like Wayland.... very good at creating specifications that they don't have to implement. Useful links, I'll add those to my retirement reading list. ---------------------------------------------------------------------- MarkMLl · 2024-06-23 20:02 Quote from: dsiders on June 23, 2024, 09:17:36 pmXDG seems to be a lot like Wayland.... very good at creating specifications that they don't have to implement. No, that stuff's important. What they've done is said "Right, this is the functionality that a desktop will probably need. Format the command lines like this..." and various distreaux have, by and large, complied with their own implementation. However it's my experience that some of the lesser desktops like LXDE (hence the RPi) quite simply don't have a .desktop editor that a developer can invoke to create the file in the first place. Where does Windows (and for that matter the Mac) stand on this? Is there a concrete file format that can be used to create a shortcut etc.? MarkMLl ---------------------------------------------------------------------- bobby100 · 2024-06-23 20:55 Quote from: MarkMLl on June 23, 2024, 10:02:25 pmWhere does Windows (and for that matter the Mac) stand on this? Is there a concrete file format that can be used to create a shortcut etc.?On Windows, the .lnk files are binary files, but one can use Shell API to create or read .lnk files. ---------------------------------------------------------------------- MarkMLl · 2024-06-23 21:04 Quote from: bobby100 on June 23, 2024, 10:55:20 pmOn Windows, the .lnk files are binary files, but one can use Shell API to create or read .lnk files. OK, so they exist as a file rather than being embedded in the registry or as EAs, and the IDE could decide on the format (i.e. .lnk vs .desktop) based on the binary format. MarkMLl ---------------------------------------------------------------------- duralast · 2024-06-24 01:58 Quote from: MarkMLl on June 23, 2024, 11:04:08 pmOK, so they exist as a file rather than being embedded in the registry MarkMLl .lnk files are in the registry, but the Windows default is not to show them from the NeverShowExt property. ---------------------------------------------------------------------- dbannon · 2024-06-24 02:56 (Linux comments) I consider making a Desktop file more a packaging thing than a building one. In my git tree I have a template desktop file (as shown below) and use sed to edit it as necessary as I build each particular type of package. But the important things remain constant. Code: [Select][Desktop Entry] Name=tomboy-ng Name[de]=tomboy-ng Name[es]=tomboy-ng Name[fr]=tomboy-ng Name[nl]=tomboy-ng Comment=Cross Platform Notes Comment[de]=Notizen Plattformübergreifend Comment[es]=Notas Multiplatforma Comment[fr]=Notes Multiplateforme Comment[nl]=Platformoverschrijdend notities GenericName=Note Taker GenericName[de]=Notizanwendung GenericName[es]=Tomador de apuntes GenericName[fr]=Application de prise de notes GenericName[nl]=Notities maken Exec=env QT_QPA_PLATFORM=xcb tomboy-ng %f Icon=/usr/share/icons/hicolor/256x256/apps/tomboy-ng.png Terminal=false Type=Application Categories=GNOME;Utility Keywords=notes; It has a number of lines that are subject to i18n so that would need be considered in a build model. The executable, depending on packaging, is typically found in the PATH so thats easy, an icon is necessary, packaging says that belongs in /usr/share/icons/ but that requires root access to install. Its also reasonable to put that icon in (eg) $HOME/.icons and the Desktop file in $HOME/.local/share/applications/ (and system will look for it there) but that conflicts with the idea that an "install" is multiuser.  So, its a solution for a DIY install script, not a formal package. So, Don's "make a desktop" form can - get executable name from the Lazarus project, offer to use executable name as application name, request a Comment and Generic Name (and push those to the i18n pot file) suggest an icon location Suggest Terminal is false for GUI app request Categories request Keywords (and push that to the i18n pot file) Maybe, just maybe, a button to put desktop file and an icon in the (local) appropriate places ??? Note that I set an environment variable, QT_QPA_PLATFORM=xcb in the Exec line, thats needed for a Qt5 app (else some things don't work under Wayland) and does no harm for a gtk2 app. A big, strong warning that a desktop file in your source tree is of no use at all. It must go into either  $HOME/.local/share/applications/  or /usr/share/applications/ to be used. I see lots of messages to the forum "I made a desktop file but it gets ignored" A desktop file is not absolutely necessary but does a heap of good things. Automatically (when installed) shows up in menu system Defines what Icon is associated with the app. Allows running the app in a predetermined environment or with predefined options. Such as my 'xcb' above. is observed by any menu (or menu like) launch or from the command line with, eg, $> gtk-launch myapp [enter} I think its a good idea Don, we already do something vaguely similar for Mac users with the app bundle. Davo Phew ! I hate long posts, sorry ! ---------------------------------------------------------------------- bobby100 · 2024-06-24 04:14 Quote from: duralast on June 24, 2024, 03:58:28 amQuote from: MarkMLl on June 23, 2024, 11:04:08 pmOK, so they exist as a file rather than being embedded in the registry MarkMLl .lnk files are in the registry, but the Windows default is not to show them from the NeverShowExt property. You are making confusion. Files are on the physical media (hdd etc), but the file extensions are displayed or not according to the settings in the registry. @dbannon my .desktop file is like this: Code: [Select]Name=MiniDexed Control Center Version=1.0 Exec=MiniDexedCC Comment=Librarian/Editor for MiniDexed Icon=MiniDexedCC.png Type=Application Terminal=false StartupNotify=true Encoding=UTF-8 Categories=Utility;where the icons are in /usr/share/pixmaps and the app in /usr/bin and it works fine on Linux Mint. I use Debreate for packaging, and this is the file created by Debreate ---------------------------------------------------------------------- MarkMLl · 2024-06-24 06:16 Quote from: duralast on June 24, 2024, 03:58:28 amQuote from: MarkMLl on June 23, 2024, 11:04:08 pmOK, so they exist as a file rather than being embedded in the registry MarkMLl .lnk files are in the registry, but the Windows default is not to show them from the NeverShowExt property. Right, so if they're in the registry they're not files then. Are you saying that, like the old .reg files, they can be used to load stuff into the registry? Because that sounds like what's needed. MarkMLl ---------------------------------------------------------------------- bobby100 · 2024-06-24 14:39 Quote from: MarkMLl on June 24, 2024, 08:16:19 amQuote from: duralast on June 24, 2024, 03:58:28 amQuote from: MarkMLl on June 23, 2024, 11:04:08 pmOK, so they exist as a file rather than being embedded in the registry MarkMLl .lnk files are in the registry, but the Windows default is not to show them from the NeverShowExt property. Right, so if they're in the registry they're not files then. Are you saying that, like the old .reg files, they can be used to load stuff into the registry? Because that sounds like what's needed. MarkMLl No. Read my previous post. LNK files are not imported into registry. LNK files are open and executed by the shell (Windows Explorer). In LNK file you can put a path to an executable, or you can put a URL, or or or, and it will be open by the shell just like clicking on files in Explorer - it will be open with an associated app according to the extension of the link inside the LNK file. Here is the code I use to create LNK files (code source: internet): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses ...shlobj, activex, comobj.... procedure CreateDesktopShortCut(LinkName: WideString;  WorkDir, Target, TargetArguments, Description, IconPath: string; IconIndex: integer);var  IObject: IUnknown;  ISLink: IShellLink;  IPFile: IPersistFile;begin  IObject := CreateComObject(CLSID_ShellLink);  ISLink := IObject as IShellLink;  IPFile := IObject as IPersistFile;  ISLink.SetPath(PChar(Target));  ISLink.SetArguments(PChar(TargetArguments));  ISLink.SetWorkingDirectory(PChar(WorkDir));  ISLink.SetDescription(PChar(Description));  ISLink.SetIconLocation(PChar(IconPath), IconIndex);  IPFile.Save(PWChar(LinkName), False);end; ---------------------------------------------------------------------- rca · 2024-06-24 17:42 Or you can check out the source code for fpcupdeluxe, which creates desktop shortcuts within Windows, Linux, or Mac Os. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/blob/fdef17b59377fe6a0 b113c9a685781410aca6d20/sources/fpcuputil.pas#L994 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$IFDEF MSWINDOWS}procedure CreateDesktopShortCut(const Target, TargetArguments, ShortcutName: string; const AddContext:boolean);var  IObject: IUnknown;  ISLink: IShellLink;  IPFile: IPersistFile;  PIDL: PItemIDList;  InFolder: array[0..MAX_PATH] of Char;  LinkName: WideString;begin  { Creates an instance of IShellLink }  IObject := CreateComObject(CLSID_ShellLink);  ISLink := IObject as IShellLink;  IPFile := IObject as IPersistFile;   ISLink.SetPath(pChar(Target));  ISLink.SetArguments(pChar(TargetArguments));  ISLink.SetWorkingDirectory(pChar(ExtractFilePath(Target)));   { Get the desktop location }  SHGetSpecialFolderLocation(0, CSIDL_DESKTOPDIRECTORY, PIDL);  SHGetPathFromIDList(PIDL, InFolder);  LinkName := IncludeTrailingPathDelimiter(InFolder) + ShortcutName+'.lnk';   { Get rid of any existing shortcut first }  SysUtils.DeleteFile(LinkName);   { Create the link }  IPFile.Save(PWChar(LinkName), false);end;{$ELSE}{$IFDEF DARWIN}procedure CreateDesktopShortCut(const Target, TargetArguments, ShortcutName: string; const AddContext:boolean);begin  // Create shortcut on Desktop and in Applications  fpSystem(    '/usr/bin/osascript << EOF'+#10+    'tell application "Finder"'+#10+    'set myLazApp to POSIX file "'+IncludeLeadingPathDelimiter(Target)+'.app" as alias'+#10+      'try'+#10+          'set myLazDeskShort to (path to desktop folder as string) & "'+ShortcutName+'" as alias'+#10+          'on error'+#10+           'make new alias to myLazApp at (path to desktop folder as text)'+#10+             'set name of result to "'+ShortcutName+'"'+#10+      'end try'+#10+      'try'+#10+          'set myLazAppShort to (path to applications folder as string) & "'+ShortcutName+'" as alias'+#10+          'on error'+#10+             'make new alias to myLazApp at (path to applications folder as text)'+#10+             'set name of result to "'+ShortcutName+'"'+#10+      'end try'+#10+     'end tell'+#10+    'EOF');end;{$ELSE}{$IFDEF UNIX}procedure CreateDesktopShortCut(const Target, TargetArguments, ShortcutName: string; const AddContext:boolean);var  OperationSucceeded: boolean;  XdgDesktopContent: TStringList;  XdgMimeContent: TStringList;  Output,XdgDesktopFile,XdgMimeFile: string;  aDirectory:string;  aIconFile:string;begin  {$ifdef Haiku}  exit;  {$endif}   // Fail by default:  OperationSucceeded:=false;   XdgDesktopFile:=IncludeTrailing PathDelimiter(GetTempDir(false))+'fpcup-'+shortcutname+'.desktop';  XdgDesktopContent:=TStringList.Create;  try    XdgDesktopContent.Add('[Desktop Entry]');    XdgDesktopContent.Add('Version=1.0');    XdgDesktopContent.Add('Encoding=UTF-8');    XdgDesktopContent.Add('Type=Application');    aIconFile:='';    {$ifdef LINUX}    aIconFile:=ExtractFilePath(Target)+'images/icons/lazarus128x128.png';    if (NOT FileExists(aIconFile)) then aIconFile:=ExtractFilePath(Target)+'images/icons/lazarus32x32.png';  if (NOT FileExists(aIconFile)) then aIconFile:=ExtractFilePath(Target)+'images/icons/lazarus.png';    {$endif}    if (Length(aIconFile)=0) OR (NOT FileExists(aIconFile)) then aIconFile:=ExtractFilePath(Target)+'images/icons/lazarus.ico';  XdgDesktopContent.Add('Icon='+aIconFile);    XdgDesktopContent.Add('Path='+ExtractFilePath(Target));    {$ifdef DISABLE_PPC_CONFIG_PATH}    XdgDesktopContent.Add('Exec=env -u PPC_CONFIG_PATH '+Target+' '+TargetArguments+' %f');    {$else}    XdgDesktopContent.Add('Exec='+Target+' '+TargetArguments+' %f');    {$endif}    XdgDesktopContent.Add('Name='+ShortcutName);    XdgDesktopContent.Add('GenericName=Lazarus IDE with Free Pascal Compiler');    XdgDesktopContent.Add('Category=Application;IDE;Develop ment;GUIDesigner;Programming;');    XdgDesktopContent.Add('Categories= Application;IDE;Development;GUIDesigner;Programming;');    XdgDesktopC ontent.Add('Keywords=editor;Pascal;IDE;FreePascal;fpc;Design;Designer; ');     if AddContext then    begin      //XdgDesktopContent.Add('StartupWMClass=Lazarus');      XdgDesktopContent.Add('MimeType=application/x-lazarus;');      //XdgDe sktopContent.Add('Patterns=*.pas;*.pp;*.p;*.inc;*.lpi;*.lpk;*.lpr;*.lf m;*.lrs;*.lpl;');    end;     // We're going to try and call xdg- desktop-icon/menu    // this may fail if shortcut exists already    try      XdgDesktopContent.SaveToFile(XdgDesktopFile);      FpChmod(XdgDesktopFile, &711); //rwx--x--x      OperationSucceeded:=RunCommand('xdg-desktop-icon' ,['install','-- novendor',XdgDesktopFile],Output,[poUsePipes, poStderrToOutPut]{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)},swoHide{$ENDIF});      OperationSucceeded:=RunCommand('xdg- desktop-menu' ,['install','-- novendor',XdgDesktopFile],Output,[poUsePipes, poStderrToOutPut]{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)},swoHide{$ENDIF});    except      OperationSucceeded:=false;  end;     if (true) then    begin      aDirectory:=ConcatPaths(['usr','share','applications']);      if ( (FpGeteuid=0) AND DirectoryExists(aDirectory) ) then      begin      FileCopy(XdgDesktopFile,aDirectory+DirectorySeparator+ExtractFileName( XdgDesktopFile),[]);      end      else      begin        // Create shortcut directly on User-Desktop        aDirectory:=ConcatPaths([GetUserDir,'Desktop']);        if DirectoryExists(aDirectory) then           FileCopy(XdgDesktopFile,aDi rectory+DirectorySeparator+ExtractFileName(XdgDesktopFile),[]);      // Create user menu item        if (NOT OperationSucceeded) then      begin          aDirectory:=ConcatPaths([GetUserDir,'.local','share',' applications']);          if DirectoryExists(aDirectory) then          FileCopy(XdgDesktopFile,aDirectory+DirectorySeparator+ExtractFileNam e(XdgDesktopFile),[]);        end;      end;    end;    // Temp file is no longer needed....    try      SysUtils.DeleteFile(XdgDesktopFile);    finally      // Swallow, let filesystem maintenance clear it up    end;  finally    XdgDesktopContent.Free;    OperationSucceeded:=true;  end;   if (OperationSucceeded) then  begin    aDirectory:=ConcatPaths([GetUserDi r,'.local','share','applications']);    OperationSucceeded:=RunCommand('update-desktop-database' ,[aDirectory],Output,[poUsePipes, poStderrToOutPut]{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)},swoHide{$ENDIF});  end;   if AddContext then  begin    ThreadLog('Adding context !');    {$ifdef LCL}    Application.ProcessMessages;    {$endif}     aDirectory:=ConcatPaths([GetUserDir,'.local','share','mime']);    ForceDirectoriesSafe(aDirectory);     //Create mime file associations    XdgMimeFile:=IncludeTrailingPathDelimiter(GetTempDir(false))+'fpcup- '+shortcutname+'.xml';    XdgMimeContent:=TStringList.Create;    try    XdgMimeContent.Add('');      XdgMimeContent.Add('');    XdgMimeContent.Add('    ');    XdgMimeContent.Add('        Lazarus file');      XdgMimeContent.Add('        ');    XdgMimeContent.Add('        ');      XdgMimeContent.Add('        ');      XdgMimeContent.Add('        ');      XdgMimeContent.Add('        ');      XdgMimeContent.Add('        ');      XdgMimeContent.Add('        ');      XdgMimeContent.Add('        ');      XdgMimeContent.Add('    ');      XdgMimeContent.Add('');      aDirectory:=ConcatPaths([GetU serDir,'.local','share','mime','packages']);      ForceDirectoriesSafe(aDirectory);      XdgMimeContent.SaveToFile(XdgMimeFile);      OperationSucceeded:=RunCommand('xdg-mime' ,['install','-- novendor',XdgMimeFile],Output,[poUsePipes, poStderrToOutPut]{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)},swoHide{$ENDIF});      SysUtils.DeleteFile(XdgMimeFile);    finally      XdgMimeContent.Free;    end;     //Process icon    aDirectory:=ConcatPaths([GetUserDir,'.local','share','icons']);    ForceDirectoriesSafe(aDirectory);    //OperationSucceeded:=RunCommand('xdg-icon-resource' ,['install','-- novendor','--context','mimetypes','--size','64',ExtractFilePath(Target )+'images/icons/lazarus.ico','application-x- lazarus'],Output,[poUsePipes, poStderrToOutPut]{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)},swoHide{$ENDIF});    OperationSucceeded:=RunCommand('xdg-icon- resource' ,['install','--novendor','--context','mimetypes','--size','6 4',ExtractFilePath(Target)+'images/icons/lazarus64x64.png','applicatio n-x-lazarus'],Output,[poUsePipes, poStderrToOutPut]{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)},swoHide{$ENDIF});     //Update mime database    aDirectory:=ConcatPaths([GetUserDir,'.local','share','mime']);    OperationSucceeded:=RunCommand('update-mime-database' ,[aDirectory],Output,[poUsePipes, poStderrToOutPut]{$IF DEFINED(FPC_FULLVERSION) AND (FPC_FULLVERSION >= 30200)},swoHide{$ENDIF});  end; end;{$ELSE}procedure CreateDesktopShortCut(const Target, TargetArguments, ShortcutName: string; const AddContext:boolean);begin  ThreadLog('Not creating desktop shortcut: don''t know how to do this.');end;{$ENDIF UNIX}{$ENDIF DARWIN}{$ENDIF MSWINDOWS} ---------------------------------------------------------------------- dsiders · 2024-06-24 23:02 Quote from: rca on June 24, 2024, 07:42:21 pmOr you can check out the source code for fpcupdeluxe, which creates desktop shortcuts within Windows, Linux, or Mac Os. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/blob/fdef17b59377fe6a0 b113c9a685781410aca6d20/sources/fpcuputil.pas#L994 Thanks for the link. More to consider. ---------------------------------------------------------------------- dsiders · 2024-06-26 18:30 After some reflection, I am leaning towards making this a stand-alone tool. I created a prototype. (See attached). Not ready to share code yet. It's not complete. Comments? ---------------------------------------------------------------------- rca · 2024-06-29 05:09 Quote from: dsiders on June 26, 2024, 08:30:39 pmAfter some reflection, I am leaning towards making this a stand-alone tool. I created a prototype. (See attached). Not ready to share code yet. It's not complete. Comments? Looks great! Have you thought about making it work also on Windows and Mac OS? IMHO, as far as possible most fields should be filled with default values, including the icon field... (one can be provided initially) ---------------------------------------------------------------------- dbannon · 2024-06-29 06:21 Looking good Don. Quote from: dsiders on June 26, 2024, 08:30:39 pmAfter some reflection, I am leaning towards making this a stand-alone tool. I created a prototype. (See attached). I understand why. But Lazarus already has, in the project information, quite a bit of what you need to know. Including the i18n stuff. How about making it a Lazarus plugin ?  And, then, a wrapper that will let a version of it stand alone ? But there are other standalone ones (no idea if they are good, I use vim). https://www.florian-diesch.de/software/arronax/  - Linux only, not in the debian repo exo-desktop-item-edit - XFCe only, quite a lot of XFCe dependencies. Davo ---------------------------------------------------------------------- dsiders · 2024-06-29 22:23 Quote from: rca on June 29, 2024, 07:09:32 amQuote from: dsiders on June 26, 2024, 08:30:39 pmAfter some reflection, I am leaning towards making this a stand-alone tool. I created a prototype. (See attached). Not ready to share code yet. It's not complete. Comments? Looks great! Thanks for the feedback. Quote from: rca on June 29, 2024, 07:09:32 amHave you thought about making it work also on Windows and Mac OS? I got started with this because I (as a Linux newbie) couldn't find anything on Linux that was similar to the Create Shortcut option on every File Explorer context menu. Windows doesn't use .desktop, and i see no reason to create yet another way to do a thing can be easily done already. macOS is... well... Apple. I don't own any "rotten fruit"  hardware, so it'd be difficult to test anything. And the code example in the previous replies tells me I don't want to get involved. Quote from: rca on June 29, 2024, 07:09:32 amIMHO, as far as possible most fields should be filled with default values, including the icon field... (one can be provided initially) If you talking about the .ico generated during compile, you can't use that. png, svg. or xpm only in .desktop files. So rather than guess, just let the user provide the path and file name. It already fills in as many known items as possible. I going to try to upload my efforts to-date some time tomorrow (Sun). ---------------------------------------------------------------------- dsiders · 2024-06-29 22:34 Quote from: dbannon on June 29, 2024, 08:21:17 amLooking good Don. Thanks Davo. Quote from: dbannon on June 29, 2024, 08:21:17 amQuote from: dsiders on June 26, 2024, 08:30:39 pmAfter some reflection, I am leaning towards making this a stand-alone tool. I created a prototype. (See attached). I understand why. But Lazarus already has, in the project information, quite a bit of what you need to know. Including the i18n stuff. How about making it a Lazarus plugin ?  And, then, a wrapper that will let a version of it stand alone ? But there are other standalone ones (no idea if they are good, I use vim). If you're talking about i18n for captions on controls, then yes. And, I can implement that in the stand-alone version too. If you're talking about localized content for keys like Name[de] or Comment[es], then the Lazarus translation tools won't help much with those. The values are not TTranslateString constants in source code somewhere. ATM the localized value has to be entered manually (unless I find a free translation URL that doesn't require an API key). I'm just not convinced any longer that a single platform solution like this deserves to be integrated in to the IDE. As it is, it satisfies the itch I was trying to scratch. Quote from: dbannon on June 29, 2024, 08:21:17 am https://www.florian- diesch.de/software/arronax/  - Linux only, not in the debian repo exo- desktop-item-edit - XFCe only, quite a lot of XFCe dependencies.I had not stumbled across either of those items yet. More to consider. Thanks for the links/clues. I'll try to package and upload my source tomorrow (Sun). ---------------------------------------------------------------------- dsiders · 2024-06-30 18:05 Here's the code to date. Linux only. It does not make the .desktop file executable or run update-desktop- database. More information available in source code comments. Perhaps others will find it useful. If you do. let me know and I'll add it to a public git repo. ---------------------------------------------------------------------- dbannon · 2024-07-01 06:12 I'll have a test when I get some time Don. I do think you need to make the .desktop file executable, some uses of it depend on that. I'd not be too worried about update-desktop-database, that database does seem to be bypassed by at least some desktops. My Mate for example keeps its list of apps to open a particular file "somewhere else" and personally I'd rather keep that process under my own control rather than having every app I install claiming to be be able to open every file on my system ! I don't put a MimeType in any .desktop file I make and it only applies to type 1 (Application) ones anyway. Davo