Skip to content

Commit e64a44a

Browse files
committed
WM (Linux): fix (?) Hyprland version detection
1 parent be9cf00 commit e64a44a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/detection/wm/wm_linux.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ const char* ffDetectWMPlugin(FF_MAYBE_UNUSED FFstrbuf* pluginName)
1414

1515
static bool extractHyprlandVersion(const char* line, FF_MAYBE_UNUSED uint32_t len, void *userdata)
1616
{
17-
if (line[0] != 'v') return true;
1817
int count = 0;
19-
sscanf(line + 1, "%*d.%*d.%*d%n", &count);
18+
sscanf(line, " version: bump to v%*d.%*d.%*d%n", &count);
2019
if (count == 0) return true;
2120

22-
ffStrbufSetNS((FFstrbuf*) userdata, len - 1, line + 1);
21+
// SUPER hacky
22+
uint32_t prefixLen = (uint32_t) strlen(" version: bump to v"); // version bump commit message
23+
ffStrbufSetNS((FFstrbuf*) userdata, len - prefixLen, line + prefixLen);
2324
return false;
2425
}
2526

@@ -29,7 +30,7 @@ static const char* getHyprland(FFstrbuf* result)
2930
const char* error = ffFindExecutableInPath("Hyprland", &path);
3031
if (error) return "Failed to find Hyprland executable path";
3132

32-
if (ffBinaryExtractStrings(path.chars, extractHyprlandVersion, result, (uint32_t) strlen("v0.0.0")) == NULL)
33+
if (ffBinaryExtractStrings(path.chars, extractHyprlandVersion, result, (uint32_t) strlen(" version: bump to v0.0.0")) == NULL)
3334
return NULL;
3435

3536
if (ffProcessAppendStdOut(result, (char* const[]){

0 commit comments

Comments
 (0)