aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-04-23 15:35:56 -0500
committerJesús <heckyel@hyperbola.info>2019-04-23 15:35:56 -0500
commit2e399b105ecea123b42e9ed21ec1a562799e0cd6 (patch)
tree6c984abc8429960b75bf9ce6ad9484d4d506c5ed
parentc1a11261f26ca8f8c0e94fda0f7acbe226e38452 (diff)
downloadi3-config-2e399b105ecea123b42e9ed21ec1a562799e0cd6.tar.lz
i3-config-2e399b105ecea123b42e9ed21ec1a562799e0cd6.tar.xz
i3-config-2e399b105ecea123b42e9ed21ec1a562799e0cd6.zip
temperature: use injected properties
-rw-r--r--i3blocks.conf13
-rwxr-xr-xscripts/i3blocks/temperature11
2 files changed, 12 insertions, 12 deletions
diff --git a/i3blocks.conf b/i3blocks.conf
index a08bcb9..6b06e9a 100644
--- a/i3blocks.conf
+++ b/i3blocks.conf
@@ -125,15 +125,12 @@ interval=10
# Support multiple chips, though lm-sensors.
# The script may be called with -w and -c switches to specify thresholds,
# see the script for details.
-# [temperature]
-# label=TEMP
-# interval=10
-
-[temp]
-label=
-command=echo "$(sensors coretemp-isa-0000 | awk '/Physical/ {print $4}')"
+[temperature]
+label=:
interval=10
-color=#18FFFF
+#T_WARN=70
+#T_CRIT=90
+#SENSOR_CHIP=""
#[load_average]
#interval=10
diff --git a/scripts/i3blocks/temperature b/scripts/i3blocks/temperature
index ad745c3..e362b48 100755
--- a/scripts/i3blocks/temperature
+++ b/scripts/i3blocks/temperature
@@ -1,8 +1,9 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com>
# Copyright 2014 Benjamin Chretien <chretien at lirmm dot fr>
+# Copyright 2019 Jesus E. <heckyel at hyperbola dot info>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -25,9 +26,9 @@ use Getopt::Long;
binmode(STDOUT, ":utf8");
# default values
-my $t_warn = 70;
-my $t_crit = 90;
-my $chip = "";
+my $t_warn = $ENV{T_WARN} || 70;
+my $t_crit = $ENV{T_CRIT} || 90;
+my $chip = $ENV{SENSOR_CHIP} || "";
my $temperature = -9999;
sub help {
@@ -64,6 +65,8 @@ if ($temperature >= $t_crit) {
exit 33;
} elsif ($temperature >= $t_warn) {
print "#FFFC00\n";
+} elsif ($temperature < $t_warn) {
+ print "#18FFFF\n";
}
exit 0;