slstatus.diff 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. diff --git a/Makefile b/Makefile
  2. index 7834257..129da64 100644
  3. --- a/Makefile
  4. +++ b/Makefile
  5. @@ -13,7 +13,6 @@ COM =\
  6. components/disk\
  7. components/entropy\
  8. components/hostname\
  9. - components/ip\
  10. components/kernel_release\
  11. components/keyboard_indicators\
  12. components/keymap\
  13. @@ -26,7 +25,6 @@ COM =\
  14. components/temperature\
  15. components/uptime\
  16. components/user\
  17. - components/volume\
  18. components/wifi
  19. all: slstatus
  20. diff --git a/components/ip.c b/components/ip.c
  21. deleted file mode 100644
  22. index 9476549..0000000
  23. --- a/components/ip.c
  24. +++ /dev/null
  25. @@ -1,61 +0,0 @@
  26. -/* See LICENSE file for copyright and license details. */
  27. -#include <ifaddrs.h>
  28. -#include <netdb.h>
  29. -#include <stdio.h>
  30. -#include <string.h>
  31. -#if defined(__OpenBSD__)
  32. - #include <sys/socket.h>
  33. - #include <sys/types.h>
  34. -#elif defined(__FreeBSD__)
  35. - #include <netinet/in.h>
  36. - #include <sys/socket.h>
  37. -#endif
  38. -
  39. -#include "../slstatus.h"
  40. -#include "../util.h"
  41. -
  42. -static const char *
  43. -ip(const char *interface, unsigned short sa_family)
  44. -{
  45. - struct ifaddrs *ifaddr, *ifa;
  46. - int s;
  47. - char host[NI_MAXHOST];
  48. -
  49. - if (getifaddrs(&ifaddr) < 0) {
  50. - warn("getifaddrs:");
  51. - return NULL;
  52. - }
  53. -
  54. - for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
  55. - if (!ifa->ifa_addr)
  56. - continue;
  57. -
  58. - s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in6),
  59. - host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
  60. - if (!strcmp(ifa->ifa_name, interface) &&
  61. - (ifa->ifa_addr->sa_family == sa_family)) {
  62. - freeifaddrs(ifaddr);
  63. - if (s != 0) {
  64. - warn("getnameinfo: %s", gai_strerror(s));
  65. - return NULL;
  66. - }
  67. - return bprintf("%s", host);
  68. - }
  69. - }
  70. -
  71. - freeifaddrs(ifaddr);
  72. -
  73. - return NULL;
  74. -}
  75. -
  76. -const char *
  77. -ipv4(const char *interface)
  78. -{
  79. - return ip(interface, AF_INET);
  80. -}
  81. -
  82. -const char *
  83. -ipv6(const char *interface)
  84. -{
  85. - return ip(interface, AF_INET6);
  86. -}
  87. diff --git a/config.mk b/config.mk
  88. index ead1859..af2bf7b 100644
  89. --- a/config.mk
  90. +++ b/config.mk
  91. @@ -7,13 +7,13 @@ VERSION = 0
  92. PREFIX = /usr/local
  93. MANPREFIX = $(PREFIX)/share/man
  94. -X11INC = /usr/X11R6/include
  95. -X11LIB = /usr/X11R6/lib
  96. +X11INC = -I/usr/X11R7/include -D_REENTRANT
  97. +X11LIB = -Wl,-rpath,/usr/X11R7/lib -L/usr/X11R7/lib -lX11
  98. # flags
  99. -CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE
  100. +CPPFLAGS = $(X11INC) -D_DEFAULT_SOURCE
  101. CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter -Os
  102. -LDFLAGS = -L$(X11LIB) -s
  103. +LDFLAGS = $(X11LIB) -s
  104. # OpenBSD: add -lsndio
  105. # FreeBSD: add -lkvm -lsndio
  106. LDLIBS = -lX11
  107. diff --git a/slstatus.h b/slstatus.h
  108. index 8ef5874..15ff7c1 100644
  109. --- a/slstatus.h
  110. +++ b/slstatus.h
  111. @@ -27,10 +27,6 @@ const char *entropy(const char *unused);
  112. /* hostname */
  113. const char *hostname(const char *unused);
  114. -/* ip */
  115. -const char *ipv4(const char *interface);
  116. -const char *ipv6(const char *interface);
  117. -
  118. /* kernel_release */
  119. const char *kernel_release(const char *unused);
  120. @@ -76,9 +72,6 @@ const char *gid(const char *unused);
  121. const char *uid(const char *unused);
  122. const char *username(const char *unused);
  123. -/* volume */
  124. -const char *vol_perc(const char *card);
  125. -
  126. /* wifi */
  127. const char *wifi_essid(const char *interface);
  128. const char *wifi_perc(const char *interface);