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 actions

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 traditional wallpaper-based theme generators, Paletted supports both static images and video wallpapers. It combines template-based configuration with custom Python appliers, making it possible to handle complex theming workflows that go beyond simple color substitution.

Designed for highly customizable Linux desktops, Paletted can generate themes, update configurations, execute commands, and integrate with existing wallpaper backends in a single workflow.

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.4.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.4-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: paletted-1.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 2d3b99690b9f1008dfa2decf4090bdad889da61ebe2d171b7cf1093db06f9d09
MD5 44b33c52b9fa5875e409804bbb5669c3
BLAKE2b-256 9e3377ff5475d6f9d4a5b0b801a8ec7a810667e56ff83bfae0009a71fd8eedfc

See more details on using hashes here.

Provenance

The following attestation bundles were made for paletted-1.0.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: paletted-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 14.0 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e483aa8761fd4bc6be1f15c472aa6ac444595dc68f25de2b95bea1a373e5378e
MD5 12c6bc16ce39f657653a8ad9bfef4949
BLAKE2b-256 16ef5b05f9ded84e3d4f56625e204905044bdeb78be54b6c3ab22c17bbe75e43

See more details on using hashes here.

Provenance

The following attestation bundles were made for paletted-1.0.4-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