@@ -89,6 +89,7 @@ static inline void printHelp()
8989 " --disk-format <format>\n"
9090 " --battery-format <format>\n"
9191 " --locale-format <format>\n"
92+ " --local-ip-format <format>\n"
9293 "\n"
9394 "Key options: Provide a custom key for an output\n"
9495 " --os-key <key>\n"
@@ -113,6 +114,7 @@ static inline void printHelp()
113114 " --disk-key <key>: takes the mount path as format argument\n"
114115 " --battery-key <key>: takes the battery index as format argument\n"
115116 " --locale-key <key>\n"
117+ " --local-ip-key <key>: takes the name of this network interface as format argument\n"
116118 "\n"
117119 "Library optins: Set the path of a library to load\n"
118120 " --lib-PCI <path>\n"
@@ -125,8 +127,11 @@ static inline void printHelp()
125127 " --lib-SQLite <path>\n"
126128 "\n"
127129 "Module specific options:\n"
128- " --disk-folders <folders>: A colon separated list of folder paths for the disk output. Default is \"/:/home\"\n"
129- " --battery-dir <folder>: The directory where the battery folders are. Standard: /sys/class/power_supply/\n"
130+ " --disk-folders <folders>: A colon separated list of folder paths for the disk output. Default is \"/:/home\"\n"
131+ " --battery-dir <folder>: The directory where the battery folders are. Standard: /sys/class/power_supply/\n"
132+ " --localip-show-ipv4 <?value>: Show ipv4 addresses in local ip module. Default is true\n"
133+ " --localip-show-ipv6 <?value>: Show ipv6 addresses in local ip module. Default is false\n"
134+ " --localip-show-loop <?value>: Show loop back addresses (127.0.0.1) in local ip module. Default is false\n"
130135 "\n"
131136 "Parsing is not case sensitive. E.g. \"--lib-PCI\" is equal to \"--Lib-Pci\"\n"
132137 "If a value starts with a ?, it is optional. \"true\" will be used if not set.\n"
@@ -492,6 +497,7 @@ static inline void printAvailableModules()
492497 "Icons\n"
493498 "Kernel\n"
494499 "Locale\n"
500+ "LocalIp\n"
495501 "Memory\n"
496502 "OS\n"
497503 "Packages\n"
@@ -914,6 +920,10 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
914920 optionParseString (key , value , & instance -> config .localeFormat );
915921 else if (strcasecmp (key , "--locale-key" ) == 0 )
916922 optionParseString (key , value , & instance -> config .localeKey );
923+ else if (strcasecmp (key , "--local-ip-key" ) == 0 )
924+ optionParseString (key , value , & instance -> config .localIpKey );
925+ else if (strcasecmp (key , "--local-ip-format" ) == 0 )
926+ optionParseString (key , value , & instance -> config .localIpFormat );
917927 else if (strcasecmp (key , "--lib-PCI" ) == 0 )
918928 optionParseString (key , value , & instance -> config .libPCI );
919929 else if (strcasecmp (key , "--lib-X11" ) == 0 )
@@ -934,6 +944,12 @@ static void parseOption(FFinstance* instance, FFdata* data, const char* key, con
934944 optionParseString (key , value , & instance -> config .diskFolders );
935945 else if (strcasecmp (key , "--battery-dir" ) == 0 )
936946 optionParseString (key , value , & instance -> config .batteryDir );
947+ else if (strcasecmp (key , "--localip-show-ipv4" ) == 0 )
948+ instance -> config .localIpShowIpV4 = optionParseBoolean (value );
949+ else if (strcasecmp (key , "--localip-show-ipv6" ) == 0 )
950+ instance -> config .localIpShowIpV6 = optionParseBoolean (value );
951+ else if (strcasecmp (key , "--localip-show-loop" ) == 0 )
952+ instance -> config .localIpShowLoop = optionParseBoolean (value );
937953 else
938954 {
939955 fprintf (stderr , "Error: unknown option: %s\n" , key );
@@ -1063,6 +1079,8 @@ static void parseStructureCommand(FFinstance* instance, FFdata* data, const char
10631079 ffPrintBattery (instance );
10641080 else if (strcasecmp (line , "locale" ) == 0 )
10651081 ffPrintLocale (instance );
1082+ else if (strcasecmp (line , "localip" ) == 0 )
1083+ ffPrintLocalIp (instance );
10661084 else if (strcasecmp (line , "colors" ) == 0 )
10671085 ffPrintColors (instance );
10681086 else
0 commit comments