mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-04 20:24:19 +01:00
d0f093c567
As discussed in https://github.com/fastfetch-cli/fastfetch/discussions/473
27 lines
709 B
C
27 lines
709 B
C
#include "wallpaper.h"
|
|
#include "common/settings.h"
|
|
#include "detection/gtk_qt/gtk_qt.h"
|
|
|
|
const char* ffDetectWallpaper(FFstrbuf* result)
|
|
{
|
|
const FFstrbuf* wallpaper = NULL;
|
|
const FFGTKResult* gtk = ffDetectGTK4();
|
|
if (gtk->wallpaper.length)
|
|
wallpaper = >k->wallpaper;
|
|
else
|
|
{
|
|
const FFQtResult* qt = ffDetectQt();
|
|
if (qt->wallpaper.length)
|
|
wallpaper = &qt->wallpaper;
|
|
}
|
|
|
|
if (!wallpaper)
|
|
return "Failed to detect the current wallpaper path";
|
|
|
|
if (ffStrbufStartsWithS(wallpaper, "file:///"))
|
|
ffStrbufAppendS(result, wallpaper->chars + strlen("file://"));
|
|
else
|
|
ffStrbufAppend(result, wallpaper);
|
|
return NULL;
|
|
}
|