4

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.

Thomas
  • 6,362
345422
  • 375
  • 2
    Both the answers here address this specific point: https://unix.stackexchange.com/questions/216723/xterm-or-xterm-in-configuration-file – jasonwryan Aug 27 '17 at 03:09
  • @jasonwryan, thank you for the link. I will spend some time with the X(7)manual. – 345422 Aug 27 '17 at 05:42

1 Answers1

8

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.

Kusalananda
  • 333,661