Commit Graph

60 Commits

Author SHA1 Message Date
Michael Stapelberg 73c6eb2d4c use param structs everywhere for consistency 2021-11-02 21:45:31 +01:00
Michael Stapelberg 4722198875 wireless: fix colors (+param struct) 2021-11-02 20:48:58 +01:00
Jonas Große Sundrup afc73e1982
Initialize fields with zero bytes in wireless module
Previously, the fields in the wireless module were declared but not explicitly
initialized upon declaration. As nothing else would do so afterwards, this
could introduce random characters left over in the memory segment into
the fields. This was explicitly observed in the essid-field, but likely
a possibility for other fields as well. Hence, this commit adds explicit
initialization with zero bytes to all fields to ensure proper
termination of all fields.

Fixes #432
2020-10-09 12:36:41 +02:00
Orestis Floros 84ad5c93db
travis: update dist, add custom matrix
New matrix for 5 jobs in total.

Updates our checks to bionic & xenial. Trusty could also be
included but it is a bit outdated at this point.

I use bionic to pull a more recent clang-format and use a dedicated job
just to check formatting. An alternative would be to conditionally run
the formatting script only on bionic.

I don't think that there is a better way to expand a `dist` x `compiler`
matrix (except using docker).
2020-05-01 11:19:41 +02:00
Aleksandr Matveev 7191cce8e9 wireless: Fix rendering bitrate 2020-04-11 23:05:35 +03:00
Aleksandr Matveev 18eb04d02d wireless: support connection bitrate on FreeBSD 2020-04-11 22:29:03 +03:00
Felix Buehler fc95763f7b remove goto-labels from wireless_info 2020-04-03 16:01:55 +02:00
Felix Buehler ae2566f28e use format_placeholder for wireless_info 2020-03-31 17:05:48 +02:00
Felix Buehler 42e7147291 add wireless format-options 2020-02-10 22:33:20 +01:00
Sascha Wessel 3d6b1b576b wireless: update %signal and %quality based on station info on Linux (#368)
Use station info instead of bss info to update %signal and %quality.
Bss info is based on scan info and doesn't get updated often. Station
info get's updated with every beacon. Bss info still used as fallback.
2019-10-21 08:48:50 +02:00
Thomas Klausner 667e38abab On NetBSD, include sys/socket.h for AF_INET{,6}. 2019-07-21 21:17:59 +02:00
Michael Stapelberg a57cdc84e2
Switch to autotools (#316) 2019-01-23 08:56:40 +01:00
Antonio Huete Jimenez afd7e44d97 Detect interface type on DragonFly BSD 2018-07-15 21:59:18 +00:00
Felix Buehler 52e9f6f63b able to print percentage
its now possible to have percentage before and after a variable. except
for the date. But percentage with dates does not make much sense to me, so
i skipped it.
2018-07-13 15:03:31 +02:00
Felix Buehler 4ea804b751 add format_quality option in wireless 2018-06-29 22:56:09 +02:00
eplanet 9a8106fab9 Fix MacOS build 2018-05-15 13:34:36 +02:00
Emeric Planet 657c0498db Update comment as in #247 (#254) 2017-12-11 12:16:00 +01:00
Emeric Planet 53fb9b4f18 Add IPv6 address when IPv4 isn't available (#247) 2017-12-11 11:38:31 +01:00
Jasper Lievisse Adriaanse 897d03ed5e Include sys/select.h on OpenBSD (#198)
Fixes a compilation error:
/usr/include/net80211/ieee80211_ioctl.h:339: warning: implicit declaration of function 'howmany'
/usr/include/net80211/ieee80211_ioctl.h:339: error: 'NBBY' undeclared here (not in a function)
/usr/include/net80211/ieee80211_ioctl.h:339: error: variably modified 'nr_rxmcs' at file scope
2017-01-31 23:26:13 -08:00
Jon Bernard 220b9e1565 Use blank padding for wireless quality (#166) (#167) 2016-11-12 06:39:41 -08:00
Michael Stapelberg ef16acfca5 print_wireless_info: fix FTBFS on hurd and kfreebsd
Patch by Axel Beckert.
2016-08-22 08:49:19 +02:00
Tommie Gannert 7728cff370 Make print_disk_info, print_eth_info and print_wireless_info compile on NetBSD without warnings. 2016-08-14 11:52:27 +01:00
Tommie Gannert 4189824ffb Define IW_ESSID_MAX_SIZE for OpenBSD.
Also fixes a signedness warning.
2016-08-14 11:52:27 +01:00
Alexis Hildebrandt 0a2d4d8a04 Add ifdef to compile wireless_info on Mac (#127) 2016-05-13 09:50:09 +02:00
Kenneth Lyons dcd0518e25 Added support for Pango markup. 2015-12-04 10:27:18 -08:00
Stefan Bader 9e6e0d4f8f Correctly calculate Wireless link quality
Wireless quality was stuck at 100% due to
a signed with unsigned integer division.
2015-10-12 20:46:22 +02:00
John Baldwin 9ebde24df1 Fix build under FreeBSD after recent changes for Linux. 2015-10-08 13:20:02 -07:00
Brendan Van Hook a13b2e7288 Added support for lemonbar 2015-10-04 14:52:32 -04:00
Michael Stapelberg f3125fdfde document code origins
fixes #65
2015-09-25 11:40:07 +02:00
Michael Stapelberg 06a133135f Fix comparison between signed/unsigned warning for real 2015-09-25 11:05:51 +02:00
Michael Stapelberg b8b07511b1 use proper unsigned type for ESSID length 2015-09-25 10:49:14 +02:00
Michael Stapelberg 45ccd84309 use nlmsg_data instead of the too-new genlmsg_hdr 2015-09-25 10:49:01 +02:00
Michael Stapelberg e1203ca62a use NL80211_RATE_INFO_BITRATE (16-bit)
NL80211_RATE_INFO_BITRATE32 is not available widely enough yet (the libc
used by travis doesn’t have it yet, for example).
2015-09-25 10:42:30 +02:00
Michael Stapelberg 668bf2079f wireless (linux): switch from libiw to libnl
Based on http://cr.i3wm.org/patch/692/ by Alexander Monakov

fixes #32
fixes #52
2015-09-24 21:47:02 +02:00
John Baldwin 85618dc8e8 Fix various issues with wireless information under FreeBSD:
- Instead of hoping that the currently associated AP will show up as
  the first AP in the list of scan results, fetch the BSSID of the
  currently associated AP and use that to fetch station info for the
  AP.  This provides more frequently updated signal strength
  information than scan results and reliably provides information when
  multiple APs are in range.
- Do not treat the RSSI value as a raw signal value in dBm.  Instead, use
  the same formula as ifconfig(8) to compute a signal value.
- Do not report the beacon interval value as a signal quality level.
2015-09-15 13:39:01 -07:00
Dmitrij D. Czarkoff 9b238a8d65 Use "color_degraded" when interface has no IP
On laptops one may want to have all interfaces up in order to let network
prioritization manage switching between wired and wireless connection.  In such
cases lack of IP address is a useful hint about currently used interface, and
color-coding makes it stand out more.
2015-08-06 17:20:29 +02:00
Jasper Lievisse Adriaanse e91891729e Use the maximum rssi, not the scaled percentage for the signal level.
This makes the value for %signal match ifconfig(8) in all cases.
2015-04-04 10:56:58 +02:00
Michael Stapelberg d74e904bf4 clang-format-3.5 -i **/*.[ch], update modeline
From here on, we’ll use clang-format to automatically format the source.

This has worked well in i3, so we are introducing it for i3status.
2015-03-16 10:01:07 +01:00
Tuomas Tynkkynen 7bdfb5b72e i3status: Support %frequency for wireless interfaces
In many public WiFis, the 2.4 GHz wireless band is slow due to
congestion, while there is still plenty of bandwidth available on the
5 GHz area. So when debugging wireless issues it's convenient to have
i3status display the frequency of the access point that the interface is
connected to.

This patch adds support for the %frequency tag for wireless interfaces,
so for example:
    format_up = "WLAN: %essid - %quality / %frequency"
would result in:
    "WLAN: eduroam - 074% / 2.4 GHz"
2014-12-03 08:14:21 +01:00
Michael Stapelberg b6c4d4ee46 wireless: call START_COLOR only once (Thanks XTaran) 2013-02-26 00:32:24 +01:00
Adrien Schildknecht d43664235a wifi: properly display ad-hoc networks
No statistics are displayed with ad-hoc networks since none are available.
2013-01-24 15:22:00 +01:00
Scott Tincman 0eeded8bc0 DragonFlyBSD support added 2012-11-15 12:31:17 +01:00
Jasper Lievisse Adriaanse ed03d2450c i3status - Handle down wireless interfaces just like ethernet interfaces (e.g. colors) 2012-10-16 10:48:29 +02:00
Jasper Lievisse Adriaanse 794151cfe7 Implement %essid and %signal for wireless on OpenBSD. 2012-10-10 08:24:29 +02:00
Michael Stapelberg 1b3aa40485 add yajl compat code 2012-04-08 14:05:47 +02:00
Michael Stapelberg 12b1bfa9b8 Properly output JSON with libyajl 2012-03-25 22:05:00 +02:00
Michael Stapelberg d5b4c8e368 Implement the i3bar JSON protocol
This hardcodes all the JSON parts. Strings are not properly escaped currently.
The best/easiest way to fix this is by actually using libyajl.
2012-02-16 23:30:54 +00:00
Baptiste Daroussin 342f942f15 Support wifi on FreeBSD 2011-07-24 02:12:20 +02:00
Axel Beckert 5e276db583 Fix FTBFS on kFreeBSD 2011-07-21 22:02:34 +02:00
Michael Stapelberg af5fd7b77e Implement displaying the wireless connection speed (Thanks Felicitus)
Based on a patch by Felicitus.
2010-09-22 19:59:48 +02:00