]> git.sur5r.net Git - i3/i3status/commitdiff
Merge pull request #179 from mihaicmn/feature-threshold-format
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Wed, 16 Nov 2016 21:45:59 +0000 (13:45 -0800)
committerGitHub <noreply@github.com>
Wed, 16 Nov 2016 21:45:59 +0000 (13:45 -0800)
Provide format_above_threshold/format_below_threshold options

testcases/002-cpu-temp/expected_output.txt [new file with mode: 0644]
testcases/002-cpu-temp/i3status.conf [new file with mode: 0644]
testcases/002-cpu-temp/temp1_input [new file with mode: 0644]
testcases/003-path-exists/expected_output.txt [new file with mode: 0644]
testcases/003-path-exists/i3status.conf [new file with mode: 0644]
testcases/004-run-watch/expected_output.txt [new file with mode: 0644]
testcases/004-run-watch/i3status.conf [new file with mode: 0644]
testcases/004-run-watch/pidfile [new file with mode: 0644]

diff --git a/testcases/002-cpu-temp/expected_output.txt b/testcases/002-cpu-temp/expected_output.txt
new file mode 100644 (file)
index 0000000..e46afa8
--- /dev/null
@@ -0,0 +1 @@
+T: 42 °C
diff --git a/testcases/002-cpu-temp/i3status.conf b/testcases/002-cpu-temp/i3status.conf
new file mode 100644 (file)
index 0000000..d83b32d
--- /dev/null
@@ -0,0 +1,10 @@
+general {
+        output_format = "none"
+}
+
+order = "cpu_temperature 0"
+
+cpu_temperature 0 {
+        format = "T: %degrees °C"
+        path = "testcases/002-cpu-temp/temp1_input"
+}
diff --git a/testcases/002-cpu-temp/temp1_input b/testcases/002-cpu-temp/temp1_input
new file mode 100644 (file)
index 0000000..6096bd1
--- /dev/null
@@ -0,0 +1 @@
+42000
diff --git a/testcases/003-path-exists/expected_output.txt b/testcases/003-path-exists/expected_output.txt
new file mode 100644 (file)
index 0000000..3dbe379
--- /dev/null
@@ -0,0 +1 @@
+EXISTING: yes | NONEXISTANT: no
diff --git a/testcases/003-path-exists/i3status.conf b/testcases/003-path-exists/i3status.conf
new file mode 100644 (file)
index 0000000..38ca7d4
--- /dev/null
@@ -0,0 +1,14 @@
+general {
+        output_format = "none"
+}
+
+order += "path_exists EXISTING"
+order += "path_exists NONEXISTANT"
+
+path_exists EXISTING {
+        path = "testcases/003-path-exists"
+}
+
+path_exists NONEXISTANT {
+        path = "testcases/003-path-exists/nonexistant"
+}
diff --git a/testcases/004-run-watch/expected_output.txt b/testcases/004-run-watch/expected_output.txt
new file mode 100644 (file)
index 0000000..3dbe379
--- /dev/null
@@ -0,0 +1 @@
+EXISTING: yes | NONEXISTANT: no
diff --git a/testcases/004-run-watch/i3status.conf b/testcases/004-run-watch/i3status.conf
new file mode 100644 (file)
index 0000000..95a9bb1
--- /dev/null
@@ -0,0 +1,14 @@
+general {
+        output_format = "none"
+}
+
+order += "run_watch EXISTING"
+order += "run_watch NONEXISTANT"
+
+run_watch EXISTING {
+        pidfile = "testcases/004-run-watch/pidfile"
+}
+
+run_watch NONEXISTANT {
+        pidfile = "testcases/004-run-watch/notexistant"
+}
diff --git a/testcases/004-run-watch/pidfile b/testcases/004-run-watch/pidfile
new file mode 100644 (file)
index 0000000..d00491f
--- /dev/null
@@ -0,0 +1 @@
+1