GithubHelp home page GithubHelp logo

eylles / pywal16 Goto Github PK

View Code? Open in Web Editor NEW
172.0 4.0 24.0 885 KB

16 colors fork of pywal

License: MIT License

Python 87.40% CSS 3.36% JavaScript 0.50% Shell 2.68% C 2.43% Haskell 2.00% SCSS 0.52% Stylus 0.50% Vim Script 0.60%
colorscheme wal changing-colorschemes pywal terminal-emulators pywal16

pywal16's Introduction

This project is a 16 colors fork of pywal

Generate and change color-schemes on the fly.

img

Pywal is a tool that generates a color palette from the dominant colors in an image. It then applies the colors system-wide and on-the-fly in all of your favourite programs.

There are currently 5 supported color generation backends, each providing a different palette of colors from each image. You're bound to find an appealing color-scheme.

Pywal also supports predefined themes and has over 250 themes built-in. You can also create your own theme files to share with others.

The goal of Pywal was to be as out of the way as possible. It doesn't modify any of your existing configuration files. Instead it works around them and provides tools to integrate your system as you see fit.

Terminal emulators and TTYs have their color-schemes updated in real-time with no delay. With minimal configuration this functionality can be extended to almost anything running on your system.

Packaging status

support me at:
Donate using Liberapay

pywal16's People

Contributors

aeikenberry avatar ambertia avatar amitpr avatar aschey avatar baseplate-admin avatar chrishoage avatar clach04 avatar danielx avatar deviantfero avatar dgrisham avatar djent- avatar dylanaraps avatar eylles avatar furrycatherder avatar gremious avatar linuxunil avatar loiccoyle avatar madstone0-0 avatar opatut avatar ranisalt avatar robwaz avatar scottawalton avatar sholland1 avatar sk8ersteve avatar sraysmith avatar stefanfrick avatar tensaiz avatar thewisker avatar threadreaper avatar timgates42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pywal16's Issues

Main / accent color

Is there any way to obtain the "main" color of the wallpaper (the color that stands out the most)?
I’m currently using color9 but the color that represents the wallpaper the most isn’t always at the same position.

property export

while working on #6 i found some problems with the export submodule as adding new properties isn't as straightforward as it seems.

the attempted properties under util.py

    @property
    def red_dec(self):
        """Red value as decimal."""
        return "%s" % hex_to_rgb(self.hex_color)[0]

    @property
    def green_dec(self):
        """Green value as decimal."""
        return "%s" % hex_to_rgb(self.hex_color)[1]

    @property
    def blue_dec(self):
        """Blue value as decimal."""
        return "%s" % hex_to_rgb(self.hex_color)[2]

trying to use these on a template results in a pywal error:

 File "/home/ed/.local/lib/python3.10/site-packages/pywal/export.py", line 27, in template
    new_color = util.Color(colors[cname].hex_color)
AttributeError: 'str' object has no attribute 'hex_color'

this clearly shows that there is a problem in the template exporting code as it is necesary to to specify lenght of the format string "%3s" to make the colors export, the lenght of the string should not matter at all and the end result padding with spaces may not be desirable.

there clearly was a problem with that part of the code as evidenced by a2ddff3 , in order to continue the development of this fork the important functions such as the template function of the export submodule should be clear on what they do, for that reason i'm asking @AmitPr and @loiccoyle if they can chime in to help with the debugging the problem so that we can iron out these kinks.

After updating it via AUR

󰘧 walset
[I] image: Using image wallhaven-x67oxo.png.
[I] colors: Generating a colorscheme.
[I] colors: Using wal backend.
Traceback (most recent call last):
  File "/usr/bin/wal", line 33, in <module>
    sys.exit(load_entry_point('pywal16==3.5.3', 'console_scripts', 'wal')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pywal/__main__.py", line 244, in main
    parse_args(parser)
  File "/usr/lib/python3.12/site-packages/pywal/__main__.py", line 184, in parse_args
    colors_plain = colors.get(image_file, args.l, args.cols16, args.backend,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pywal/colors.py", line 213, in get
    colors = getattr(backend, "get")(img, light, cols16)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pywal/backends/wal.py", line 77, in get
    colors = gen_colors(img)
             ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pywal/backends/wal.py", line 64, in gen_colors
    return [re.search("#.{6}", str(col)).group(0) for col in raw_colors[1:]]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

16 colors output only with --cols16 option

By default it seems that wal only extracts 8 colors from a wallpaper, with wal -i /path/to/image. Only when I use wal --cols16 -i /path/to/image, I get nice 16 colors. Is this expected behavior? If so, can it be mentioned in the "Getting started" page? Thank you!

Directories inside templates folder

Hi,

Is it possible to create subdirectories within the templates folder, each containing templates that can then be exported to the .cache/wal folder?

I attempted to create a template within a subfolder, but it seems that Pywal skipped the entire directory.

Removing fcntl calls to get pywal16 to work on windows

pywal originally worked on Windows to generate color schemes.
It had to be run with wal -n, which skipped setting the wallpaper, but the colorscheme generation worked fine, and you were able to theme bash, vscode, your browser, etc.
pywal16 however does not seem to work because of the fcntl calls present in one function here.
fcntl is not available on Windows, so could it be replaced with something more portable or removed altogether?
Thanks.

Handling ttys not accepting sequences e.g when suspended by Flow Control

Currently whenever a terminal is in suspended mode (and maybe for some other reasons) and pywal tries to send the color sequences to it the save_file here:

util.save_file(sequences, dev)

it will get stuck trying to write indefinitelly, blocking the writing to the remaining ttys and program itself

I tried this PR Add --active-only flag to only run pywal on active ttys from dylanaraps repo. But unfortunately it didn't work for Kitty, which doesn't show up in who output for some reason and also doesn't handle the aforementioned suspend mode.

So I am wondering if there is a way to reliably detect whether a tty cannot receive input so it is skipped. Konsole links to this wiki page about Software Flow Control, could it be that there is a way to detect in which state a tty is? Or will it be okay putting a timeout to the write operation to abort when it gets stuck?

Color contrast specification / cmd line option

I'd be interested in the ability to control the contrast of colors in the palette relative to the source image using a command-line argument. I find that many of the colors can, at times, be difficult to read e.g. in partially transparent terminals through no fault of the application; I've done some work making a python script to evaluate the average pixel value of the source image and modify the colors in the palette to have >= a specific contrast ratio according to the formulae outlined in the W3 contrast specifications. I'd like to work on implementing the actual math I've written into pywal itself in a fork, and if you'd like I'd be glad to have it pulled in when I'm finished.

[Unsure]: Color generation for gif.

i tried wal with a gif and magick took full cpu for around 1 min.
I want to ask does it try to extract color from every frame?
if it is the case then it will be nice to have a flag that specifies which frame to use to generate the color if it is a gif.

Problem with colors[0]

Hello
In this image as you can see no matter how light your background looks like, this fork makes the colors[0] 'black'!
Is this intended? because the original one does a really good job at this. (a dark shade for colors[0])
The one in right is original pywal.

pic-full-240429-1901-28

KeyError: 'DESKTOP_SESSION'

I get this error when i test a wallpaper and wal cant generate the files with colors

(pywal16) [user@tux ~/pywal16]$ wal -n -i ~/Wallpapers/wallhaven-5gp7j8_1920x1080.png 
[I] image: Using image wallhaven-5gp7j8_1920x1080.png.
[I] theme: Set theme to _home_hellboy_Wallpapers_wallhaven-5gp7j8_1920x1080_png_9_dark_None_None_2774760_1.1.0.json.
[I] colors: Found cached colorscheme.
Traceback (most recent call last):
  File "/home/user/pywal16/bin/wal", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/user/pywal16/lib/python3.12/site-packages/pywal/__main__.py", line 244, in main
    parse_args(parser)
  File "/home/user/pywal16/lib/python3.12/site-packages/pywal/__main__.py", line 216, in parse_args
    sequences.send(colors_plain, to_send=not args.s, vte_fix=args.vte)
  File "/home/user/pywal16/lib/python3.12/site-packages/pywal/sequences.py", line 93, in send
    if os.environ["DESKTOP_SESSION"] == "plasma":
       ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "<frozen os>", line 685, in __getitem__
KeyError: 'DESKTOP_SESSION'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.