diff --git a/README.md b/README.md index d4d4457..b195d2a 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ If you are running an older version of OS X and the install fails you might want --no-scale Display just the stat value --value-only No graph, label, or scale -f, --fahrenheit Display temperatures in fahrenheit + -c, --celcius Display temperatures in celcius (default) for more help see: https://github.com/Chris911/iStats ``` @@ -65,6 +66,15 @@ iStats now supports extra sensors for advanced users. Here's how to enable that 2. Enable extra sensors by running `istats enable key` or `istats enable all` 3. Run `istats` or `istats extra` to see the extra sensors information. +The temperature scale can be configured persistently by adding a section to `~/.iStats/sensors.conf` like this: + +``` +[app_config] +temperature_scale = fahrenheit +``` + +The valid values are 'fahrenheit' and 'celcius' (which is the default) and can be overridden using the corresponding command line options. + ## Contributing 1. Fork it diff --git a/lib/iStats/command.rb b/lib/iStats/command.rb index 3645daf..6ab9432 100644 --- a/lib/iStats/command.rb +++ b/lib/iStats/command.rb @@ -88,7 +88,7 @@ def parse_options :display_graphs => true, :display_labels => true, :display_scale => true, - :temperature_scale => 'celcius', + :temperature_scale => ($config.params.dig('app_config', 'temperature_scale') || 'celcius').downcase } opt_parser = OptionParser.new do |opts| @@ -123,6 +123,10 @@ def parse_options opts.on('-f', '--fahrenheit', 'Display temperatures in fahrenheit') do options[:temperature_scale] = 'fahrenheit' end + + opts.on('-c', '--celcius', 'Display temperatures in celcius (default)') do + options[:temperature_scale] = 'celcius' + end end begin @@ -175,6 +179,7 @@ def help(error = nil) --no-scale Display just the stat value --value-only No graph, label, or scale -f, --fahrenheit Display temperatures in fahrenheit + -c, --celcius Display temperatures in celcius (default) for more help see: https://github.com/Chris911/iStats ".gsub(/^ {8}/, '') # strip the first eight spaces of every line diff --git a/lib/iStats/version.rb b/lib/iStats/version.rb index 434f1c9..37f647d 100644 --- a/lib/iStats/version.rb +++ b/lib/iStats/version.rb @@ -1,3 +1,3 @@ module IStats - VERSION = '1.6.1' + VERSION = '1.6.2' end