mirror of
https://github.com/hyprwm/hyprsysteminfo.git
synced 2024-11-24 06:55:59 +01:00
core: don't assume missing hl when no tag is set
This commit is contained in:
parent
ec55a1ac12
commit
53d0696a46
1 changed files with 7 additions and 5 deletions
12
src/main.cpp
12
src/main.cpp
|
@ -50,18 +50,20 @@ static void getSystemInfo(CSystemInternals* hsi) {
|
||||||
|
|
||||||
// get hyprland info
|
// get hyprland info
|
||||||
if (getenv("HYPRLAND_INSTANCE_SIGNATURE")) {
|
if (getenv("HYPRLAND_INSTANCE_SIGNATURE")) {
|
||||||
const auto DATA = execAndGet("hyprctl version");
|
const auto DATA = execAndGet("hyprctl version");
|
||||||
if (DATA.contains("Tag:")) {
|
hsi->hlSystemVersion = DATA.c_str();
|
||||||
hsi->hlSystemVersion = DATA.c_str();
|
if (DATA.contains("Hyprland")) {
|
||||||
|
|
||||||
auto temp = DATA.substr(DATA.find("Tag:") + 5);
|
auto temp = DATA.substr(DATA.find("Tag:") + 5);
|
||||||
temp = temp.substr(0, temp.find(","));
|
temp = temp.substr(0, temp.find(","));
|
||||||
hsi->hyprlandVersionLong = temp.c_str();
|
hsi->hyprlandVersionLong = temp.c_str();
|
||||||
hsi->hyprlandVersion = temp.substr(0, temp.find("-")).c_str();
|
hsi->hyprlandVersion = temp.substr(0, temp.find("-")).c_str();
|
||||||
|
} else {
|
||||||
|
hsi->hyprlandVersionLong = "unknown";
|
||||||
|
hsi->hyprlandVersion = "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto DATA2 = execAndGet("hyprctl systeminfo");
|
const auto DATA2 = execAndGet("hyprctl systeminfo");
|
||||||
if (DATA2.contains("Tag:"))
|
if (DATA2.contains("Hyprland"))
|
||||||
hsi->hlSystemInfo = DATA2.c_str();
|
hsi->hlSystemInfo = DATA2.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue