You are not logged in.

#1 2011-03-31 10:48:19

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

[SOLVED kinda] Using .Xresources only for certain applications

Hello all!

I was wondering if there is any way to make X read and use the .Xresources file only for one special app? I use freetype2-infinality, and I notice a change (for the worse) if I run " xrdb -merge ~/.Xresources " on login. But MATLAB looks quite nasty without antialiasing etc. set in X Resources, and it doesn't respect fontconfig.

Any tips?

Thank you!

Last edited by mariusmeyer (2011-03-31 17:09:28)

Offline

#2 2011-03-31 11:07:46

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED kinda] Using .Xresources only for certain applications

Applications should look for their classname (I don't know if that is guaranteed or just common use). The resource string becomes:

Classname.property: ......

`xprop` and selecting the application will tell you the classname.

And instead of xrdb -merge, use xrdb -load to clear the current database of unwanted entries.

Offline

#3 2011-03-31 12:11:12

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

Re: [SOLVED kinda] Using .Xresources only for certain applications

So, instead of

*Xft.autohint: 0
*Xft.lcdfilter:  lcddefault
*Xft.hintstyle:  hintfull
*Xft.hinting: 1
*Xft.antialias: 1
*Xft.dpi: 96
*Xft.rgba: rgb

I should have

Matlab*Xft.autohint: 0
Matlab*Xft.lcdfilter:  lcddefault
Matlab*Xft.hintstyle:  hintfull
Matlab*Xft.hinting: 1
Matlab*Xft.antialias: 1
Matlab*Xft.dpi: 96
Matlab*Xft.rgba: rgb

Right? What I want is to have Xft use these settings only for MATLAB, and no other X apps smile

EDIT: Tried this, and it didn't work... I suspected as much, since I think Xft is a classname in it's own right. So maybe I have to make Xft do this by some other means?

Last edited by mariusmeyer (2011-03-31 12:18:00)

Offline

#4 2011-03-31 12:28:57

Procyon
Member
Registered: 2008-05-07
Posts: 1,819

Re: [SOLVED kinda] Using .Xresources only for certain applications

You could load a specific resources file before matlab and restore it right after.

E.g. alias matlab='xrdb -load .Xresources.matlab; setsid matlab; sleep 5; xrdb -load .Xresources'

Important being setsid or &. A delay might be needed in case the window has not yet popped up and thus may not have read the resources database yet.

Offline

#5 2011-03-31 13:21:21

mariusmeyer
Member
From: Norway
Registered: 2009-04-25
Posts: 244

Re: [SOLVED kinda] Using .Xresources only for certain applications

True, that wasn't such a bad idea wink I'll try it when I get home from work!

EDIT: Seems the program was using some custom X libs that was shipped with the software. So it doesn't behave the way it should at all. The other program I was going to use this for is, after I thought about it for a sec, compiled for x86 while I'm on a x64 at home. So installing lib32-libxft-lcd from AUR fixed it.

Thank you big_smile

Last edited by mariusmeyer (2011-03-31 17:09:11)

Offline

Board footer

Powered by FluxBB