From b472dd3f74b0750ab21b5134011605d70d13a9d8 Mon Sep 17 00:00:00 2001 From: Ryan Kes Date: Tue, 12 Mar 2019 09:54:39 +0100 Subject: [PATCH] added ipv4_multiple --- PKGBUILD | 6 ++- config.h | 3 +- ipv4-multiple-20190312-5f08c89.diff | 62 +++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 ipv4-multiple-20190312-5f08c89.diff diff --git a/PKGBUILD b/PKGBUILD index f1e2ec8..2dbd6da 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -13,6 +13,7 @@ license=('custom:ISC') _patches=( "seperator-20180305-f4e35fa.diff" "backlight-20180305-85a4a18.diff" + "ipv4-multiple-20190312-5f08c89.diff" ) source=("git+https://git.suckless.org/${pkgname%-git}" @@ -20,9 +21,10 @@ source=("git+https://git.suckless.org/${pkgname%-git}" "${_patches[@]}") md5sums=('SKIP' - 'f012506948aac85a43c35d7e09d7483e' + 'b52b327f7fdf0432e798e79b410fc2ed' '24ea93ef665decc0315248f62aa65f44' - '58404d0af1893f560926daf605a79919') + '58404d0af1893f560926daf605a79919' + 'fc9b31ea31470b6816f1f92c6bc6fa9d') pkgver() { cd "${pkgname%-git}" diff --git a/config.h b/config.h index 7c1a11b..280f176 100644 --- a/config.h +++ b/config.h @@ -29,6 +29,7 @@ static const char unknown_str[] = "n/a"; * gid GID of current user NULL * hostname hostname NULL * ipv4 IPv4 address interface name (eth0) + * ipv4_multiple IPV4 address NULL * ipv6 IPv6 address interface name (eth0) * kernel_release `uname -r` NULL * keyboard_indicators caps/num lock indicators format string (c?n?) @@ -65,7 +66,7 @@ static const struct arg args[] = { { wifi_essid, "\x06  %s", "wlp4s0" }, { wifi_perc, " %s%% ", "wlp4s0" }, { seperator, "\x07", NULL }, - { ipv4, "\x08  %s ", "wlp4s0" }, + { ipv4_multiple, "\x08  %s " }, { seperator, "\x09", NULL }, { netspeed_rx, "\x0A  %s", "wlp4s0" }, { netspeed_tx, "  %s ", "wlp4s0" }, diff --git a/ipv4-multiple-20190312-5f08c89.diff b/ipv4-multiple-20190312-5f08c89.diff new file mode 100644 index 0000000..45268ff --- /dev/null +++ b/ipv4-multiple-20190312-5f08c89.diff @@ -0,0 +1,62 @@ +From 5f08c8987227a88449d0d2432b2e9dc6514540da Mon Sep 17 00:00:00 2001 +From: Ryan Kes +Date: Tue, 12 Mar 2019 09:50:35 +0100 +Subject: [PATCH] added ipv4_multiple + +--- + components/ip.c | 13 +++++++++++++ + config.def.h | 1 + + slstatus.h | 1 + + 3 files changed, 15 insertions(+) + +diff --git a/components/ip.c b/components/ip.c +index 70724eb..7a55d94 100644 +--- a/components/ip.c ++++ b/components/ip.c +@@ -53,6 +53,19 @@ ipv4(const char *interface) + return ip(interface, AF_INET); + } + ++const char * ++ipv4_multiple() ++{ ++ char *output; ++ ++ if(output = ipv4("wlp4s0")) ++ return output; ++ else if(output = ipv4("enp0s31f6")) ++ return output; ++ ++ return NULL; ++} ++ + const char * + ipv6(const char *interface) + { +diff --git a/config.def.h b/config.def.h +index d2f7045..665d25f 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -30,6 +30,7 @@ static const char unknown_str[] = "n/a"; + * gid GID of current user NULL + * hostname hostname NULL + * ipv4 IPv4 address interface name (eth0) ++ * ipv4_multiple IPv4 address NULL + * ipv6 IPv6 address interface name (eth0) + * kernel_release `uname -r` NULL + * keyboard_indicators caps/num lock indicators format string (c?n?) +diff --git a/slstatus.h b/slstatus.h +index a46f276..1f754d0 100644 +--- a/slstatus.h ++++ b/slstatus.h +@@ -29,6 +29,7 @@ const char *hostname(void); + + /* ip */ + const char *ipv4(const char *interface); ++const char *ipv4_multiple(void); + const char *ipv6(const char *interface); + + /* kernel_release */ +-- +2.21.0 +