🌈️ apply a wallpaper based on the weather outside
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: use chalk for log colours

Angel Wang (Jun 21, 2026, 3:27 PM -0600) c4a10bcf 648c762e

+24 -7
+3 -3
analyze/index.ts
··· 1 1 #!/usr/bin/env zx 2 2 3 - import { cacheDir, configDir, loadConfig } from "../utils.ts" 3 + import { cacheDir, chalkDebug, configDir, loadConfig } from "../utils.ts" 4 4 import { AnalysisConfig, analyzeImages, defaultConfig, ImageAnalysisData, runPreAnalysis } from "./analysis.ts" 5 5 import "zx/globals" 6 6 7 7 const pathToConfig = `${configDir}/analyze-config.json` 8 8 9 - console.debug(`Trying to load config from ${pathToConfig}...`) 9 + console.debug(chalkDebug(`Trying to load config from ${pathToConfig}...`)) 10 10 11 11 const config = await loadConfig(pathToConfig, defaultConfig) as AnalysisConfig 12 12 ··· 14 14 throw new Error("Couldn't initialize config!") 15 15 } 16 16 17 - console.debug(`Config: \n${JSON.stringify(config, null, 4)}`) 17 + console.debug(chalkDebug(`Config: \n${JSON.stringify(config, null, 4)}`)) 18 18 19 19 await fs.cp(`${cacheDir}/analysis.json`, `${cacheDir}/analysis.json.prev`, { force: true }, (err: Error) => { 20 20 if (err) {
+4 -4
apply/index.ts
··· 1 1 #!/usr/bin/env zx 2 2 3 3 import { ImageAnalysisData } from "../analyze/analysis.ts" 4 - import { cacheDir, configDir, loadConfig, map, mapEaseOutQuint } from "../utils.ts" 4 + import { cacheDir, chalkDebug, configDir, loadConfig, map, mapEaseOutQuint } from "../utils.ts" 5 5 import { ApplicationConfig, defaultConfig, findMatchingImages, getOpenMeteoData } from "./application.ts" 6 6 import * as SunCalc from "suncalc" 7 7 import "zx/globals" ··· 9 9 const pathToConfig = `${configDir}/apply-config.json` 10 10 const pathToCache = `${cacheDir}/analysis.json` 11 11 12 - console.debug(`Trying to load application config from ${pathToConfig}...`) 12 + console.debug(chalkDebug(`Trying to load application config from ${pathToConfig}...`)) 13 13 const config = await loadConfig( 14 14 pathToConfig, 15 15 defaultConfig, ··· 67 67 68 68 console.info(`Calculated target colour oklch(${lightnessValue} ${chromaValue} ${hueValue})!`) 69 69 70 - console.debug(`Trying to open cache file ${pathToCache}...`) 70 + console.debug(chalkDebug(`Trying to open cache file ${pathToCache}...`)) 71 71 const cacheFile = await fs.promises.readFile(`${pathToCache}`, { 72 72 encoding: "utf8", 73 73 }) 74 74 const imagesData = JSON.parse(cacheFile) as ImageAnalysisData 75 - console.debug(`Opened cache file ${pathToCache}!`) 75 + console.debug(chalkDebug(`Opened cache file ${pathToCache}!`)) 76 76 77 77 const targetFile = findMatchingImages(imagesData, hueValue, chromaValue, lightnessValue) 78 78
+3
deno.lock
··· 3 3 "specifiers": { 4 4 "jsr:@std/assert@1": "1.0.19", 5 5 "jsr:@std/internal@^1.0.12": "1.0.14", 6 + "jsr:@std/internal@^1.0.14": "1.0.14", 7 + "jsr:@std/path@^1.1.5": "1.1.5", 6 8 "npm:suncalc@2": "2.0.0", 7 9 "npm:zx@^8.8.5": "8.8.5" 8 10 }, ··· 39 41 ], 40 42 "packageJson": { 41 43 "dependencies": [ 44 + "npm:chalk@^5.6.2", 42 45 "npm:suncalc@2", 43 46 "npm:zx@^8.8.5" 44 47 ]
+13
package-lock.json
··· 5 5 "packages": { 6 6 "": { 7 7 "dependencies": { 8 + "chalk": "^5.6.2", 8 9 "suncalc": "^2.0.0", 9 10 "zx": "^8.8.5" 11 + } 12 + }, 13 + "node_modules/chalk": { 14 + "version": "5.6.2", 15 + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", 16 + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", 17 + "license": "MIT", 18 + "engines": { 19 + "node": "^12.17.0 || ^14.13 || >=16.0.0" 20 + }, 21 + "funding": { 22 + "url": "https://github.com/chalk/chalk?sponsor=1" 10 23 } 11 24 }, 12 25 "node_modules/suncalc": {
+1
package.json
··· 1 1 { 2 2 "dependencies": { 3 + "chalk": "^5.6.2", 3 4 "suncalc": "^2.0.0", 4 5 "zx": "^8.8.5" 5 6 }
test.ts

This is a binary file and will not be displayed.