From 8c910089cc2ef9b97d24b2f7a5e5a0057126f66b Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Tue, 24 May 2022 13:58:38 +0200 Subject: [PATCH] Detect KDE plasma version more reliable --- CMakeLists.txt | 2 +- src/detection/displayserver/wmde.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 381677513..2335b296f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.1.0) # Threads::Threads project(fastfetch - VERSION 1.4.2 + VERSION 1.4.3 LANGUAGES C ) diff --git a/src/detection/displayserver/wmde.c b/src/detection/displayserver/wmde.c index b65b54940..ccc231592 100644 --- a/src/detection/displayserver/wmde.c +++ b/src/detection/displayserver/wmde.c @@ -98,7 +98,15 @@ static void getKDE(FFDisplayServerResult* result) { ffStrbufSetS(&result->deProcessName, "plasmashell"); ffStrbufSetS(&result->dePrettyName, "KDE Plasma"); + ffParsePropFile(FASTFETCH_TARGET_DIR_USR"/share/xsessions/plasma.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); + if(result->deVersion.length == 0) + ffParsePropFile(FASTFETCH_TARGET_DIR_USR"/share/xsessions/plasma5.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); + if(result->deVersion.length == 0) + ffParsePropFile(FASTFETCH_TARGET_DIR_USR"/share/wayland-sessions/plasmawayland.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); + if(result->deVersion.length == 0) + ffParsePropFile(FASTFETCH_TARGET_DIR_USR"/share/wayland-sessions/plasmawayland5.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); + applyBetterWM(result, getenv("KDEWM")); }