├── .gitignore ├── Readme.org ├── images ├── cloudiness.png ├── colors.png ├── sample1_cold_morning.png ├── sample2_sunny_noon.png ├── sample3_warm_evening.png ├── sample4_sunset.png ├── sample5_after_sunset.png ├── sample6_night.png ├── sample7_warm_rainy_day.png ├── sample8_cold_cloudy_snowy_day.png └── temperature.png └── sky-color-clock.el /.gitignore: -------------------------------------------------------------------------------- 1 | *.elc 2 | 3 | -------------------------------------------------------------------------------- /Readme.org: -------------------------------------------------------------------------------- 1 | * sky-color-clock.el 2 | 3 | A clock widget for modelines with real-time sky color and 4 | moonphase/weather icon 5 | 6 | その時刻の空の色と月齢・天気を反映したモードライン用時計 7 | 8 | Sunrise/sunset time and moonphase are estimated from your location 9 | (latitude). 10 | 11 | Weather (either raining, snowing or not), cloudiness and temperature 12 | are (optionally) fetched via Openweathermap API. 13 | 14 | ** Screenshots 15 | 16 | A cold morning. 17 | 18 | [[file:./images/sample1_cold_morning.png]] 19 | 20 | A sunny noon. 21 | 22 | [[file:./images/sample2_sunny_noon.png]] 23 | 24 | A warm evening. 25 | 26 | [[file:./images/sample3_warm_evening.png]] 27 | 28 | Sunset. 29 | 30 | [[file:./images/sample4_sunset.png]] 31 | 32 | After sunset. 33 | 34 | [[file:./images/sample5_after_sunset.png]] 35 | 36 | A night. 37 | 38 | [[file:./images/sample6_night.png]] 39 | 40 | A warm rainy day with a few clouds. 41 | 42 | [[file:./images/sample7_warm_rainy_day.png]] 43 | 44 | A cold cloudy snowy day. 45 | 46 | [[file:./images/sample8_cold_cloudy_snowy_day.png]] 47 | 48 | ** Installation 49 | 50 | Put sky-color-clock.el in a "load-path"ed directory, require this 51 | script 52 | 53 | : (require 'sky-color-clock) 54 | 55 | and initialize sky-color-clock with your location's latitude 56 | 57 | : (sky-color-clock-initialize 35) ; Tokyo, Japan 58 | 59 | Then function =sky-color-clock= returns a propertized string, which 60 | you may add to your =mode-line-format=. 61 | 62 | : (push '(:eval (sky-color-clock)) (default-value 'mode-line-format)) 63 | 64 | You also may give sky-color-clock a Openweathermap API key 65 | 66 | : (sky-color-clock-initialize-openweathermap-client "API-Key" 1850144) ; Tokyo's City ID 67 | 68 | to enable weather icon (rain or snow), tmperature indicator and 69 | reflect cloudiness to the sky color. 70 | 71 | ** Features / Customization 72 | *** Time Format 73 | 74 | You may change time format with =sky-color-clock-format= 75 | 76 | : (setq sky-color-clock-format "%d %H:%M") 77 | 78 | which is internally passed to =format-time-string= function. 79 | 80 | *** Background Colors 81 | 82 | Background color changes over the time, with respect to the sunset / 83 | sunrise time of the day at your location. 84 | 85 | Sunset / sunrise time are estimated from your location's latitude, 86 | which you passed to =sky-color-clock-initialize=. 87 | 88 | : (sky-color-clock-initialize 35) ; Tokyo, Japan 89 | 90 | Color samples: 91 | 92 | [[file:./images/colors.png]] 93 | 94 | *** Moonphase Icon 95 | 96 | Moonphase icon is displayed with an unicode emoji, if 97 | =sky-color-clock-enable-emoji-icon= is non-nil. 98 | 99 | : (setq sky-color-clock-enable-emoji-icon t) 100 | 101 | *** Openweathermap Integration 102 | 103 | When an openweathermap API key and a city ID is passed to 104 | sky-color-clock with 105 | =sky-color-clock-initialize-openweathermap-client=, 106 | 107 | : (sky-color-clock-initialize-openweathermap-client "API-key" 1850144) 108 | 109 | sky-color-clock fetches the current weather (at the specified city) 110 | every 30 minutes, and following features are enabled in addition. 111 | 112 | **** Cloudy Colors 113 | 114 | Reflect cloudiness (0%-100%) at the time, to the background sky color. 115 | 116 | [[file:./images/cloudiness.png]] 117 | 118 | **** Temperature Indicator 119 | 120 | Adds a temperature indicator to the right of the clock, which 121 | indicates temperature at the time with a color. 122 | 123 | 0[C] - 15[C] - 30[C] 124 | 125 | [[file:./images/temperature.png]] 126 | 127 | You can disable this feature with 128 | =sky-color-clock-enable-temperature-indicator=. 129 | 130 | : (setq sky-color-clock-enable-temperature-indicator nil) 131 | 132 | **** Rain / Snow Icon 133 | 134 | A rain / snow emoji is displayed instead of the moonphase icon, if 135 | it's raining or snowing. 136 | 137 | You need to enable the moonphase icon feature to enable this feature. 138 | -------------------------------------------------------------------------------- /images/cloudiness.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/cloudiness.png -------------------------------------------------------------------------------- /images/colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/colors.png -------------------------------------------------------------------------------- /images/sample1_cold_morning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/sample1_cold_morning.png -------------------------------------------------------------------------------- /images/sample2_sunny_noon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/sample2_sunny_noon.png -------------------------------------------------------------------------------- /images/sample3_warm_evening.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/sample3_warm_evening.png -------------------------------------------------------------------------------- /images/sample4_sunset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/sample4_sunset.png -------------------------------------------------------------------------------- /images/sample5_after_sunset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/sample5_after_sunset.png -------------------------------------------------------------------------------- /images/sample6_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/sample6_night.png -------------------------------------------------------------------------------- /images/sample7_warm_rainy_day.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/sample7_warm_rainy_day.png -------------------------------------------------------------------------------- /images/sample8_cold_cloudy_snowy_day.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/sample8_cold_cloudy_snowy_day.png -------------------------------------------------------------------------------- /images/temperature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zk-phi/sky-color-clock/525122ffb94ae4ac160de72c2ee0ade331d2e80a/images/temperature.png -------------------------------------------------------------------------------- /sky-color-clock.el: -------------------------------------------------------------------------------- 1 | ;;; -*- lexical-binding: t -*- 2 | ;;; sky-color-clock.el --- A clock widget for modelines with real-time sky color and moonphase/weather icon 3 | 4 | ;; Copyright (C) 2018- zk_phi 5 | 6 | ;; This program is free software; you can redistribute it and/or modify 7 | ;; it under the terms of the GNU General Public License as published by 8 | ;; the Free Software Foundation; either version 2 of the License, or 9 | ;; (at your option) any later version. 10 | ;; 11 | ;; This program is distributed in the hope that it will be useful, 12 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ;; GNU General Public License for more details. 15 | ;; 16 | ;; You should have received a copy of the GNU General Public License 17 | ;; along with this program; if not, write to the Free Software 18 | ;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | ;; Version: 1.0.2 21 | ;; Author: zk_phi 22 | ;; URL: https://github.com/zk-phi/sky-color-clock 23 | 24 | ;;; Commentary: 25 | 26 | ;; Put sky-color-clock.el in a "load-path"ed directory, require this 27 | ;; script 28 | ;; 29 | ;; (require 'sky-color-clock) 30 | ;; 31 | ;; and initialize sky-color-clock with your location's latitude 32 | ;; 33 | ;; (sky-color-clock-initialize 35) ; Tokyo, Japan 34 | ;; 35 | ;; Then function `sky-color-clock' returns a propertized string, 36 | ;; which you may add to your `mode-line-format'. 37 | ;; 38 | ;; (push '(:eval (sky-color-clock)) (default-value 'mode-line-format)) 39 | ;; 40 | ;; You also may give sky-color-clock a Openweathermap API key 41 | ;; 42 | ;; (sky-color-clock-initialize-openweathermap-client "API-Key" 1850144) ; Tokyo's City ID 43 | ;; 44 | ;; to enable weather icon (rain or snow), tmperature indicator and 45 | ;; reflect cloudiness to the sky color. 46 | 47 | ;;; Change Log: 48 | 49 | ;; 1.0.0 Initial release 50 | ;; 1.0.1 Add option sky-color-clock-enable-daytime-emoji 51 | ;; 1.0.2 Use json-parse-string on Emacs >=27.1 for performance 52 | 53 | ;;; Code: 54 | 55 | (require 'cl-lib) 56 | (require 'color) 57 | (require 'url) 58 | (unless (fboundp 'json-parse-string) 59 | (require 'json)) 60 | 61 | (defconst sky-color-clock-version "1.0.1") 62 | 63 | (defgroup sky-color-clock nil 64 | "A clock widget for modelines with real-time sky color and 65 | moonphase/weather icon." 66 | :group 'emacs) 67 | 68 | (defcustom sky-color-clock-format "%d %H:%M" 69 | "Format string passed to `format-time-string'." 70 | :group 'sky-color-clock 71 | :type 'string) 72 | 73 | (defcustom sky-color-clock-enable-emoji-icon t 74 | "When non-nil, an emoji icon is added to the left of the clock 75 | to indicate either rain, snow or moonphase otherwise. You also 76 | need to initialize openweathermap client with 77 | `sky-color-clock-initialize-openweathermap-client' to fetch 78 | weather informations." 79 | :group 'sky-color-clock 80 | :type 'boolean) 81 | 82 | (defcustom sky-color-clock-enable-daytime-emoji nil 83 | "When non-nil and `sky-color-clock-enable-emoji-icon' is 84 | enabled, use sun (or cloud) emoji to indicate it's daytime." 85 | :group 'sky-color-clock 86 | :type 'boolean) 87 | 88 | (defcustom sky-color-clock-enable-temperature-indicator t 89 | "When non-nil, an indicator is added to the right of the clock 90 | to indicate current temperature. You also need to initialize 91 | openweathermap client with 92 | `sky-color-clock-initialize-openweathermap-client' to fetch 93 | weather informations." 94 | :group 'sky-color-clock 95 | :type 'boolean) 96 | 97 | ;; NOTE: solar.el, lunar.el has more accurate algorithm 98 | 99 | ;; ---- color utilities 100 | 101 | (defun sky-color-clock--make-gradient (&rest color-stops) 102 | "Make a function which takes a number and returns a color 103 | according to COLOR-STOPS, which is a sorted list of the 104 | form ((NUMBER . COLOR) ...)." 105 | (unless color-stops 106 | (error "No color-stops are specified.")) 107 | (let* ((first-color (pop color-stops)) 108 | (last-color first-color)) 109 | `(lambda (x) 110 | (cond ((<= x ,(car first-color)) ,(cdr first-color)) 111 | ,@(mapcar (lambda (next-color) 112 | (prog1 113 | `((<= x ,(car next-color)) 114 | (sky-color-clock--blend-colors 115 | ,(cdr last-color) ,(cdr next-color) 116 | (/ (- x ,(car last-color)) ,(float (- (car next-color) (car last-color)))))) 117 | (setq last-color next-color))) 118 | color-stops) 119 | (t ,(cdr last-color)))))) 120 | 121 | (defun sky-color-clock--blend-colors (basecolor mixcolor &optional fraction) 122 | "Blend to colors. FRACTION must be between 0.0 and 1.0, 123 | otherwise result may be broken." 124 | (cl-destructuring-bind (r g b) (color-name-to-rgb basecolor) 125 | (cl-destructuring-bind (rr gg bb) (color-name-to-rgb mixcolor) 126 | (let* ((x (or fraction 0.5)) (y (- 1 x))) 127 | (color-rgb-to-hex (+ (* r y) (* rr x)) (+ (* g y) (* gg x)) (+ (* b y) (* bb x))))))) 128 | 129 | ;; ---- openweathermap api 130 | 131 | (defvar sky-color-clock--openweathermap-timer nil) 132 | (defvar sky-color-clock--openweathermap-api-key nil) 133 | (defvar sky-color-clock--openweathermap-city-id nil) 134 | (defvar sky-color-clock--openweathermap-cache nil) 135 | 136 | (defun sky-color-clock--parse-json (str) 137 | (if (fboundp 'json-parse-string) ; Emacs >=27.1 138 | (json-parse-string str) 139 | (let ((json-object-type 'hash-table) 140 | (json-key-type 'string) 141 | (json-array-type 'vector)) 142 | (json-read-from-string str)))) 143 | 144 | (defun sky-color-clock--update-weather () 145 | "Fetch current weather via openweathermap API and update 146 | `sky-color-clock--openweathermap-cache'." 147 | (url-retrieve 148 | (format "http://api.openweathermap.org/data/2.5/weather?id=%s&appid=%s" 149 | sky-color-clock--openweathermap-city-id 150 | sky-color-clock--openweathermap-api-key) 151 | (lambda (_) 152 | (search-forward "\n\n" nil t) 153 | (setq sky-color-clock--openweathermap-cache 154 | (sky-color-clock--parse-json (buffer-substring (point) (point-max)))) 155 | (url-mark-buffer-as-dead (current-buffer))))) 156 | 157 | (defun sky-color-clock--cloudiness () 158 | "Get current cloudiness in percent from 159 | `sky-color-clock--openweathermap-cache', or nil." 160 | (when sky-color-clock--openweathermap-cache 161 | (gethash "all" (gethash "clouds" sky-color-clock--openweathermap-cache)))) 162 | 163 | (defun sky-color-clock--temperature () 164 | "Get current temperature in kelvin from 165 | `sky-color-clock--openweathermap-cache', or nil." 166 | (when sky-color-clock--openweathermap-cache 167 | (gethash "temp" (gethash "main" sky-color-clock--openweathermap-cache)))) 168 | 169 | (defun sky-color-clock--weather () 170 | "Get current weather as a 'weather condition code' from 171 | `sky-color-clock--openweathermap-cache', or nil." 172 | (when sky-color-clock--openweathermap-cache 173 | (gethash "id" (aref (gethash "weather" sky-color-clock--openweathermap-cache) 0)))) 174 | 175 | (defun sky-color-clock-initialize-openweathermap-client (api-key city-id &optional interval) 176 | "Initialize openweathermap client with API-KEY to fetch weather 177 | of city specified with CITY-ID every INTERVAL minutes. INTERVAL 178 | defaults 30." 179 | (when sky-color-clock--openweathermap-timer 180 | (cancel-timer sky-color-clock--openweathermap-timer) 181 | (setq sky-color-clock--openweathermap-timer nil)) 182 | (setq sky-color-clock--openweathermap-api-key api-key 183 | sky-color-clock--openweathermap-city-id city-id 184 | sky-color-clock--openweathermap-timer 185 | (run-with-timer 0 (* (or interval 30) 60) 'sky-color-clock--update-weather))) 186 | 187 | ;; ---- sky color 188 | 189 | (defvar sky-color-clock--bg-color-gradient nil 190 | "A function which converts a float time (12:30 as 12.5, for 191 | example), to a color.") 192 | 193 | (defvar sky-color-clock--sunrise nil 194 | "Sunrise time from noon") 195 | 196 | (defvar sky-color-clock--sunset nil 197 | "Sunset tiem from noon") 198 | 199 | ;;;###autoload 200 | (defun sky-color-clock-initialize (latitude) 201 | "Initialize sky-color-clock with LATITUDE (in degrees). Special 202 | cases are not considered for now: sun must rise after 02:00, 203 | daytime length must be longer than 2hrs, and sun must set before 204 | 23:30." 205 | (let* ((day-of-year ; day of year (0-origin) 206 | (1- (time-to-day-in-year (current-time)))) 207 | (sun-declination ; declination of the sun 208 | (degrees-to-radians 209 | (* -23.44 (cos (degrees-to-radians (* (/ 360 365.0) (+ day-of-year 10))))))) 210 | (sunset-hour-angle ; the "Sunrise equation" 211 | (* (acos (- (* (tan (degrees-to-radians latitude)) (tan sun-declination)))))) 212 | (sunset-time-from-noon ; rad -> hours 213 | (* 24 (/ (radians-to-degrees sunset-hour-angle) 360))) 214 | (sunrise (- 12 sunset-time-from-noon)) 215 | (sunset (+ 12 sunset-time-from-noon))) 216 | (setq sky-color-clock--sunrise sunrise 217 | sky-color-clock--sunset sunset 218 | sky-color-clock--bg-color-gradient 219 | (sky-color-clock--make-gradient 220 | (cons (- sunrise 2.0) "#111111") 221 | (cons (- sunrise 1.5) "#4d548a") 222 | (cons (- sunrise 1.0) "#c486b1") 223 | (cons (- sunrise 0.5) "#ee88a0") 224 | (cons sunrise "#ff7d75") 225 | (cons (+ sunrise 0.5) "#f4eeef") 226 | (cons (/ (+ sunset sunrise) 2) "#8bd7f5") 227 | (cons (- sunset 1.2) "#b3f2e6") 228 | (cons (- sunset 0.8) "#f3e693") 229 | (cons (- sunset 0.4) "#f86b10") 230 | (cons sunset "#100028") 231 | (cons (+ sunset 0.5) "#111111"))))) 232 | 233 | (defun sky-color-clock--pick-bg-color (time &optional cloudiness) 234 | "Pick a color from sky-color-clock--bg-color-gradient and 235 | saturate according to CLOUDINESS. CLOUDINESS can be a number from 236 | 0 to 100." 237 | (unless sky-color-clock--bg-color-gradient 238 | (error "sky-color-clock-initialize is not called.")) 239 | (cl-destructuring-bind (sec min hour . xs) (decode-time time) 240 | (let ((cloudiness (if cloudiness (/ cloudiness 100.0) 0.00)) 241 | (color (funcall sky-color-clock--bg-color-gradient (+ (/ (+ (/ sec 60.0) min) 60.0) hour)))) 242 | (cl-destructuring-bind (h s l) (apply 'color-rgb-to-hsl (color-name-to-rgb color)) 243 | (apply 'color-rgb-to-hex 244 | (color-hsl-to-rgb h (- s (* s cloudiness 0.9)) (min 0.95 (+ l (* cloudiness 0.15))))))))) 245 | 246 | (defun sky-color-clock--pick-fg-color (color) 247 | (cl-destructuring-bind (h s l) (apply 'color-rgb-to-hsl (color-name-to-rgb color)) 248 | (apply 'color-rgb-to-hex 249 | (color-hsl-to-rgb h s (min 1 (max 0 (+ l (if (> l 0.5) -0.55 0.55)))))))) 250 | 251 | (defun sky-color-clock-preview () 252 | (interactive) 253 | (switch-to-buffer (get-buffer-create "*sky-color-clock*")) 254 | (erase-buffer) 255 | (let ((sky-color-clock-enable-emoji-icon nil) 256 | (sky-color-clock-format "%H:%M")) 257 | (dotimes (hour 23) 258 | (dolist (min '(0 5 10 15 20 25 30 35 40 45 50 55)) 259 | (dolist (cloudiness '(0 30 60 90)) 260 | (dolist (temperature '(278 288 298)) 261 | (insert (sky-color-clock (encode-time 0 min hour 1 7 2018) cloudiness temperature) 262 | " "))) 263 | (insert "\n\n"))))) 264 | 265 | ;; ---- temperature 266 | 267 | (defvar sky-color-clock--temperature-color-gradient 268 | (sky-color-clock--make-gradient 269 | ;; -10 15 40 270 | '(263 . "#00a1ff") '(288 . "#ffffff") '(313 . "#ffa100"))) 271 | 272 | (defun sky-color-clock--temperature-indicator (temperature) 273 | (if (null temperature) "" 274 | (let ((color (funcall sky-color-clock--temperature-color-gradient temperature))) 275 | (propertize " " 'face `(:background ,color))))) 276 | 277 | ;; ---- emoji moonphase 278 | 279 | (defconst sky-color-clock--newmoon 6.8576 280 | "A new moon (1970/01/08 05:35) in days since the epoch.") 281 | 282 | (defconst sky-color-clock--moonphase-cycle 29.5306 283 | "Eclipse (synodic month) cycle in days.") 284 | 285 | (defun sky-color-clock--emoji-moonphase (time) 286 | (let* ((time-in-days (/ (float-time time) 60 60 24)) 287 | (phase (mod (- time-in-days sky-color-clock--newmoon) sky-color-clock--moonphase-cycle))) 288 | (cond ((<= phase 1.84) "🌑") 289 | ((<= phase 5.53) "🌒") 290 | ((<= phase 9.22) "🌓") 291 | ((<= phase 12.91) "🌔") 292 | ((<= phase 16.61) "🌕") 293 | ((<= phase 20.30) "🌖") 294 | ((<= phase 23.99) "🌗") 295 | ((<= phase 27.68) "🌘") 296 | (t "🌑")))) 297 | 298 | (defun sky-color-clock--emoji-daytime (time &optional cloudiness) 299 | (cl-destructuring-bind (sec min hour . xs) (decode-time time) 300 | (let ((time-in-hours (+ (/ (+ (/ sec 60.0) min) 60.0) hour))) 301 | (cond ((< sky-color-clock--sunset time-in-hours) nil) 302 | ((< time-in-hours sky-color-clock--sunrise) nil) 303 | ((and cloudiness (>= cloudiness 50)) "☁️") 304 | ((< time-in-hours (+ sky-color-clock--sunrise 0.5)) "🌅") 305 | ((< time-in-hours (- sky-color-clock--sunset 0.5)) "☀️") 306 | (t "🌇"))))) 307 | 308 | (defun sky-color-clock--emoji-icon (time &optional cloudiness weather) 309 | (cond ((and weather (< weather 600)) "💧") 310 | ((and weather (< weather 700)) "❄️") 311 | (t (or (and sky-color-clock-enable-daytime-emoji 312 | (sky-color-clock--emoji-daytime time cloudiness)) 313 | (sky-color-clock--emoji-moonphase time))))) 314 | 315 | ;; ---- the clock 316 | 317 | (defun sky-color-clock (&optional time cloudiness temperature weather) 318 | "Generate a fontified time string according to 319 | `sky-color-clock-format' and 320 | `sky-color-clock-enable-emoji-icon'." 321 | (let* ((time (or time (current-time))) 322 | (cloudiness (or cloudiness (sky-color-clock--cloudiness))) 323 | (temperature (or temperature (sky-color-clock--temperature))) 324 | (weather (or weather (sky-color-clock--weather))) 325 | (bg (sky-color-clock--pick-bg-color time cloudiness)) 326 | (fg (sky-color-clock--pick-fg-color bg)) 327 | (str (concat " " (format-time-string sky-color-clock-format time) " "))) 328 | (when sky-color-clock-enable-emoji-icon 329 | (setq str (concat " " (sky-color-clock--emoji-icon time cloudiness weather) str))) 330 | (setq str (propertize str 'face `(:background ,bg :foreground ,fg))) 331 | (when sky-color-clock-enable-temperature-indicator 332 | (setq str (concat str (sky-color-clock--temperature-indicator temperature)))) 333 | str)) 334 | 335 | (provide 'sky-color-clock) 336 | 337 | ;;; sky-color-clock.el ends here 338 | --------------------------------------------------------------------------------