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

wp_init.sh is wrong when setting a light theme #277

Closed alizeegagnon closed 1 year ago

alizeegagnon commented 1 year ago

Hello ! I'm using a light theme, and I've noticed that the wp_init.sh script errors out.

Here is the auto-generated content of the script: #!/usr/bin/env bash wpg -rsL 'spikes.jpg' 'cactus.jpg'

Here is the output: $ ./wp_init.sh usage: wpg [-h] [--version] [-a A [A ...]] [-d D [D ...]] [-t] [-s S [S ...]] [-l] [-n] [-m] [-c] [-z Z [Z ...]] [-A A [A ...]] [-r] [-L] [--theme [THEME]] [-T] [-i I I] [-o O [O ...]] [-R R [R ...]] [--link LINK LINK] [--sat SAT SAT] [--brt BRT BRT] [--backend [BACKEND]] [--alpha ALPHA] [--preview] [--noreload] wpg: error: unrecognized arguments: spikes.jpg cactus.jpg

The problem is that the "s" option expects the jpg arguments to follow it directly (I think). The issue is solved by placing the L argument first, or after the jpg arguments.

Also, I've noticed that on my system, I do not want the -r argument. When I use it, my xrdb is NOT updated with the new colors (which affects Polybar in my case), and when I omit it, my xrdb IS updated as long as the reload_all option is true. Bottom line is, when I manually updated the wp_init.sh file to contain the following:

wpg -s 'spikes.jpg' 'cactus.jpg' -L

then on reboot, my colors were applied perfectly.

Is this a bug or a feature? If it's possible I wouldn't mind contributing a fix.

deviantfero commented 1 year ago

the -L placement is a bug and a contribution would be appreciated!

regarding the -r, the purpose of that flag is only for the init script, it avoids unnecessary reloading of software since it assumes the last configurations are read at startup, so it skips the reload calls for different programs :thinking: I'm not sure what the solution could be for that.

you could add a xrdb reload in your post command here:

image

alizeegagnon commented 1 year ago

Hello, I've opened a fork for the bug, I'll make a pull request when I've stopped fiddling with it... Changing the order of the parameters is an easy fix, but maybe the fact that the parameters do have an order is problematic and that is what should be fixed instead.

For my xrdb problem, I think I figured out my issue. When using the reload option, xrdb is loaded, but if changing the color scheme, it doesn't change because the reload option doesn't update the .cache/wal/colors.Xresources file (I haven't added custom commands to reload the normal .Xresources file) with the new colors. This is why I had been confused. Using the reload option does reload the xrdb, it is just not meant to be used when changing colors.

The problem is that the reloaded xrdb colors are not applied to my polybar. It loads with the default xrdb colors which seem to be black and grey ? I do launch the polybar after wp_init in my i3 config, but it seems polybar loads too fast or xrdb is reloaded with the colors too slowly. If I fix that, then the "-r" parameter will work fine for me in the init script.

alizeegagnon commented 1 year ago

Closed this by mistake...

deviantfero commented 1 year ago

this was closed by your PR #278 I think, re-open if I got it wrong, but it is now merged