๐ŸŒˆ๏ธ apply a wallpaper based on the weather outside
0

Configure Feed

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

feat: add readme and screenshots

Angel Wang (Jun 21, 2026, 4:41 PM -0600) b8de15c1 8ba07439

+66 -3
+63
README.md
··· 1 + # rainwall 2 + ![screenshot](./.github/assets/screenshot.png) 3 + 4 + **rainwall is a program to set your wallpaper based on the weather outside.** 5 + 6 + ## dependencies 7 + - [ImageMagick](https://imagemagick.org) 8 + 9 + ## usage 10 + 1. Give both `rainwall-analyze` and `rainwall-apply` an initial run to generate the config files, then edit the config files as needed. See below for configuration options. 11 + - Linux: `$XDG_CONFIG_HOME/rainwall` or `~/.config/rainwall` 12 + - Darwin (macOS/OSX): `~/Library/Preferences/rainwall` 13 + - Windows: `%LocalAppData%/rainwall` 14 + 2. Run `rainwall-analyze` to generate the index of image colours. This will take a while, be patient! 15 + 3. Run `rainwall-apply` to set your wallpaper! Enjoy! 16 + 17 + ## configuring 18 + ### `analyze-config.json` 19 + | option | typeof | default | description | 20 + |-----------------------|------------|---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 21 + | `imageDir` | `string` | `/home/<yourusername>/Pictures` | The directory where your image files are stored. | 22 + | `preAnalysisCommands` | `string[]` | `[]` | An array of commands to perform before analysis begins. Examples include applying CLUTs, adjusting HSV, etc. All commands will be properly escaped. **Warning: commands are run directly with `eval`! Don't put anything potentially unsafe...** or do, we don't care. | 23 + 24 + ### `apply-config.json` 25 + | option | typeof | default | description | 26 + |-------------------------|----------------------------------|------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------| 27 + | `latitude` | `number` | `0` | The latitude used to discover the weather outside. | 28 + | `longitude` | `number` | `0` | The longitude used to discover the weather outside. | 29 + | `weatherModel` | `string` | `"best_match"` | The weather model to calculate cloud cover and shortwave radiation with. Find the options on the [Open-Meteo](https://open-meteo.com/en/docs) site. | 30 + | `lightnessRange` | `{ start: number; end: number }` | `{ start: 0; end: 1 }` | The range of lightness values to map shortwave radiation to. Use this if your images are all exceptionally light or dark, due to post-processing or other reasons. | 31 + | `chromaRange` | `{ start: number; end: number }` | `{ start: 0; end: 1 }` | The range of chroma values to map cloud cover to. Use this if your images are all exceptionally saturated or desaturated, due to post-processing or other reasons. | 32 + | `applyWallpaperCommand` | `string` | `hyprctl hyprpaper wallpaper , %s` | The command used to apply the wallpaper. See "applying the wallpaper" section below for more info. | 33 + 34 + ## applying the wallpaper 35 + Put `%s` where the image path would normally go. 36 + ### Linux 37 + - GNOME (untested): 38 + - Light theme: `gsettings set org.gnome.desktop.background picture-uri file://%s` 39 + - Dark theme: `gsettings set org.gnome.desktop.background picture-uri-dark file://%s` 40 + - KDE Plasma (untested): 41 + - `plasma-apply-wallpaperimage %s` 42 + - awww (untested) 43 + - `awww img %s` 44 + - swaybg (untested) 45 + - `swaybg -i %s` 46 + - hyprpaper 47 + - `hyprctl hyprpaper wallpaper , %s` 48 + 49 + ### Darwin (macOS/OSX) 50 + <sub>(untested, [source](https://discussions.apple.com/thread/254859103))</sub> 51 + 52 + Launch Automator. Click New Document โ†’ Choose. From the "Files & Folders" library, drag and drop the "Set the Desktop Picture" action to the right onto the larger workflow window. Save it somewhere accessible. Then, put this into the config file: 53 + `automator -i "%s" /path/to/your.workflow` 54 + 55 + ### Windows 56 + ...who knows? 57 + 58 + ## compatibility 59 + - Linux โœ… 60 + - Darwin (macOS/OSX) โ“ 61 + - Windows โŒ 62 + - [ ] How does one set the wallpaper via CLI? 63 + - [ ] `apply/index.ts @ L80, analyze/analysis.ts @ L20`: equivalent of POSIX eval?
+2 -2
deno.json
··· 1 1 { 2 2 "tasks": { 3 - "compile-analyze": "deno compile --output build/analyze -A analyze/index.ts", 4 - "compile-apply": "deno compile --output build/apply -A apply/index.ts", 3 + "compile-analyze": "deno compile --output build/rainwall-analyze -A analyze/index.ts", 4 + "compile-apply": "deno compile --output build/rainwall-apply -A apply/index.ts", 5 5 "analyze": "deno run -A analyze/index.ts", 6 6 "apply": "deno run -A apply/index.ts" 7 7 },
+1 -1
analyze/analysis.ts
··· 22 22 } 23 23 24 24 export async function analyzeImages(imageDir: string, analysisOutput: ImageAnalysisData, outputPath: string) { 25 - const images = await fs.promises.opendir(`${imageDir}`) 25 + const images = await fs.promises.opendir(imageDir) 26 26 27 27 for await (const image of images) { 28 28 const path = `${imageDir}/${image.name}`
.github/assets/screenshot.png

This is a binary file and will not be displayed.