diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | i3status.c | 2 | ||||
-rw-r--r-- | i3status.conf | 1 | ||||
-rw-r--r-- | man/i3status.man | 8 | ||||
-rw-r--r-- | src/print_eth_info.c | 1 | ||||
-rw-r--r-- | testcases/001-battery/expected_output.txt | 2 | ||||
-rw-r--r-- | testcases/015-battery-capacity/expected_output.txt | 2 | ||||
-rw-r--r-- | testcases/021-battery-second/BAT0_uevent | 4 | ||||
-rw-r--r-- | testcases/021-battery-second/expected_output.txt | 1 | ||||
-rw-r--r-- | testcases/021-battery-second/i3status.conf | 11 |
11 files changed, 23 insertions, 14 deletions
@@ -116,8 +116,6 @@ install: install -m 755 -d $(DESTDIR)$(SYSCONFDIR) install -m 755 -d $(DESTDIR)$(MANPREFIX)/share/man/man1 install -m 755 i3status $(DESTDIR)$(PREFIX)/bin/i3status - # Allow network configuration for getting the link speed - (which setcap && setcap cap_net_admin=ep $(DESTDIR)$(PREFIX)/bin/i3status) || true install -m 644 i3status.conf $(DESTDIR)$(SYSCONFDIR)/i3status.conf install -m 644 man/i3status.1 $(DESTDIR)$(MANPREFIX)/share/man/man1 @@ -16,13 +16,12 @@ i3status has the following dependencies: * libyajl-dev * libasound2-dev * libnl-genl-3-dev - * libcap2-bin (for getting network status without root permissions) * asciidoc (only for the documentation) * libpulse-dev (for getting the current volume using PulseAudio) On debian-based systems, the following line will install all requirements: ```bash -apt-get install libconfuse-dev libyajl-dev libasound2-dev libiw-dev asciidoc libcap2-bin libpulse-dev libnl-genl-3-dev +apt-get install libconfuse-dev libyajl-dev libasound2-dev libiw-dev asciidoc libpulse-dev libnl-genl-3-dev ``` ## Upstream @@ -376,7 +376,7 @@ int main(int argc, char *argv[]) { CFG_STR("threshold_type", "time", CFGF_NONE), CFG_BOOL("last_full_capacity", false, CFGF_NONE), CFG_BOOL("integer_battery_capacity", false, CFGF_NONE), - CFG_BOOL("hide_seconds", false, CFGF_NONE), + CFG_BOOL("hide_seconds", true, CFGF_NONE), CFG_CUSTOM_ALIGN_OPT, CFG_CUSTOM_COLOR_OPTS, CFG_CUSTOM_MIN_WIDTH_OPT, diff --git a/i3status.conf b/i3status.conf index 07ffb74..6ac43cb 100644 --- a/i3status.conf +++ b/i3status.conf @@ -26,7 +26,6 @@ wireless _first_ { } ethernet _first_ { - # if you use %speed, i3status requires root privileges format_up = "E: %ip (%speed)" format_down = "E: down" } diff --git a/man/i3status.man b/man/i3status.man index 86f6216..665dca6 100644 --- a/man/i3status.man +++ b/man/i3status.man @@ -66,7 +66,6 @@ wireless wlan0 { } ethernet eth0 { - # if you use %speed, i3status requires the cap_net_admin capability format_up = "E: %ip (%speed)" format_down = "E: down" } @@ -318,8 +317,7 @@ network interface found on the system (excluding devices starting with "lo"). Gets the IP address and (if possible) the link speed of the given ethernet interface. If no IPv4 address is available and an IPv6 address is, it will be -displayed. Getting the link speed requires the cap_net_admin capability. -Set it using +setcap cap_net_admin=ep $(which i3status)+. +displayed. The special interface name `_first_` will be replaced by the first non-wireless network interface found on the system (excluding devices starting with "lo"). @@ -338,8 +336,8 @@ estimated to be empty. If you want to use the last full capacity instead of the design capacity (when using the design capacity, it may happen that your battery is at 23% when fully charged because it’s old. In general, I want to see it this way, because it tells me how worn off my battery is.), just specify -+last_full_capacity = true+. You can hide seconds in the remaining time and -empty time estimations by setting +hide_seconds = true+. ++last_full_capacity = true+. You can show seconds in the remaining time and +empty time estimations by setting +hide_seconds = false+. If you want the battery percentage to be shown without decimals, add +integer_battery_capacity = true+. diff --git a/src/print_eth_info.c b/src/print_eth_info.c index b30d2b0..996ce3b 100644 --- a/src/print_eth_info.c +++ b/src/print_eth_info.c @@ -33,7 +33,6 @@ static int print_eth_speed(char *outwalk, const char *interface) { #if defined(LINUX) - /* This code path requires root privileges */ int ethspeed = 0; struct ifreq ifr; struct ethtool_cmd ecmd; diff --git a/testcases/001-battery/expected_output.txt b/testcases/001-battery/expected_output.txt index 6e1898b..ab4bc9f 100644 --- a/testcases/001-battery/expected_output.txt +++ b/testcases/001-battery/expected_output.txt @@ -1 +1 @@ -BAT 30.64% 02:09:32 +BAT 30.64% 02:09 diff --git a/testcases/015-battery-capacity/expected_output.txt b/testcases/015-battery-capacity/expected_output.txt index 663a593..fb37af8 100644 --- a/testcases/015-battery-capacity/expected_output.txt +++ b/testcases/015-battery-capacity/expected_output.txt @@ -1 +1 @@ -Touchpad: 30.64% BAT 02:09:32 +Touchpad: 30.64% BAT 02:09 diff --git a/testcases/021-battery-second/BAT0_uevent b/testcases/021-battery-second/BAT0_uevent new file mode 100644 index 0000000..b994324 --- /dev/null +++ b/testcases/021-battery-second/BAT0_uevent @@ -0,0 +1,4 @@ +POWER_SUPPLY_STATUS=Discharging +POWER_SUPPLY_CURRENT_NOW=1107000 +POWER_SUPPLY_CHARGE_FULL_DESIGN=7800000 +POWER_SUPPLY_CHARGE_NOW=2390000 diff --git a/testcases/021-battery-second/expected_output.txt b/testcases/021-battery-second/expected_output.txt new file mode 100644 index 0000000..6e1898b --- /dev/null +++ b/testcases/021-battery-second/expected_output.txt @@ -0,0 +1 @@ +BAT 30.64% 02:09:32 diff --git a/testcases/021-battery-second/i3status.conf b/testcases/021-battery-second/i3status.conf new file mode 100644 index 0000000..3aa2262 --- /dev/null +++ b/testcases/021-battery-second/i3status.conf @@ -0,0 +1,11 @@ +general { + output_format = "none" +} + +order += "battery all" + +battery all { + format = "%status %percentage %remaining" + path = "testcases/021-battery-second/BAT%d_uevent" + hide_seconds = false +} |