dylanaraps / pywal

🎨 Generate and change color-schemes on the fly.
MIT License
8.34k stars 325 forks source link

I3-Gaps; Pywal Not Using colors.Xresource and Uses .Xresources Instead #649

Closed ChrispyChris closed 2 years ago

ChrispyChris commented 2 years ago

I was having an issue all morning where I changed my wallpaper with my wallpaper script fehbg. Then I used wal -i Wallpaper/NewPic.png to set that and proceeded to test a reboot basically. When I loaded in to I3, the theme was that of the last wallpaper, even though I ran wal -R. Come to find out that wal wasn't using the custom Xresources it generates and instead was reading my .Xresources file.

I was wondering if I need to comment out all the color lines in .Xresources or what exactly is happening. I thought wal was supposed to generate the theme and apply it, but it almost seems as if my .Xresources were overwriting it and I had to manually run wal -i first. I did follow the instructions and all that, I've actually used pywal for a while. This was the first time changing wallpapers in a while though and that's how I came across this.

arcmags commented 2 years ago

When/how did you run wal -R? It works fine for me from within i3.

Something you may also consider (how I do things), is to have a line like #include "/home/user/.cache/wal/colors.Xresources" in your ~/.Xresources.

ChrispyChris commented 2 years ago

@arcmags Thanks for your reply!

Inside of my .xinitrc: This is an edit, but I found out that the big issue I was having is because I was executing i3 BEFORE wal -R

# Setting up i3-gaps environment
~/bin/fehbg &
exec i3
wal -R

I also run startx to jump into my I3 environment.

\ .Xresources file:

! X colors.
! Generated by 'wal' 
*foreground:        #afbbcc
*background:        #080F37
*.foreground:       #afbbcc
*.background:       #080F37
emacs*foreground:   #afbbcc
emacs*background:   #080F37
URxvt*foreground:   #afbbcc
XTerm*foreground:   #afbbcc
UXTerm*foreground:  #afbbcc
URxvt*background:   [100]#080F37
XTerm*background:   #080F37
UXTerm*background:  #080F37
URxvt*cursorColor:  #afbbcc
XTerm*cursorColor:  #afbbcc
UXTerm*cursorColor: #afbbcc
URxvt*borderColor:  [100]#080F37

! Colors 0-15.
*.color0: #080F37
*color0:  #080F37
*.color1: #2F4775
*color1:  #2F4775
*.color2: #A24952
*color2:  #A24952
*.color3: #E85D5A
*color3:  #E85D5A
*.color4: #295890
*color4:  #295890
*.color5: #5A6E9E
*color5:  #5A6E9E
*.color6: #007CC3
*color6:  #007CC3
*.color7: #afbbcc
*color7:  #afbbcc
*.color8: #7a828e
*color8:  #7a828e
*.color9: #2F4775
*color9:  #2F4775
*.color10: #A24952
*color10:  #A24952
*.color11: #E85D5A
*color11:  #E85D5A
*.color12: #295890
*color12:  #295890
*.color13: #5A6E9E
*color13:  #5A6E9E
*.color14: #007CC3
*color14:  #007CC3
*.color15: #afbbcc
*color15:  #afbbcc

! Black color that will not be affected by bold highlighting.
*.color66: #080F37
*color66:  #080F37

! Xclock colors.
XClock*foreground: #afbbcc
XClock*background: #080F37
XClock*majorColor:  rgba:af/bb/cc/ff
XClock*minorColor:  rgba:af/bb/cc/ff
XClock*hourColor:   rgba:af/bb/cc/ff
XClock*minuteColor: rgba:af/bb/cc/ff
XClock*secondColor: rgba:af/bb/cc/ff

! Set depth to make transparency work.
URxvt*depth: 32
URxvt*transparent: true
URxvt*shading: 30
URxvt*scrollBar:    false
URxvt*font: xft:xos4 Terminus:pixelsize=10
URxvt*boldFont: xft:xos4 Terminus:pixelsize=10
!URxvt.perl-ext:
!URxvt.perl-ext-common:

I think one thing that confused me was, in my .Xresources file at the top you see the comment "Generated by 'wal'". I may have somehow copied that line there a long time ago without realizing that I did it, who knows :/, but I'm wondering if this led to all my confusion. After digging into the code, pywal does use xrdb -merge to .cache/wal/colors.Xresources. I must have copied that all into my .Xresources and confused myself for all this time.

Below paragraph was caused because I was running wal -R AFTER exec i3 After looking into this, after your reply, I was wondering where exactly you run wal -R. I did see that xrdb was merging in the .Xresources file up at the top of .xinitrc, which wal -R would have run at the very end since it's at the bottom of .xinitrc. This still makes me wonder why my theme was not resetting to the actual theme I set last, but the previous one instead. At this point, I have no idea on this issue haha. I think it may have been a combination of some things that I was doing wrong. I'm basically satisfied that I've figured out my problem enough to fix it. I do wonder how you go about using pywal though since it appears that you use I3 as well.

I also wonder why you include the pywal generated .Xresources in your main one. How exactly is yours set up? Are you running wal -i path/to/image whenever you want a new theme (or maybe a fancy script, etc.) and just letting the C preprocessor use that #include inside of your .Xresources to theme your environment without running wal -R?

Another thing I was thinking and pretty much decided on is that I shouldn't even use fehbg, which is just a script to make feh set an image as your wallpaper. I saw that wal will use feh to run the same background command for me anyways. There is really no point in my keeping the fehbg command in my .xinitrc. I'm still definitely curious as to how you go about this though.

Sorry for the crazy response, I just found out that I was partially confused on how pywal worked internally until reading the code. I also found out that I must have copied some of pywal's Xresource file into my own manually, and this really confused me for a while. The last issue was that I was running wal -R AFTER exec i3. I'm finally finished figuring all of this out.

arcmags commented 2 years ago

Your issue was running wal -R after exec i3. exec [cmd] executes a command and never returns to the calling script again, so wal -R is never run.

I don't use wal -R ever. I use a wrapper script to copy any template files created in ~/.cache/wal/ to their proper places, this makes changes persistent upon reboot. I set my background with feh.

ChrispyChris commented 2 years ago

That makes sense. Thank you very much for your help. Seems like I got the issue solved :).

That seems like an interesting way to go about it. I might look into doing something similar. Thanks again!