Coder Social home page Coder Social logo

sky-color-clock's Introduction

sky-color-clock.el

A clock widget for modelines with real-time sky color and moonphase/weather icon

その時刻の空の色と月齢・天気を反映したモードライン用時計

Sunrise/sunset time and moonphase are estimated from your location (latitude).

Weather (either raining, snowing or not), cloudiness and temperature are (optionally) fetched via Openweathermap API.

Screenshots

A cold morning.

./images/sample1_cold_morning.png

A sunny noon.

./images/sample2_sunny_noon.png

A warm evening.

./images/sample3_warm_evening.png

Sunset.

./images/sample4_sunset.png

After sunset.

./images/sample5_after_sunset.png

A night.

./images/sample6_night.png

A warm rainy day with a few clouds.

./images/sample7_warm_rainy_day.png

A cold cloudy snowy day.

./images/sample8_cold_cloudy_snowy_day.png

Installation

Put sky-color-clock.el in a “load-path”ed directory, require this script

(require 'sky-color-clock)

and initialize sky-color-clock with your location’s latitude

(sky-color-clock-initialize 35) ; Tokyo, Japan

Then function sky-color-clock returns a propertized string, which you may add to your mode-line-format.

(push '(:eval (sky-color-clock)) (default-value 'mode-line-format))

You also may give sky-color-clock a Openweathermap API key

(sky-color-clock-initialize-openweathermap-client "API-Key" 1850144) ; Tokyo's City ID

to enable weather icon (rain or snow), tmperature indicator and reflect cloudiness to the sky color.

Features / Customization

Time Format

You may change time format with sky-color-clock-format

(setq sky-color-clock-format "%d %H:%M")

which is internally passed to format-time-string function.

Background Colors

Background color changes over the time, with respect to the sunset / sunrise time of the day at your location.

Sunset / sunrise time are estimated from your location’s latitude, which you passed to sky-color-clock-initialize.

(sky-color-clock-initialize 35) ; Tokyo, Japan

Color samples:

./images/colors.png

Moonphase Icon

Moonphase icon is displayed with an unicode emoji, if sky-color-clock-enable-emoji-icon is non-nil.

(setq sky-color-clock-enable-emoji-icon t)

Openweathermap Integration

When an openweathermap API key and a city ID is passed to sky-color-clock with sky-color-clock-initialize-openweathermap-client,

(sky-color-clock-initialize-openweathermap-client "API-key" 1850144)

sky-color-clock fetches the current weather (at the specified city) every 30 minutes, and following features are enabled in addition.

Cloudy Colors

Reflect cloudiness (0%-100%) at the time, to the background sky color.

./images/cloudiness.png

Temperature Indicator

Adds a temperature indicator to the right of the clock, which indicates temperature at the time with a color.

0[C] - 15[C] - 30[C]

./images/temperature.png

You can disable this feature with sky-color-clock-enable-temperature-indicator.

(setq sky-color-clock-enable-temperature-indicator nil)

Rain / Snow Icon

A rain / snow emoji is displayed instead of the moonphase icon, if it’s raining or snowing.

You need to enable the moonphase icon feature to enable this feature.

sky-color-clock's People

Contributors

zk-phi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.