mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 09:58:03 +02:00
Modules: exposes localized module name in custom key format as {module-name}
This commit is contained in:
@@ -47,6 +47,7 @@ void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModu
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &moduleArgs->key, ((FFformatarg[]) {
|
||||
FF_ARG(moduleIndex, "index"),
|
||||
FF_ARG(moduleArgs->keyIcon, "icon"),
|
||||
FF_ARG(moduleName, "module-name"),
|
||||
}));
|
||||
ffStrbufWriteTo(&key, stdout);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ static void printBattery(FFBatteryOptions* options, FFBatteryResult* result, uin
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(result->modelName, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Battery), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ bool ffPrintBios(FFBiosOptions* options) {
|
||||
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, ((FFformatarg[]) {
|
||||
FF_ARG(bios.type, "type"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Bios), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ static void printDevice(FFBluetoothRadioOptions* options, const FFBluetoothRadio
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(radio->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(BluetoothRadio), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ bool ffPrintBrightness(FFBrightnessOptions* options) {
|
||||
FF_ARG(moduleIndex, "index"),
|
||||
FF_ARG(item->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Brightness), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ static void printBtrfs(FFBtrfsOptions* options, FFBtrfsResult* result, uint8_t i
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Btrfs), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ static void printCodecLine(const FFCodecOptions* options, uint8_t index, FFstrbu
|
||||
FF_ARG(*gpu, "gpu"),
|
||||
FF_ARG(direction, "direction"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Codec), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ static void printCPUCacheNormal(const FFCPUCacheResult* result, FFCPUCacheOption
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(levelStr, "level"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(CPUCache), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk, uint32_t index
|
||||
FF_ARG(disk->filesystem, "filesystem"),
|
||||
FF_ARG(mountpointLink, "mountpoint-link"),
|
||||
FF_ARG(nameLink, "name-link"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Disk), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ static void formatKey(const FFDiskIOOptions* options, FFDiskIOResult* dev, uint3
|
||||
FF_ARG(dev->name, "name"),
|
||||
FF_ARG(dev->devPath, "dev-path"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(DiskIO), "module-name"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ bool ffPrintDisplay(FFDisplayOptions* options) {
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(displayType, "type"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Display), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ bool ffPrintLoadavg(FFLoadavgOptions* options) {
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(duration, "duration"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Loadavg), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ static void formatKey(const FFLocalIpOptions* options, FFLocalIpResult* ip, uint
|
||||
FF_ARG(ip->name, "ifname"),
|
||||
FF_ARG(ip->mac, "mac"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(LocalIP), "module-name"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ bool ffPrintMonitor(FFMonitorOptions* options) {
|
||||
FF_ARG(moduleIndex, "index"),
|
||||
FF_ARG(display->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Monitor), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ static void formatKey(const FFNetIOOptions* options, FFNetIOResult* inf, uint32_
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(inf->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(NetIO), "module-name"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ bool ffPrintOS(FFOSOptions* options) {
|
||||
FF_ARG(instance.state.platform.sysinfo.name, "sysname"),
|
||||
FF_ARG(os->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(OS), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ static void formatKey(const FFPhysicalDiskOptions* options, FFPhysicalDiskResult
|
||||
FF_ARG(dev->name, "name"),
|
||||
FF_ARG(dev->devPath, "dev-path"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(PhysicalDisk), "module-name"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ void printSwap(FFSwapOptions* options, uint8_t index, uint32_t totalCount, FFSwa
|
||||
FF_ARG(index, "index"),
|
||||
FF_ARG(storage->name, "name"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Swap), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ static void printZpool(FFZpoolOptions* options, FFZpoolResult* result, uint8_t i
|
||||
FF_ARG(result->name, "name"),
|
||||
FF_ARG(result->guid, "guid"),
|
||||
FF_ARG(options->moduleArgs.keyIcon, "icon"),
|
||||
FF_ARG(FF_MODULE_GET_DISPLAY_NAME(Zpool), "module-name"),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user