Modules: exposes localized module name in custom key format as {module-name}

This commit is contained in:
李通洲
2026-09-01 19:18:02 +08:00
parent 37c198d997
commit 2e06a73102
19 changed files with 19 additions and 0 deletions
+1
View File
@@ -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);
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}
}
+1
View File
@@ -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"),
}));
}
+1
View File
@@ -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"),
}));
}