Skip to main content

No project description provided

Project description

🎨 Paletted

A lightweight CLI utility for dynamic theme generation. It derives color palettes from live wallpapers or images and applies them across the system through configurable templates and appliers

Preview

Preview

How It Works

  1. Extract a frame from the wallpaper (or use the image directly)
  2. Generate a Material Design color palette with Matugen
  3. Apply colors to templates and appliers
  4. Execute configured commands and wallpaper backend

Installation

Dependencies:

  • python >= 3.11
  • magentum
  • ffmpeg
  • pipx
pipx install paletted

Configuration

paletted/
├── appliers/
│   └── hyprland.py               # Custom theme applier
├── templates/
│   └── hyprland.lua.template     # Example configuration template
├── config.toml                   # Main configuration file
└── another_config.toml           # Included configuration module

Main Configuration

The main configuration file contains global settings, notification options, wallpaper backends, and imported modules

# config.toml

# Include external modular configurations
[[include]]
target = "./another_config.toml"

[settings]
# Fallback static image path (extracted frame or symlink) for tools like hyprlock
source_image = "./wallpaper.png"

[notification]
enable = true
summary = "Paletted-Themes"
text = "Theme applied. Wallpaper updated"

# Executed when the wallpaper source is a video
[[backend]]
type = "video"
exec = "smooth-slapper %wallpaper_path%"

# Executed when the wallpaper source is a static image
[[backend]]
type = "image"
exec = "smooth-slapper %wallpaper_path%"

# Target package application mapping
[[package]]
name = "hyprland"
template = "hyprland.conf.template"
target = "~/.config/hypr/theme.conf"
exec = [["hyprctl", "reload"], ["echo", "Goida"]]

# Theme applier name without .py extension
[[appliers]]
applier = "hyprland"

Theme template

Colors can be referenced using placeholders and modifiers:

  • {{color.modifier(factory)}}

where color is the base color, modifier is the transformation to apply, and factory is the modifier parameter

Modifiers:

.alpha(factor) -> Sets opacity (0.0 to 1.0)       | Example: {primary.alpha(0.5)}
.dark(factor)  -> Darkens the color (factor > 1)  | Example: {primary.dark(1.2)}
.light(factor) -> Lightens the color (factor > 1) | Example: {secondary.light(1.5)}
.sat(factor)   -> Modulates saturation (0.0 - 5)  | Example: {tertiary.sat(0.5)}
.rgb           -> Formats to CSS rgb/rgba string  | Example: {surface.rgb}
.strip         -> Removes the '#' prefix symbol   | Example: {error.strip}

Palette Colors:

# Primary
accent              = "{primary}"
on_accent           = "{on_primary}"
container           = "{primary_container}"
on_container        = "{on_primary_container}"

# Secondary
accent              = "{secondary}"
on_accent           = "{on_secondary}"
container           = "{secondary_container}"
on_container        = "{on_secondary_container}"

# Tertiary
accent              = "{tertiary}"
on_accent           = "{on_tertiary}"
container           = "{tertiary_container}"
on_container        = "{on_tertiary_container}"

# Surface
background          = "{background}"
on_background       = "{on_background}"
surface             = "{surface}"
on_surface          = "{on_surface}"
variant             = "{surface_variant}"
on_variant          = "{on_surface_variant}"

# Borders
outline             = "{outline}"
outline_variant     = "{outline_variant}"

# Error
accent              = "{error}"
on_accent           = "{on_error}"
container           = "{error_container}"
on_container        = "{on_error_container}"

# Inverse
surface             = "{inverse_surface}"
on_surface          = "{inverse_on_surface}"
primary             = "{inverse_primary}"

Example:

-- hyprland.lua.template

local Colors = {
  active_1 = "{{on_secondary}}",       -- = "#362d3e"
  active_2 = "{{outline}}",            -- = "#968e98"
  inactive = "{{surface}}",            -- = "#151316"
  shadow   = "{{outline.alpha(0.3)}}", -- = "#968e984c"
}

return Colors

Custom appliers

Appliers provide a programmatic way to generate output when template-based substitution is not flexible enough

Each Applier must define a function whose name matches the file name:

# hyprland.py

def hyprland(color_parser) -> None:
  print(color_parser("primary.rgb"))

The provided color_parser callable can be used to resolve any supported color placeholder

Usage

Generate and apply a theme:

palleted apply /path/to/wallpaper/  # --source-index 0..3 (usually) --config-dir /path/to/paletted_configs/

Restore the previous wallpaper:

palleted restore  # --config-dir /path/to/paletted_configs/

Why Paletted?

Unlike static themes, Paletted automatically generates a cohesive color scheme based on your wallpaper and applies it to your entire desktop environment and applications, in accordance with templates and appliers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paletted-1.0.3.tar.gz (10.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paletted-1.0.3-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file paletted-1.0.3.tar.gz.

File metadata

  • Download URL: paletted-1.0.3.tar.gz
  • Upload date:
  • Size: 10.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for paletted-1.0.3.tar.gz
Algorithm Hash digest
SHA256 e7c49d05e0279444ed444ebdab1ae5df6174cb8e503d4cf9d376978742615905
MD5 c94ec0c03f08fec23ed9d503467e607a
BLAKE2b-256 141372f53b4580031ef07401c8614a3439ca3519a5b9bd956109a5858f25e5cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for paletted-1.0.3.tar.gz:

Publisher: python-publish.yml on PixelLoop-uwu/Paletted

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file paletted-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: paletted-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for paletted-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7e1f905a9656ced0ccef242a449c411fd535343db39caa2c22f0a294ff929347
MD5 dd14ff7ce5caf993b9b8c4e1e6b5cc81
BLAKE2b-256 9a2763bda0f478f3e5df28ed1261d73f6c3e3ad583dd1f38d569665389fa4ff4

See more details on using hashes here.

Provenance

The following attestation bundles were made for paletted-1.0.3-py3-none-any.whl:

Publisher: python-publish.yml on PixelLoop-uwu/Paletted

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page