summaryrefslogtreecommitdiffhomepage
path: root/xmobar.cabal
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2020-02-16 12:40:02 +0300
committerPaul Fertser <fercerpav@gmail.com>2020-02-25 13:07:44 +0300
commitf4555b51b778ae5e677ce63eccdfd9376d07dd5d (patch)
treef7a8f59022efc3396e602c78856958537ca6de4d /xmobar.cabal
parent3f11da6eed40b06044c705db9e3e81fd25abb391 (diff)
downloadxmobar-f4555b51b778ae5e677ce63eccdfd9376d07dd5d.tar.gz
xmobar-f4555b51b778ae5e677ce63eccdfd9376d07dd5d.tar.bz2
Wireless: support NL80211 userspace <-> kernelspace API
NL80211 was introduced in Linux 2.6.24 in 2007 as a new extensible universal API, replacing "wireless extensions" ioctls. It works on top of netlink, and allows direct communication to cfg80211 kernel subsystem. Since then it became a hard requirement for all upstream wireless drivers to hook into cfg80211 (SoftMAC drivers do it via the common mac80211 layer). There's still additional compatibility code that allows limited Wext functionality for cfg80211 drivers but it's buggy and can be disabled altogether when CONFIG_CFG80211_WEXT is not set. This patch makes use of "netlink" Haskell library which doesn't have any additional runtime dependencies (so neither iwlib nor libnl are required). The operation is the same as performed by "iw dev <devname> link" command. The signal level is transformed to "quality" by first clamping it to [-110; -40], then adding 110 and dividing by 70 (same meaningless formula as used by the cfg80211 Wext compatibility layer). "essid" template argument is replaced by more appropriate "ssid" (with the old variant still available for backwards compatibility)
Diffstat (limited to 'xmobar.cabal')
-rw-r--r--xmobar.cabal14
1 files changed, 12 insertions, 2 deletions
diff --git a/xmobar.cabal b/xmobar.cabal
index f23275f..b29b987 100644
--- a/xmobar.cabal
+++ b/xmobar.cabal
@@ -40,7 +40,11 @@ flag with_inotify
default: False
flag with_iwlib
- description: Wireless info support. Required for the Wireless plugin, needs iwlib installed.
+ description: Wireless info support via Wext ioctls (deprecated). Required for the Wireless plugin, needs iwlib installed.
+ default: False
+
+flag with_nl80211
+ description: Wireless info support via nl80211. Required for the Wireless plugin on systems running Linux, the kernel.
default: False
flag with_mpd
@@ -209,12 +213,18 @@ library
exposed-modules: Xmobar.Plugins.Mail, Xmobar.Plugins.MBox
cpp-options: -DINOTIFY
- if flag(with_iwlib) || flag(all_extensions)
+ if flag(with_iwlib)
extra-libraries: iw
build-depends: iwlib >= 0.1.0 && < 0.2
exposed-modules: Xmobar.Plugins.Monitors.Wireless
cpp-options: -DIWLIB
+ if flag(with_nl80211) || flag(all_extensions)
+ build-depends: netlink >= 1.1.1.0,
+ cereal >= 0.5.8.1
+ exposed-modules: Xmobar.Plugins.Monitors.Wireless
+ cpp-options: -DUSE_NL80211
+
if flag(with_mpd) || flag(all_extensions)
build-depends: libmpd >= 0.9.0.10
exposed-modules: Xmobar.Plugins.Monitors.MPD