deviantfero / wpgtk

:flower_playing_cards: a colorscheme, wallpaper and template manager for *nix
http://deviantfero.github.io/wpgtk/
GNU General Public License v2.0
2.05k stars 49 forks source link

Not able to set colorscheme #256

Closed Spoonyyy closed 2 years ago

Spoonyyy commented 2 years ago

I should (at least to my interpretation of the --help) be be able to set my colorscheme with the wpg -s command

wpg --help

...
-s S [S ...]         set the wallpaper and/or colorscheme
...

But when I want to set my colorscheme with the command

wpg -s ~/.config/wpg/schemes/colorscheme.json

It throws me the following errors:

[i] image         Using image standardcolorscheme.json.
[i] colors        Generating a colorscheme.
[i] colors        Using wal backend.
convert: no decode delegate for this image format `JSON' @ error/constitute.c/ReadImage/740.
convert: no images defined `txt:-' @ error/convert.c/ConvertImageCommand/3325.
Traceback (most recent call last):
  File "/sbin/wpg", line 33, in <module>
    sys.exit(load_entry_point('wpgtk==6.5.5', 'console_scripts', 'wpg')())
  File "/usr/lib/python3.10/site-packages/wpgtk/__main__.py", line 305, in main
    process_args(args)
  File "/usr/lib/python3.10/site-packages/wpgtk/__main__.py", line 189, in process_args
    themer.set_theme(args.s[0], args.s[0], args.r)
  File "/usr/lib/python3.10/site-packages/wpgtk/data/themer.py", line 37, in set_theme
    colors = color.get_pywal_dict(target, is_file)
  File "/usr/lib/python3.10/site-packages/wpgtk/data/color.py", line 26, in get_pywal_dict
    return pywal.colors.get(
  File "/home/kimil/.local/lib/python3.10/site-packages/pywal/colors.py", line 144, in get
    colors = getattr(backend, "get")(img, light)
  File "/home/kimil/.local/lib/python3.10/site-packages/pywal/backends/wal.py", line 86, in get
    colors = gen_colors(img)
  File "/home/kimil/.local/lib/python3.10/site-packages/pywal/backends/wal.py", line 41, in gen_colors
    raw_colors = imagemagick(16 + i, img, magick_command)
  File "/home/kimil/.local/lib/python3.10/site-packages/pywal/backends/wal.py", line 19, in imagemagick
    return subprocess.check_output([*magick_command, img, *flags]).splitlines()
  File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['magick', 'convert', '/home/kimil/.config/wpg/schemes/standardcolorscheme.json[0]', '-resize', '25%', '-colors', '16', '-unique-colors', 'txt:-']' returned non-zero exit status 1.

It looks like it wants to set the JSON file as a the colorscheme, how would I change this to use the JSON file as the colorscheme? I also tried

wpg -s ~/.config/wpg/schemes/standardcolorscheme.json ~/.config/wallpapers/colorful/image.jpg

which does not throw any errors but does just sets the colorscheme with the colors calculated from the image but does not set the wallpaper (Which is what I want but I want the colorschme of the JSON file not the one from the image)

The colorscheme JSON file looks like this

{
    "wallpaper": "/home/kimil/.config/wpg/wallpapers/colorful1.jpg",
    "alpha": "100",

    "special": {
        "background": "#010101",
        "foreground": "#fff2f2",
        "cursor": "#fff2f2"
    },
    "colors": {
        "color0": "#010101",
        "color1": "#ca0101",
        "color2": "#4d9905",
        "color3": "#c29d01",
        "color4": "#719ece",
        "color5": "#74507a",
        "color6": "#059799",
        "color7": "#ddc8c8",
        "color8": "#595050",
        "color9": "#ee2828",
        "color10": "#89e133",
        "color11": "#fbe84e",
        "color12": "#31aefe",
        "color13": "#ac7ea7",
        "color14": "#33e1e1",
        "color15": "#fff2f2"
    }
}
deviantfero commented 2 years ago

Refer to the wiki: https://github.com/deviantfero/wpgtk/wiki/Colorschemes

this is a little bit different from pywal usage