diff --git a/CMakeLists.txt b/CMakeLists.txt index daded92cd..baef303d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -974,7 +974,7 @@ elseif(APPLE) src/detection/terminalfont/terminalfont_apple.m src/detection/terminalshell/terminalshell_linux.c src/detection/terminalsize/terminalsize_linux.c - src/detection/theme/theme_nosupport.c + src/detection/theme/theme_apple.c src/detection/tpm/tpm_apple.c src/detection/uptime/uptime_bsd.c src/detection/users/users_linux.c diff --git a/src/detection/displayserver/displayserver_apple.c b/src/detection/displayserver/displayserver_apple.c index 4ef8d0520..7cf41204d 100644 --- a/src/detection/displayserver/displayserver_apple.c +++ b/src/detection/displayserver/displayserver_apple.c @@ -196,21 +196,5 @@ void ffConnectDisplayServerImpl(FFDisplayServerResult* ds) } } - const FFOSResult* os = ffDetectOS(); - - char* str_end; - const char* version = os->version.chars; - unsigned long osNum = strtoul(version, &str_end, 10); - if (str_end != version) - { - if (osNum > 15) { // Tahoe - ffStrbufSetStatic(&ds->dePrettyName, "Liquid Glass"); - } else if (osNum < 10) { - ffStrbufSetStatic(&ds->dePrettyName, "Platinum"); - } else { - ffStrbufSetStatic(&ds->dePrettyName, "Aqua"); - } - } - detectDisplays(ds); } diff --git a/src/detection/theme/theme_apple.c b/src/detection/theme/theme_apple.c new file mode 100644 index 000000000..b46d5afbf --- /dev/null +++ b/src/detection/theme/theme_apple.c @@ -0,0 +1,24 @@ +#include "theme.h" + +#include "detection/os/os.h" + +const char* ffDetectTheme(FFThemeResult* result) +{ + const FFOSResult* os = ffDetectOS(); + + char* str_end; + const char* version = os->version.chars; + unsigned long osNum = strtoul(version, &str_end, 10); + if (str_end != version) + { + if (osNum > 15) { // Tahoe + ffStrbufSetStatic(&result->theme1, "Liquid Glass"); + } else if (osNum < 10) { + ffStrbufSetStatic(&result->theme1, "Platinum"); + } else { + ffStrbufSetStatic(&result->theme1, "Aqua"); + } + } + + return NULL; +}