eylles / pywal16

16 colors fork of pywal
MIT License
204 stars 25 forks source link

checksum is not added to the JSON export #76

Closed deviantfero closed 2 weeks ago

deviantfero commented 2 weeks ago

this breaks support for editing themes in wpgtk.

We use the json export option to edit themes in the UI and since the color.get function checks the theme against the checksum of the image in the JSON you can't really persist the changes we're doing in the UI.

original file produced by wal:

{
    "checksum": "f6c9954d034b308e52ce1b4767d81447",
    "wallpaper": "/home/fernando/.config/wpg/wallpapers/jpnumbrella.jpg",
    "alpha": "100",
    "special": {
        "background": "#0B2B06",
        "foreground": "#c2cac0",
        "cursor": "#c2cac0"
    },
    "colors": {
        "color0": "#0B2B06",
        "color1": "#A95546",
        "color2": "#C29462",
        "color3": "#0F6C95",
        "color4": "#5A7290",
        "color5": "#AD6C8E",
        "color6": "#3AAFC8",
        "color7": "#c2cac0",
        "color8": "#61735e",
        "color9": "#A95546",
        "color10": "#C29462",
        "color11": "#0F6C95",
        "color12": "#5A7290",
        "color13": "#AD6C8E",
        "color14": "#3AAFC8",
        "color15": "#c2cac0"
    }
}

file after being edited with wpgtk and using the pywal.export json template:

{
    "wallpaper": "/home/fernando/.config/wpg/wallpapers/jpnumbrella.jpg",
    "alpha": "100",

    "special": {
        "background": "#0B2B06",
        "foreground": "#fbfff8",
        "cursor": "#fbfff8"
    },
    "colors": {
        "color0": "#0B2B06",
        "color1": "#A95546",
        "color2": "#5A7290",
        "color3": "#C29462",
        "color4": "#0F6C95",
        "color5": "#AD6C8E",
        "color6": "#3AAFC8",
        "color7": "#c2cac0",
        "color8": "#15570b",
        "color9": "#eb634b",
        "color10": "#6592ca",
        "color11": "#ffc16c",
        "color12": "#0890cc",
        "color13": "#f37ab9",
        "color14": "#3aeeff",
        "color15": "#fbfff8"
    }
}
eylles commented 2 weeks ago

just to make sure if i understand, which version of pywal16 and which file? because currently the git master of pywal16 has the following behaviour:

colorscheme files like ~/.cache/wal/schemes/<scheme>.json do have the checksum
the current colorscheme json ~/.cache/wal/colors.json does not have checksum

if i understand correctly you want the file ~/.cache/wal/colors.json to have the checksum of the used colorscheme?

deviantfero commented 2 weeks ago

Yeah they should be the same, because otherwise you can't really use the export to json option reliably

On Wed, Oct 30, 2024, 9:25 PM eylles @.***> wrote:

just to make sure if i understand, which version of pywal16 and which file? because currently the git master of pywal16 has the following behaviour:

colorscheme files like ~/.cache/wal/schemes/.json do have the checksum the current colorscheme json ~/.cache/wal/colors.json does not have checksum

if i understand correctly you want the file ~/.cache/wal/colors.json to have the checksum of the used colorscheme?

— Reply to this email directly, view it on GitHub https://github.com/eylles/pywal16/issues/76#issuecomment-2448942417, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVCGSPJQ2SKAB3OXFSXZFLZ6GPLNAVCNFSM6AAAAABQ5KEFLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBYHE2DENBRG4 . You are receiving this because you authored the thread.Message ID: @.***>

eylles commented 2 weeks ago

okay gimme a moment and i will have something.

eylles commented 2 weeks ago

that should do