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

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.conf.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]
# Path to save the extracted frame preview
save_frame_to = "./wallpaper_preview.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.conf.template

$active_border_1 = {{on_secondary.strip}}  ->  313032
$active_border_2 = {{outline.strip}}       ->  929095
$inactive_border = {{surface.strip}}       ->  141314
$shadow = {{outline.strip}}                ->  929095

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-1 --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.1.tar.gz (23.6 kB 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.1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for paletted-1.0.1.tar.gz
Algorithm Hash digest
SHA256 a429dc9d3620997dab61be46a012eb5b04a7e9c994324d58337a553b3894c296
MD5 45e2a399cf07d522b46f59aee6ab7743
BLAKE2b-256 52d34bd2f7bc69c77fe1807165f3e28b3ee90883cf0534bd1c2bca73d07f1026

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: paletted-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 13.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1396800cbf3000d5f9df954858b8ceb67f19fde4287f3a786559de3d99463529
MD5 02afcd7405ffad172cb93f6145b04ef8
BLAKE2b-256 56c2be4dc770c36f18c9cd6b3179469519cf3700386563131c3fcee3424bde36

See more details on using hashes here.

Provenance

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