Skip to main content

A Minimalist wallpaper generator

Project description

ColorWallpaper

Lint Status Tests Status Codecov Code style PyPI version

A Minimalist wallpaper generator

Generates wallpapers such as: Example

Requirements

Installation

Run: pip install color_wallpaper

Usage

Direct generation: python -m color_wallpaper --option[s]

Options:

  • -h/--help
    • Display help and exit

File options

  • -o/--output PATH
    • Used to specify image output path.
    • Default: out.png
  • -y/--yes
    • Forces overwrite of --output

Color options

  • -c/--color COLOR
    • Used to specify Background color. Also accepts random which picks random named color.
    • Default: random
  • -c2/--color2 COLOR
    • Used to specify text color. Also accepts inverted which is the inverse of --color.
    • Default: inverted
  • -d/--display NAME
    • Overrides the display name of the --color. Empty string disables the name row.
  • --min-contrast CONTRAST
    • Min contrast of --color and --color2, if --color2 is inverted. Will raise if this can not be satisfied.
    • Default: 1
  • --overlay-color COLOR
    • Used to specify color of potential overlay, like icons or text.
  • --overlay-contrast CONTRAST
    • Min contrast of --color and --overlay-color. Will raise if this can not be satisfied.
    • Default: 1

Display options

  • -r/--resolution RESOLUTION
    • Used to specify image resolution.
    • Default: 1920x1080.
  • -s/--scale SCALE
    • The size of the highlight (128px) will be multiplied by this.
    • Default: 3
  • -f/--formats [FORMAT ...]
    • Declares the order and formats to display
    • Default: empty HEX rgb

Multiple wallpapers generation options:

  • --multiple-count MULTIPLE_COUNT
    • Generate all colors, that pass other options filtering. negative numbers will produce all colors
    • Default: 1
  • --multiple-extension MULTIPLE_EXTENSION
    • The extension/format of the wallpapers
    • Default: png

Argument formats

  • COLOR
    • #Hex: Three or six hexadecimal digits optionally starting with #.
    • R,G,B: Three comma separated numbers in range 0-255.
    • Valid name of a color.
  • CONTRAST
    • A float in range 1-21.
  • RESOLUTION
    • Two integers greater or equal to 150, separated by x or :.
  • FORMAT
    • Self explanatory: hex, rgb, hsv, hsl, cmyk
    • empty: Empty row.
    • #hex: hex, but starting with #
    • #HEX, HEX: Like hex, but uppercase

Examples

The above image

python -m color_wallpaper --color black --output https://raw.githubusercontent.com/BranislavBajuzik/ColorWallpaper/master/example.png --formats empty HEX rgb --resolution 960x540 --scale 2

Dynamic Android wallpaper

Changes the wallpaper to a new color every time the screen is turned on. Tested on OnePlus 6T.

Install Tasker, Termux, and Termux:Tasker

In Termux run:

# Give Termux access to internal storage
termux-setup-storage

# Get Python
pkg upgrade
pkg install python python-dev libjpeg-turbo git

# Get Python libraries
pip install --upgrade pip
pip install --upgrade setuptools
LIBRARY_PATH="/system/lib" CPATH="$PREFIX/include" pip install pillow

# Pull the project
git clone https://github.com/BranislavBajuzik/ColorWallpaper.git

# Setup triggers for Termux:Tasker
mkdir -p ~/.termux/tasker/
echo $'cd ~/ColorWallpaper\npython -m color_wallpaper -y -o /sdcard/Pictures/Excluded/paper.png -c random --min-contrast 2.5 --overlay-color white --overlay-contrast 1.5 -r 1080x2340 -s 4 -f empty \#HEX rgb hsv cmyk' > ~/.termux/tasker/generate-wallpaper.sh
chmod u+x ~/.termux/tasker/generate-wallpaper.sh

# Setup the output folder
mkdir -p /sdcard/Pictures/Excluded
touch /sdcard/Pictures/Excluded/.nomedia

In Tasker:

  • Create a new Task
    • Add Termux Action with Configuration set to generate-wallpaper.sh
    • Add Set Wallpaper Action with Image set to Pictures/Excluded/paper.png
  • Create a new Event Profile for Display Off event, give it Highest priority, and set it's Task to the one you just created.
  • Edit ~/.termux/tasker/generate-wallpaper.sh to change arguments (e.g. your screen resolution) of the program.
  • Run cd ~/ColorWallpaper && git pull to update the program.

Contribute

Setup environment

python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
pre-commit install

Run tests

pytest

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

color-wallpaper-1.1.9.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

color_wallpaper-1.1.9-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file color-wallpaper-1.1.9.tar.gz.

File metadata

  • Download URL: color-wallpaper-1.1.9.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.0

File hashes

Hashes for color-wallpaper-1.1.9.tar.gz
Algorithm Hash digest
SHA256 873e5ee7100e2f0ba80a93272f2ea477dbd89c87a7409bd58cee4eb2b2060e6b
MD5 1e2a934ea0dfd183f1320051275808d8
BLAKE2b-256 6184ec3e57c8932d1436e5e48289c20bbfb49bca30c27c9f1324d5481a9a693a

See more details on using hashes here.

File details

Details for the file color_wallpaper-1.1.9-py3-none-any.whl.

File metadata

  • Download URL: color_wallpaper-1.1.9-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.0

File hashes

Hashes for color_wallpaper-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f2f2dd24b160506e9a63663bcce5ebfcef85ce6214c43c7e3bd84dddc1176017
MD5 c3ccf8387a6fa2ac4e6ef4920db15f8a
BLAKE2b-256 d9f603e3d703bb2d89cb7b13769fb114fff3ffc5fb0b399deb80989066f49724

See more details on using hashes here.

Supported by

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