5

I've just switched from xfce4-terminal to rxvt-unicode and I've been reading a lot of .Xresources and .Xdefaults files, piecing things together to create my own. My googling skills have left me with a number of unanswered questions; one of which is:

Is there a difference between URxvt.font and URxvt*font?

I have seen a number of variations, for example, the answer for this questions uses a asterisk in one line and periods in another.

URxvt*scrollBar:false URxvt*scrollBar_right: false URxvt.keysym.Shift-Up: command:\033]720;1\007 URxvt.keysym.Shift-Down: command:\033]721;1\007` 

Does that mean it doesn't matter or that it matters for some setting and not others? I'm hoping understanding the differences, if there are any, will help with the settings I can't get to work.

3
  • 2
    Both the answers here address this specific point: unix.stackexchange.com/questions/216723/… Commented Aug 27, 2017 at 3:09
  • @jasonwryan, thank you for the link. I will spend some time with the X(7)manual. Commented Aug 27, 2017 at 5:42
  • Look at man 7 urxvt, Can I see a typical configuration? question. Marc Lehmann used dots for urxvt instance and asterisks for IRC (urxvt.font: vs IRC*font: and on). In my understanding, that asterisks allow to share the same config between rxvt-unicode (where asterisks are redundant but harmless) and xterm. E.g. urxvt -name IRC and xterm -name IRC will use the same settings. Commented May 4, 2024 at 3:12

1 Answer 1

9

This is explained in the X manual (man 7 X):

When an application looks for the value of a resource, it specifies a complete path in the hierarchy, with both class and instance names. However, resource values are usually given with only partially specified names and classes, using pattern matching constructs. An asterisk (*) is a loose binding and is used to represent any number of intervening components, including none. A period (.) is a tight binding and is used to separate immediately adjacent components.

This means that

URxvt*scrollBar:false 

happens to be the same as

URxvt.scrollBar:false 

since there is no intermediate component between URxvt and the scrollBar component (if I read the urxvt manual correctly).

However,

URxvt.keysym.Shift-Up: command:\033]720;1\007 

could probably be written

URxvt*Shift-Up: command:\033]720;1\007 

to bypass that intervening keysym component. This will also set any other Shift-Up resource for the URxvt class though, if there are any other.

*Shift-Up: command:\033]720;1\007 

would set that resource for all X classes.

Asterisk works like a "globbing character", like * does for names in the shell, but for X resource names. Also, I believe you can't place a dot in the middle of a component name, so the analogy doesn't go all the way.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.