LukeSmithxyz / voidrice

My dotfiles (deployed by LARBS)
GNU General Public License v3.0
4.29k stars 1.21k forks source link

Pywal not running on startup #909

Closed StoicIndividual closed 3 years ago

StoicIndividual commented 3 years ago

I installed pywal but setbg only uses pywal when I directly run it on an image, the only thing it does on startup is set the background

BuddhiLW commented 3 years ago

Yeah, I'm having the same problem.

Doesn't matter what I do to .Xresources etc, my colors do not become persistent on startup. For example, the backgroup is persistent, but then the shell uses the default color that comes on larbs install (yellow-blueish).

My guess is that pywall is not deploying the colors to Xresources correctly. I suspect this, because my emacs, which uses xresources theme to make up it's color, startup white - because there is no color being fed to it.

My setup: .xprofile, uncommented the line xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & # Uncomment to use Xresources colors/settings on startup

xresources, just have the following lines

!! Transparency (0-1):
*.alpha: 0.7

!! Set a default font and font size as below:
*.font: monospace:size=20

/* name     dark    light */
/* black    0   8 */
/* red      1   9 */
/* green    2   10 */
/* yellow   3   11 */
/* blue     4   12 */
/* purple   5   13 */
/* cyan     6   14 */
/* white    7   15 */

! /* !! xterm */
/* *.color0:   #000000 */
/* *.color1:   #cd0000 */
/* *.color2:   #00cd00 */
/* *.color3:   #cdcd00 */
/* *.color4:   #0000cd */
/* *.color5:   #cd00cd */
/* *.color6:   #00cdcd */
/* *.color7:   #e5e5e5 */
/* *.color8:   #4d4d4d */
/* *.color9:   #ff0000 */
/* *.color10:  #00ff00 */
/* *.color11:  #ffff00 */
/* *.color12:  #0000ff */
/* *.color13:  #ff00ff */
/* *.color14:  #00ffff */
/* *.color15:  #aabac8 */
/* *.background:   #000000 */

/* *.background: .color0 */
/* *.color256: 0#1d2021 */
/* *.color257: 15#ebdbb2 */
BuddhiLW commented 3 years ago

Should $bgloc and $trueloc return nothing?

pic-full-210314-1701-42

To make the colors be right, I have to specify exactly one image to setbg - else, he picks a color scheme of one random picture and the background as another random picture. Even then, $bgloc and $trueloc do not return anythin

pic-full-210314-1713-31

LukeSmithxyz commented 3 years ago

@BuddhiLW 's first post is correct. You must uncomment the xrdb line to enable pywal.

$bgloc and $trueloc are not environmental variables, but only within that one script, so of course they won't echo out in some other terminal. $trueloc is only defined if you are changing the background (makes a link in the bg location ($HOME/.local/share/bg AKA $bgloc) that links to $trueloc, which is where the new image actually resides on your computer.

BuddhiLW commented 3 years ago

Well, what has worked for me was:

In the .xprofile file,

Append command on the last command, after unclutter &: wal -R &

Pywal documentation (https://github.com/dylanaraps/pywal/wiki/Getting-Started#making-the-colorscheme-persist-on-reboot) says to put it on .xinitrc, though. Anyhow, check it out and see what works for you, @StoicIndividual . It worked out for me.

StoicIndividual commented 3 years ago

@BuddhiLW This works for me but the statusbar isn't affected until I renew dwm, but is the setbg script not meant to run pywal on startup? Is placing wal -R & in xprofile the right way to do this? since pywal doesn't run on startup when uncommenting xrdb ${XDG_CONFIG_HOME:-$HOME/.config}/x11/xresources & @LukeSmithxyz

BuddhiLW commented 3 years ago

I don't know what happens to setbg when it runs without an argument. For me, it seems, it's running pywal on the default image luke ships on rice.

So, I just followed their documentation, and made this little tweak. As it doesn't break anything. It won't cost you anything less then maybe some miliseconds on startup.

But yeah, there must be a way to implement it in setbg script, by default. I just don't know how to do it.

Regards.

StoicIndividual commented 3 years ago

@BuddhiLW I found an alternative method, and that is to #include the .Xresources pywal generates in the .cache directory in the default xresources file in the .config directory, for example:

in ~/.config/x11/xresources

add #include "/home/{user}/.cache/wal/colors.Xresources" at the beginning or end of the file.

I don't know why pywal generates a colors.Xresources but it doesn't seem to use it on startup unless you include it in the xresources in the .config, or run xrdb directly on the file.

also I haven't been able to get pywal to get xresources to change the statusbar colors on startup without a refresh, I even tried placing the xrdb command at the beginning of the xinitrc file, but it doesn't always work .

but this method isn't much different from wal -R & in .xprofile, and to be honest I don't know how the script was meant to work to begin with, or whether pywal was meant to be run on startup in the first place, but since this issue is now closed I guess it doesn't matter, but I suspect it might have to do with running pywal before running xrdb, also I think this version of setbg was the last time pywal was working.

also running pywal on the default larbs background image has a completely different theme, so that means pywal isn't run at all when setbg is ran without an argument, you can check this with xrdb -query, after running pywal you can see the colors set in the output, but rebooting without wal -R & shows nothing or just the font or alpha settings set by the ~/.config/x11/xresources