mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 17:41:41 +01:00
caching of some values
This commit is contained in:
+8
-1
@@ -4,10 +4,17 @@
|
||||
|
||||
void ffPrintResolution(FFstate* state)
|
||||
{
|
||||
if(ffPrintCachedValue(state, "Resolution"))
|
||||
return;
|
||||
|
||||
Display* display = XOpenDisplay(NULL);
|
||||
Screen* screen = DefaultScreenOfDisplay(display);
|
||||
|
||||
char resolution[1024];
|
||||
sprintf(resolution, "%ix%i", screen->width, screen->height);
|
||||
|
||||
ffSaveCachedValue(state, "Resolution", resolution);
|
||||
|
||||
ffPrintLogoAndKey(state, "Resolution");
|
||||
printf("%ix%i\n", screen->width, screen->height);
|
||||
puts(resolution);
|
||||
}
|
||||
Reference in New Issue
Block a user