diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/i3blocks/temperature | 11 |
1 files changed, 7 insertions, 4 deletions
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; |