Skip to content

Commit

Permalink
core: don't assume missing hl when no tag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Oct 13, 2024
1 parent ec55a1a commit 53d0696
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,20 @@ static void getSystemInfo(CSystemInternals* hsi) {

// get hyprland info
if (getenv("HYPRLAND_INSTANCE_SIGNATURE")) {
const auto DATA = execAndGet("hyprctl version");
if (DATA.contains("Tag:")) {
hsi->hlSystemVersion = DATA.c_str();

const auto DATA = execAndGet("hyprctl version");
hsi->hlSystemVersion = DATA.c_str();
if (DATA.contains("Hyprland")) {
auto temp = DATA.substr(DATA.find("Tag:") + 5);
temp = temp.substr(0, temp.find(","));
hsi->hyprlandVersionLong = temp.c_str();
hsi->hyprlandVersion = temp.substr(0, temp.find("-")).c_str();
} else {
hsi->hyprlandVersionLong = "unknown";
hsi->hyprlandVersion = "unknown";
}

const auto DATA2 = execAndGet("hyprctl systeminfo");
if (DATA2.contains("Tag:"))
if (DATA2.contains("Hyprland"))
hsi->hlSystemInfo = DATA2.c_str();
}

Expand Down

0 comments on commit 53d0696

Please sign in to comment.