You are not logged in.

#1 2009-04-02 15:31:49

nDray
Member
From: Portugal
Registered: 2007-01-21
Posts: 143
Website

[SOLVED] dynamic background colors for terminal emulator under dwm

Hi everyone!

I use dwm as a window manager and XTerm as my terminal emulator. I wanted to do one thing I can't find how to:

I want the background of the terminal emulator to change depending on it's focus status. Let's say I want the background color to be #333 when it has focus and #000 when it hasn't.
Now I believe there are two options:
Either a terminal emulator (not necessarily XTerm) supports it or I use a transparent one and dwm sets the different colors for the background depending on the focus status.

Does anyone know if any of these is possible?

Thanks,
nDray

Last edited by nDray (2009-04-03 10:12:34)

Offline

#2 2009-04-02 22:53:58

SamC
Member
From: Calgary
Registered: 2008-05-13
Posts: 611
Website

Re: [SOLVED] dynamic background colors for terminal emulator under dwm

I'm not sure, but urxvt may be able to do this.

Offline

#3 2009-04-03 05:56:25

Wra!th
Member
Registered: 2009-03-31
Posts: 342

Re: [SOLVED] dynamic background colors for terminal emulator under dwm

Unless urxvt has such an option you can't do this without hacking the dwm source (and I don't mean the config file only).Thisis simply because dwm has no ruleset per application (apart from floating yes/no and tag). You would need to modify the XCrossing events to check for a specific window(urxvt in this case).
This may be of help http://tronche.com/gui/x/xlib/events/window-entry-exit/

After you've (succesfully) accomplished that, make urxvt 100% transparent and use the ROOT background to fake changing of urxvt bg (make dwm use xsetroot -solid "<any color you want>" when you Enter or Leave the urxvt window).
You might of course search and see if urxvt has this option first smile

Last edited by Wra!th (2009-04-03 05:57:28)


MacGregor DESPITE THEM!
7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00

Offline

#4 2009-04-03 07:28:16

nDray
Member
From: Portugal
Registered: 2007-01-21
Posts: 143
Website

Re: [SOLVED] dynamic background colors for terminal emulator under dwm

dwm could do that for every window as urxvt would be the only transparent one in my display... I'll check that later, thank you!
And will also see if urxvt knows when it has focus and allows changing background colors... That first smile

Offline

#5 2009-04-03 07:58:28

Aprz
Member
From: Newark
Registered: 2008-05-28
Posts: 277

Re: [SOLVED] dynamic background colors for terminal emulator under dwm

Well, if you can do it in aterm easily by adding tinting and fading in ~/.Xdefaults for aterm.

aterm*tinting: #ffffff
aterm*fading: 50

That's an example for aterm. It does not work for xterm unfortunately.

Hah, sorry for providing alternatives for xterm. I personally use xterm also and I think I'll look around and play with xterm to see how to effectively do it.

Offline

#6 2009-04-03 08:10:52

nDray
Member
From: Portugal
Registered: 2007-01-21
Posts: 143
Website

Re: [SOLVED] dynamic background colors for terminal emulator under dwm

Thank you Aprz! I was just reading the manpage for urxvt and seen that there was the option I wanted but for text only... I'll see if fading actually depends on focus and how to do it... I can find it myself in XTerm, don't bother for me!

Thanks again.

Offline

#7 2009-04-03 10:12:20

nDray
Member
From: Portugal
Registered: 2007-01-21
Posts: 143
Website

Re: [SOLVED] dynamic background colors for terminal emulator under dwm

Aterm totally does it. Thank you very much!

Offline

Board footer

Powered by FluxBB