spacemacs/layers/geolocation
Sebastian Wiesner 460e4b9335 Fix access to possibly void variable
calendar-location-name comes from solar.el which is neither loaded by
default nor by this layer.  Hence it can potentially be void and must
not be accessed directly.

Instead wrap it in bound-and-true-p to guard against it being void.
2015-10-18 10:17:11 -04:00
..
img Move location layer to geolocation layer 2015-10-13 23:48:44 -04:00
config.el Move location layer to geolocation layer 2015-10-13 23:48:44 -04:00
packages.el Fix access to possibly void variable 2015-10-18 10:17:11 -04:00
README.org Move location layer to geolocation layer 2015-10-13 23:48:44 -04:00

Geolocation contribution layer for Spacemacs

Description

This layer offers few location sensitive adjustment to Emacs, such as automatically switching between light (day) and dark (night) themes, weather forecast and on OS X, also automatic tracking of location, using OS X's CoreLocation services.

Supported packages in this layer

Install

To enable this contribution layer, add it to your =~/.spacemacs=~ like this:

  (setq-default dotspacemacs-configuration-layers '(location))

All services are disable by default. To enable all, or some of them, add instead something like this:

  (geolocation :variables
               geolocation-enable-osx-location-service-support t
               geolocation-enable-weather-forecast t
               geolocation-enable-automatic-theme-changer t)

Configuration

Location

To set location manually, add something like this inside the dotspacemacs/config defun.

  (setq calendar-location-name "Barcelona, Spain"
        calendar-latitude 41.23
        calendar-longitude 1.80)

On OS X, all of these variables get setup automatically by the osx-location service, when enabled. If calendar-location-name was omitted, it'll be stringed-up like so: "41.23, 1.80".

theme-changer

Theme changer will switch between the first two themes the user has setup in dotspacemacs-themes, depending on time at geographical location.

sunshine (weather forecast)

Sunshine uses the imperial unit system by default. To switch to metric, do this:

  (setq sunshine-units 'metric)

Weather forecast icons are disabled by default, but can be toggled by pressing `i' within this mode's main buffer. To display weather forecast icons by default ("pretty mode"), change the settings to this:

  (setq sunshine-show-icons t)

/TakeV/spacemacs/media/commit/460e4b933540c8d8742995e95916f28671372908/layers/geolocation/img/emacs-sunshine.jpg

osx-location

OS X users can take adavantage of automatic geogrphical discovery using the OS' CoreLocation system service, implemented as a long running background process. A helper script will need to be given proper access first time this layer is activated.

/TakeV/spacemacs/media/commit/460e4b933540c8d8742995e95916f28671372908/layers/geolocation/img/emacs-location-helper.jpg

Key Bindings

Weather

Evil Holy Command
SPC a w Display pretty weather forecast
SPC a W Display quick weather forecast in mini buffer