summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Bürk <admin@airblader.de>2018-06-29 22:49:52 +0200
committerGitHub <noreply@github.com>2018-06-29 22:49:52 +0200
commit78c0a53c45428a9671c2d0c38dc5483f66465bf2 (patch)
tree18198735867b1d3a4f65eed1a6d6f6616d49b15d
parenta916481aab2d81b1882a25da34a2fe327d74cff4 (diff)
parent50b899ba42c074c430f612fbf868bae364bcabd7 (diff)
Merge pull request #293 from Stunkymonkey/hide_seconds_battery
hide seconds in battery by default
-rw-r--r--i3status.c2
-rw-r--r--man/i3status.man4
-rw-r--r--testcases/001-battery/expected_output.txt2
-rw-r--r--testcases/015-battery-capacity/expected_output.txt2
-rw-r--r--testcases/021-battery-second/BAT0_uevent4
-rw-r--r--testcases/021-battery-second/expected_output.txt1
-rw-r--r--testcases/021-battery-second/i3status.conf11
7 files changed, 21 insertions, 5 deletions
diff --git a/i3status.c b/i3status.c
index 316159c..8621f2c 100644
--- a/i3status.c
+++ b/i3status.c
@@ -375,7 +375,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/man/i3status.man b/man/i3status.man
index fecd079..396fb0a 100644
--- a/man/i3status.man
+++ b/man/i3status.man
@@ -333,8 +333,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/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
+}