Skip to content

Commit 093f56a

Browse files
committed
Theme (macOS): moves macOS theme detection logic from DE to dedicated module
The old behavior was inherited from neofetch. However `Aqua` and `Liquid Glass` are actually design language, not a DE. There is no DE on macOS.
1 parent bd9744c commit 093f56a

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ elseif(APPLE)
974974
src/detection/terminalfont/terminalfont_apple.m
975975
src/detection/terminalshell/terminalshell_linux.c
976976
src/detection/terminalsize/terminalsize_linux.c
977-
src/detection/theme/theme_nosupport.c
977+
src/detection/theme/theme_apple.c
978978
src/detection/tpm/tpm_apple.c
979979
src/detection/uptime/uptime_bsd.c
980980
src/detection/users/users_linux.c

src/detection/displayserver/displayserver_apple.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,21 +196,5 @@ void ffConnectDisplayServerImpl(FFDisplayServerResult* ds)
196196
}
197197
}
198198

199-
const FFOSResult* os = ffDetectOS();
200-
201-
char* str_end;
202-
const char* version = os->version.chars;
203-
unsigned long osNum = strtoul(version, &str_end, 10);
204-
if (str_end != version)
205-
{
206-
if (osNum > 15) { // Tahoe
207-
ffStrbufSetStatic(&ds->dePrettyName, "Liquid Glass");
208-
} else if (osNum < 10) {
209-
ffStrbufSetStatic(&ds->dePrettyName, "Platinum");
210-
} else {
211-
ffStrbufSetStatic(&ds->dePrettyName, "Aqua");
212-
}
213-
}
214-
215199
detectDisplays(ds);
216200
}

src/detection/theme/theme_apple.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include "theme.h"
2+
3+
#include "detection/os/os.h"
4+
5+
const char* ffDetectTheme(FFThemeResult* result)
6+
{
7+
const FFOSResult* os = ffDetectOS();
8+
9+
char* str_end;
10+
const char* version = os->version.chars;
11+
unsigned long osNum = strtoul(version, &str_end, 10);
12+
if (str_end != version)
13+
{
14+
if (osNum > 15) { // Tahoe
15+
ffStrbufSetStatic(&result->theme1, "Liquid Glass");
16+
} else if (osNum < 10) {
17+
ffStrbufSetStatic(&result->theme1, "Platinum");
18+
} else {
19+
ffStrbufSetStatic(&result->theme1, "Aqua");
20+
}
21+
}
22+
23+
return NULL;
24+
}

0 commit comments

Comments
 (0)