Commit Graph

26 Commits

Author SHA1 Message Date
Michael Stapelberg 73c6eb2d4c use param structs everywhere for consistency 2021-11-02 21:45:31 +01:00
Michael Stapelberg 5760a1d53f eth: fix colors (+param struct) 2021-11-02 20:29:00 +01:00
Felix Buehler 48119d890a use format_placeholder for eth.info 2020-03-03 21:31:56 +01:00
Michael Stapelberg 0e4fd9ad4a fix ethernet speed display for 100 Gbit/s cards
Before this fix, i3status would display 34464 Mbit/s instead of 100000 Mbit/s,
because it was only looking at ecmd.speed, ignoring ecmd.speed_hi.
2019-01-27 22:32:47 +01:00
Michael Stapelberg a57cdc84e2
Switch to autotools (#316) 2019-01-23 08:56:40 +01:00
Max Christian Pohle 04d09aac49 Added %interface to the ethernet options 2018-08-24 23:43:35 +02: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
Olivier Gayot 03c8908ec6 Stop requiring CAP_NET_ADMIN
Since the following commit in the Linux kernel tree

  0fdc100bdc4b ethtool: allow non-netadmin to query settings

it is no longer necessary to have the CAP_NET_ADMIN capability to query
a device speed using ioctl(..., SIOCETHTOOL) in conjonction with the
ETHTOOL_GSET ethtool command.

The mentioned commit landed first in the 2.6.37 version of the Kernel.
This version is no longer maintained nowdays.

Since it is not necessary anymore, it is strongly prefered from a
security standpoint to drop the CAP_NET_ADMIN capability from the
binary.

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-25 11:53:05 +02:00
Emeric Planet 53fb9b4f18 Add IPv6 address when IPv4 isn't available (#247) 2017-12-11 11:38:31 +01: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
John Baldwin dee6d52720 Fix some issues with displaying Ethernet media status on recent FreeBSD kernels.
- Don't apply IFM_SUBTYPE to the raw subtype in the description table.
  IFM_SUBTYPE() requires a fully populated word and was truncating values
  in the table when comparing resulting in false matches (notably
  "10GBase-KX4" for the no media case) after recent changes to add extended
  Ethernet media states in FreeBSD.
- Explicitly check for IFM_ETHER.
- Use SIOCGIFXMEDIA when present to obtain extended media states on newer
  kernels.
- Explicitly handle "no carrier".
2015-09-15 10:48:16 -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
Baptiste Daroussin 0b882f36b5 print_eth_info: fix warnings on FreeBSD 2015-03-25 08:18:23 +01: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
Mats 4f7da73885 Unify use of string comparisons
* strncmp(s1, s2, strlen(s2)) → BEGINS_WITH(s1, s2)
* strncmp(s1, s2, strlen(s1)) → strcmp(s1, s2)
* Prefer case-insensitive comparison for options
2014-03-12 08:28:16 +01:00
Arnaud Degroote cf2fb61911 Allow to print eth information on NetBSD 2013-10-07 19:30:51 +02:00
Scott Tincman 0eeded8bc0 DragonFlyBSD support added 2012-11-15 12:31:17 +01:00
Jasper Lievisse Adriaanse 11c4ab9870 Implement %speed for Ethernet on OpenBSD. 2012-10-10 08:24:04 +02:00
Jasper Lievisse Adriaanse 6b447f7f1b - Remove some superfluous #ifdef clutter - If we're compiling on !(Linux or FreeBSD), just emit a '?'. 2012-05-04 16:10:19 +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
Fernando Tarlá Cardoso Lemos 38337511e9 Support customized colors. 2010-07-04 21:52:43 +02:00
Michael Stapelberg 3eec92d504 Colorize ethernet output (patch by Peter Johnson) 2010-02-14 12:49:03 +01:00
Michael Stapelberg b88a55ffa6 Implement format_up/format_down for ethernet 2009-10-16 20:14:40 +02:00
Michael Stapelberg f947d0a446 Breaks configfiles! Major refactoring of i3status, see below
We finally switched to libconfuse for a configuration file format
which does not require much work for the programmer nor for the user.
Plus, it avoids the Not-Invented-Here syndrome of yet another config
file format.

Furthermore, as a consequence of providing format strings for every
"module" (ipv6, wireless, …), we directly print the output and thus
we needed to drop support for wmii. This allowed us to get rid of
quite some complexity.

Documentation about the new configuration file and options will
follow. This commit is the beginning of what will be i3status v2.0.
2009-10-11 22:14:29 +02:00