This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+tools/geolocation
Miciah Dashiel Butler Masters 78297be625 Fix various typos
* Fix various isolated typos

"apppend" -> "append"

"availabe" -> "available"

"Descripti using ternon" -> "Description"

"you have not them" -> "you don't have them"

"new on" -> "new one"

"plained" -> "curved"

"repel" -> "REPL"

"vairable" -> "variable"

* Fix a few errors in the CoffeeScript layer readme

Add a missing "the".

Correct a reference to the layer as "javascript" to "coffeescript".

Fix the syntax on the link to CoffeeLint.

* Fix typos: "dofile" -> "dotfile"

* Fix typos: "formated" and "formating"

"formated" -> "formatted"

"formating" -> "formatting"

* hy: Fix docstrings in funcs.el

Fix copy-and-pasted docstring text for
spacemacs/hy-shell-eval-current-form-and-go and
spacemacs/hy-shell-eval-region-and-go.

* Fix typos: "indendation" -> "indentation"

* Fix typos: "the the", "a a"

Fix duplicated (or misplaced) articles.

* Fix typos: "wether" -> "whether"

* Fix typos: "intialize" -> "initialize"
2018-05-23 22:12:30 -04:00
..
extensions/theme-changer Happy New Year 2018! 2018-01-04 02:00:25 -05:00
img layers directory: create new categories 2016-03-23 21:39:43 -04:00
config.el Happy New Year 2018! 2018-01-04 02:00:25 -05:00
extensions.el Happy New Year 2018! 2018-01-04 02:00:25 -05:00
funcs.el Happy New Year 2018! 2018-01-04 02:00:25 -05:00
packages.el Revert "Defer packages by default using use-package-always-defer" 2018-03-03 23:40:10 -05:00
README.org Fix various typos 2018-05-23 22:12:30 -04:00

Geolocation layer

Description

This layer offers location sensitive adjustments to Emacs.

Features:

  • Supports the following adjustments:

    • Automatic switching between light (day) and dark (night) themes via theme-changer
    • Local weather forecast via sunshine
    • Integration with OS X's CoreLocation service via osx-location
    • Manual location setting via variables in your dotfile

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add geolocation to the existing dotspacemacs-configuration-layers list in this file.

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

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

Configuration

Location

Set location manually by setting the following variables in your dotfile:

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

OSX-location

Mac users can take adavantage of automatic geogrphical discovery using the OS' CoreLocation system service, implemented as a long running background process. In order to enable it, set geolocation-enable-location-service to t as explained in installation instructions.

A helper script will need to be given proper access first time this layer is activated.

/TakeV/spacemacs/media/commit/4d75af3e891eddf7a88727d09aababb69041957e/layers/+tools/geolocation/img/emacs-location-helper.jpg

Theme-changer

This layer implement a simple "theme changer" which, when enabled, will switch between first two themes the user has setup in dotspacemacs-themes. First theme listed will be used as the light variant, while the second as the dark. Other themes will be ignored by this layer, though they are still available for cycling, etc.

Note that theme-changer requires location to be set.

Sunshine (weather forecast)

Sunshine display local weather forecast.

Setup OpenWeatherMap API key. Set sunshine-appid to some hash string from the openweathermap website. You need to sign up to the website to get a API key.

  (setq sunshine-appid "your-apikey")

Configure your location by setting the variable sunshine-location. You can provide a string, like "New York, NY" or a ZIP code, like "90210". This variable is available through the Customize facility.

When specifying a ZIP code, you may receive results from a foreign country. This is due to weird behavior from OpenWeatherMap. To resolve this, append a comma and the country code after the ZIP code. Note the lack of a space in the example below.

(setq sunshine-location "90210,USA")

It will use the imperial unit system by default. To switch to metric, add sunshine-units 'metric to the variables list for this layer, or add this.

  (setq sunshine-units 'metric)

Weather forecast icons are disabled by default, and can be toggled by pressing `i' within this mode's main buffer.

To display weather forecast icons by default ("pretty mode"), add sunshine-show-icons t to the variables list for this layer, or add this:

  (setq sunshine-show-icons t)

/TakeV/spacemacs/media/commit/4d75af3e891eddf7a88727d09aababb69041957e/layers/+tools/geolocation/img/emacs-sunshine.jpg

Key Bindings

Weather

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