]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - setup.sh
screenrc,tmux.conf: Display CPU temperature.
[config/dotfiles.git] / setup.sh
index 3edf5f4d15ad26460b95ee590224932238ad75bd..197263de0aca28cd92d749de5adb1d6599c19afc 100755 (executable)
--- a/setup.sh
+++ b/setup.sh
@@ -195,6 +195,14 @@ for x in /sys/class/power_supply/BAT*; do
 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
@@ -202,6 +210,8 @@ 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