Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Wallbash is a **single binary** that can run in two modes:
- **Daemon Mode:** Run `wallbash start` to explicitly launch the daemon, or let it be started automatically on first use. The daemon:
- Manages the Wayland surface and Vulkan rendering pipeline.
- Listens for commands via a Unix socket (`/tmp/wallbash.sock`).
- Handles wallpaper transitions, animations, and multi‑monitor setups.
- Persists in the background until stopped with `wallbash stop`.

The core **modules** are structured as:
Expand All @@ -69,13 +68,13 @@ The core **modules** are structured as:
- **wayland.rs** Handles the Wayland connection. Creates and manages the surface, sets up the output, and handles window events. This is the interface between wallbash and your Wayland compositor.
- **vulkan.rs** Handles the GPU initialization, texture creation, shader compilation, and draws the wallpaper surface using Vulkan. This provides the image rendering pipeline.
- **filters.rs** Applies Vulkan compute shaders which currently implements a blur effect for the background. The module is designed to be extensible for additional filters in future.
- **colors.rs** Extracts the dominant color from the wallpaper using k-means clustering, converts colors and generates a full Material Design color palette. Its then deployed to your config files using built-in template system.
- **colors.rs** Extracts the dominant color from the wallpaper using k-means clustering, converts colors and generates a color palette. It's then deployed to your config files based on templates.


## Theming

Wallbash generates a color palette from your wallpaper. You can use these colors to dynamically theme your entire desktop environment.
For detailed guides, usage, and application specific examples, check out the [wiki](https://github.com/prasanthrangan/wallbash/wiki) *(work in progress)*.
For detailed guides, usage, and application specific examples, check out the [wiki](https://github.com/prasanthrangan/wallbash/wiki/Theming).

###### *<div align="right"><sub>// HyDE</sub></div>*
<p align="center"><img src="https://github.com/prasanthrangan/hyprdots/blob/3c8b0dfb5e7f8e41a67b80463513f10d57cab1a4/Source/assets/Arch.svg" width="100"></p>
12 changes: 8 additions & 4 deletions src/colors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,15 @@ fn parse_alpha(s: &str) -> Option<ColorFormat> {
if s.is_empty() { return None }
if s.contains('.') {
let val = s.parse::<f64>().ok()?;
Some(ColorFormat::Rgba(val.clamp(0.0, 1.0)))
} else {
let val = u8::from_str_radix(s, 16).ok()?;
Some(ColorFormat::Hex(val))
return Some(ColorFormat::Rgba(val.clamp(0.0, 1.0)));
}
if let Ok(pct) = s.parse::<u8>() {
if (1..=100).contains(&pct) {
let val = ((pct as f64 / 100.0) * 255.0).round() as u8;
return Some(ColorFormat::Hex(val));
}
}
None
}

fn scan_templates(root: &std::path::Path) -> Vec<std::path::PathBuf> {
Expand Down
Loading