[solved] GetDesktopPath lazarus / 23-Operating Systems ---------------------------------------------------------------------- Handoko · 2020-10-20 18:00 Can anyone help me test this code on Linuxes and Windows? I tested on Ubuntu Mate and WinXP, it works but I want to make sure it 'really' works. Or maybe you have better suggestion. 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 function GetDesktopPath: string;var  S: string;begin{$ifdef WINDOWS}  S := GetEnvironmentVariable('HOMEDRIVE') + GetEnvironmentVariable('HOMEPATH');{$endif}{$ifdef LINUX}  S := GetEnvironmentVariable('HOME');{$endif}  Result := S + DirectorySeparator + 'Desktop' + DirectorySeparator;end; Note: SysUtils unit is required. ---------------------------------------------------------------------- ASerge · 2020-10-20 18:14 Quote from: Handoko on October 20, 2020, 08:00:14 pmCan anyone help me test this code on Linuxes and Windows? I tested on Ubuntu Mate and WinXP, it works but I want to make sure it 'really' works. Or maybe you have better suggestion. Windows 7 - work. But it is more correct to use WinDirs.GetWindowsSpecialDir(CSIDL_DESKTOPDIRECTORY, False); ---------------------------------------------------------------------- Lulu · 2020-10-20 18:35 Tested on win10: both Handoko and ASerge code work ---------------------------------------------------------------------- fpcoder · 2020-10-20 20:37 Tested OK with XUbuntu 20.04. ---------------------------------------------------------------------- trev · 2020-10-20 23:20 Change: 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 LINUX} To: 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 UNIX} And it will now also work in macOS and FreeBSD (tested :-) ---------------------------------------------------------------------- Handoko · 2020-10-22 17:56 Thank you all for testing it and the suggestions.