# Display current battery charge if running on a laptop. Redisplay every 3
# minutes.
backtick 1 180 180 $HOME/.shell/bin/battery.pl -s BATTERY # (BATTERY)
+# Display current temperature if running on a laptop. Redisplay every minute.
+backtick 2 60 60 $HOME/.shell/bin/temperature.pl -s TEMPERATURE # (TEMPERATURE)
# Make sure the temporary variable we use is empty. Thanks to
# http://gist.github.com/133000 for the idea to use setenv and to TauPan in
setenv s "$s%l" # - load average
setenv s "$s " # - space
setenv s "$s%H" # - hostname
+setenv s "$s " # - space (TEMPERATURE)
+setenv s "$s%2`" # - temperature (TEMPERATURE)
setenv s "$s " # - space (BATTERY)
setenv s "$s%1`" # - battery status (BATTERY)
hardstatus alwayslastline "$s"
done
apply_optional_replacement screenrc \
battery BATTERY "$battery"
+# Display current temperature. Necessary lines are marked as "(TEMPERATURE)".
+# Also used for Tmux.
+temperature=/sys/devices/platform/coretemp.0
+if ! test -d "$temperature"; then
+ temperature=
+fi
+apply_optional_replacement screenrc \
+ temperature TEMPERATURE "$temperature"
if installed tmux; then
apply_optional_replacement tmux.conf \
battery BATTERY "$battery"
+ apply_optional_replacement tmux.conf \
+ temperature TEMPERATURE "$temperature"
# Old Tmux versions can't handle that.
generate tmux.conf '' ./bin/remove-continuation.pl
# Current load average and hostname (#H) on the right.
set-option -g status-right "#(uptime | sed 's/^.*load averages*: //; s/,//g') \
#H \
+ #(~/.shell/bin/temperature.pl -t TEMPERATURE)\
#[] #(~/.shell/bin/battery.pl -t BATTERY)\
"