This commit is contained in:
Mars 2024-06-10 14:21:42 -04:00
parent 4d1e69bbe5
commit ee61c994ac
Signed by: pupbrained
GPG key ID: 874E22DF2F9DFCB5
2 changed files with 24 additions and 16 deletions

View file

@ -47,26 +47,27 @@ fn GetDate() -> string {
} }
fn main() -> int { fn main() -> int {
using WeatherOutput = Weather::WeatherOutput;
const Config& config = Config::getInstance(); const Config& config = Config::getInstance();
WeatherOutput json = config.getWeather().getWeatherInfo();
if (config.getNowPlaying().getEnabled())
fmt::println("{}", GetNowPlaying());
fmt::println("Hello {}!", config.getGeneral().getName());
fmt::println("Installed RAM: {:.2f}", BytesToGiB {GetMemInfo()});
fmt::println("Today is: {}", GetDate());
Weather::WeatherOutput json = config.getWeather().getWeatherInfo();
const long temp = std::lround(json.main.temp); const long temp = std::lround(json.main.temp);
const string townName = json.name; const string townName = json.name;
const char* version = GetOSVersion();
const string name = config.getGeneral().getName();
const bool nowPlayingEnabled = config.getNowPlaying().getEnabled();
fmt::println("Hello {}!", name);
fmt::println("Today is: {}", GetDate());
fmt::println("It is {}°F in {}", temp, townName); fmt::println("It is {}°F in {}", temp, townName);
fmt::println("Installed RAM: {:.2f}", BytesToGiB {GetMemInfo()});
const char* version = GetOSVersion();
fmt::println("{}", version); fmt::println("{}", version);
if (nowPlayingEnabled)
fmt::println("{}", GetNowPlaying());
delete[] version; delete[] version;
delete &config; delete &config;

View file

@ -67,10 +67,17 @@ using MRMediaRemoteGetNowPlayingInfoFunction = void (*)(
NSOperatingSystemVersion osVersion = [processInfo operatingSystemVersion]; NSOperatingSystemVersion osVersion = [processInfo operatingSystemVersion];
NSString* version = [NSString stringWithFormat:@"%ld.%ld.%ld", NSString* version;
osVersion.majorVersion, if (osVersion.patchVersion == 0) {
osVersion.minorVersion, version = [NSString stringWithFormat:@"%ld.%ld",
osVersion.patchVersion]; osVersion.majorVersion,
osVersion.minorVersion];
} else {
version = [NSString stringWithFormat:@"%ld.%ld.%ld",
osVersion.majorVersion,
osVersion.minorVersion,
osVersion.patchVersion];
}
// Dictionary to map macOS versions to their respective names // Dictionary to map macOS versions to their respective names
NSDictionary<NSNumber*, NSString*>* versionNames = NSDictionary<NSNumber*, NSString*>* versionNames =