ADD: Determine LXQt Desktop Environment

This commit is contained in:
Alexander Koblov 2020-01-18 12:13:54 +00:00
commit 91068e2155
2 changed files with 32 additions and 6 deletions

View file

@ -3,7 +3,7 @@
-------------------------------------------------------------------------
This unit contains specific UNIX functions.
Copyright (C) 2008-2016 Alexander Koblov (alexx2000@mail.ru)
Copyright (C) 2008-2020 Alexander Koblov (alexx2000@mail.ru)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -16,8 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
along with this program. If not, see <http://www.gnu.org/licenses/>.
}
unit uMyUnix;
@ -47,7 +46,8 @@ type
DE_XFCE = 3,
DE_LXDE = 4,
DE_MATE = 5,
DE_CINNAMON = 6
DE_CINNAMON = 6,
DE_LXQT = 7
);
const
@ -58,7 +58,8 @@ const
'Xfce',
'LXDE',
'MATE',
'Cinnamon'
'Cinnamon',
'LXQt'
);
type
@ -311,6 +312,8 @@ begin
Exit(DE_XFCE);
if Pos('lxde', DesktopSession) <> 0 then
Exit(DE_LXDE);
if Pos('lxqt', DesktopSession) <> 0 then
Exit(DE_LXQT);
if Pos('mate', DesktopSession) <> 0 then
Exit(DE_MATE);
if Pos('cinnamon', DesktopSession) <> 0 then

View file

@ -3,7 +3,7 @@
-------------------------------------------------------------------------
Some useful functions for Unix icon theme implementation
Copyright (C) 2009-2017 Alexander Koblov (alexx2000@mail.ru)
Copyright (C) 2009-2020 Alexander Koblov (alexx2000@mail.ru)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -149,6 +149,27 @@ begin
end;
end;
function GetLxqtIconTheme: String;
const
lxqtConfig = '/.config/lxqt/lxqt.conf';
var
iniCfg: TIniFileEx;
begin
Result:= EmptyStr;
if mbFileExists(GetHomeDir + lxqtConfig) then
try
iniCfg:= TIniFileEx.Create(GetHomeDir + lxqtConfig);
try
Result:= iniCfg.ReadString('General', 'icon_theme', EmptyStr);
finally
iniCfg.Free;
end;
except
// Skip
end;
end;
function GetMateIconTheme: String; inline;
begin
Result:= GioGetIconTheme('org.mate.interface');
@ -173,6 +194,8 @@ begin
Result:= GetXfceIconTheme;
DE_LXDE:
Result:= GetLxdeIconTheme;
DE_LXQT:
Result:= GetLxqtIconTheme;
DE_MATE:
Result:= GetMateIconTheme;
DE_CINNAMON: