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.06k stars 48 forks source link

Setting a theme doesn't seem to work #224

Open thecatwasnot opened 3 years ago

thecatwasnot commented 3 years ago

Hi, I have been loving using wpgtk for a while now but I'm now running into a weird issue where I cannot seem to get a particular wallpaper to work the way I expect. I have a wallpaper Winter-Horse-1920-1080.jpg that is almost completely grayscale, I wanted to associate the base16-gruvbox-hard theme to it. Here's what I'm doing and the results from the command line:

(07:50:29)(cole)(~)(50.34)wpg -a Winter-Horse-1920-1080.jpg
[i] image         Using image Winter-Horse-1920-1080.jpg.
[i] colors        Generating a colorscheme.
[i] colors        Using wal backend.
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 16
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 17
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 18
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 19
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 20
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 21
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 22
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 23
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 24
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 25
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 26
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 27
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 28
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 29
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 30
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 31
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 32
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 33
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 34
[e] wal           Imagemagick couldn't generate a suitable palette.
[i] theme         Set theme to sexy-navy-and-ivory.json.
[i] export        Exported json.
(07:51:00)(cole)(~)(5.96)wpg --theme
base16-github
base16-shapeshifter
base16-one
base16-atelier-seaside
base16-atelier-dune
base16-grayscale
base16-solarized
ashes
base16-cupcake
base16-atelier-estuary
base16-cupertino
base16-materialer
tempus_dawn
base16-default
tempus_past
base16-atelier-sulphurpool
github
base16-atelier-heath
base16-tomorrow
base16-atelier-forest
base16-gruvbox-hard
3024
base16-mexico
solarized
base16-gruvbox-medium
tempus_totus
base16-summerfruit
base16-gruvbox-soft
base16-unikitty
base16-google
base16-atelier-cave
base16-atelier-lakeside
base16-harmonic
sexy-mostly-bright
base16-classic
base16-atelier-plateau
tempus_fugit
base16-atelier-savanna
(07:51:48)(cole)(~)wpg -Ti Winter-Horse-1920-1080.jpg base16-gruvbox-hard
[i] theme         Set theme to base16-gruvbox-hard.json.
[i] export        Exported json.
[i] themer        applied base16-gruvbox-hard to Winter-Horse-1920-1080.jpg
(07:52:00)(cole)(~)wpg -s Winter-Horse-1920-1080.jpg
[i] image         Using image Winter-Horse-1920-1080.jpg.
[i] colors        Generating a colorscheme.
[i] colors        Using wal backend.
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 16
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 17
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 18
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 19
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 20
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 21
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 22
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 23
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 24
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 25
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 26
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 27
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 28
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 29
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 30
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 31
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 32
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 33
[w] wal           Imagemagick couldn't generate a palette.
[w] wal           Trying a larger palette size 34
[e] wal           Imagemagick couldn't generate a suitable palette.

The result I'm getting is, no change in wallpaper and no change in colorscheme. If I try to do this via the GUI, after setting the wallpaper, I see the above output on the cli, and then the gui stops after Imagemagick couldn't generate a suitable palette. If I set a previously used wallpaper, everything works as I expect, wallpaper changes, colorscheme changes, looks great, no problem. I suppose I'm also a little confused on what a 'theme' and a 'colorscheme' are and the difference between the two, maybe come clarification there would help.

I'm running on an up-to-date arch linux system.

(08:02:48)(cole)(~)(1)(13.61)pacman -Q wpgtk
wpgtk-git r824.5e8d762-1

Am I doing something wrong or misunderstanding?

deviantfero commented 3 years ago

I think I know what is happening, it's definitely a bug though, a temporary fix is:

after adding the image (which you've already done) leave the folder with the image Winter-Horse-1920-1080.jpg in it, and then use:

wpg -Ti Winter-Horse-1920-1080.jpg base16-gruvbox-hard
wpg -s Winter-Horse-1920-1080.jpg

what's happening is that Winter-Horse-1920-1080.jpg is in the same folder when you're setting the theme, so wpg -s can actually take file names as input instead of "theme" names, so it gets confused and instead of applying the theme Winter-Horse-1920-1080.jpg it reads the image again.

the fix would be making sure existing themes have priority over filenames in the folder

thecatwasnot commented 3 years ago

Fantastic, it worked!