You are not logged in.

#1 2013-07-22 14:47:07

Neoreon
Member
Registered: 2013-07-22
Posts: 7

Have to use "xrdb -merge ~/.Xresources". Why?

Hi, im really new to Arch and im liking it alot.
But some things are a bit weird.

I am using i3 as my wm and urxvt as my terminal.
I have some thing set in my .Xdefaults, such as transparency and colors.
Yesterday I could easy do a change there, save, open a new urxvt window and see the chages.
Today i cant do that anymore. The only thing that forces urxvt to take my chages is "xrdb -merge ~/.Xresources"
I mean... i DOES work, but i would like to understand my system and know why it is required now and wasnt yesterday. hmm

i dont know if it relevant but this is my .Xdefaults file


URxvt.clipboard.autocopy:true
URxvt*loginShell:false
URxvt*transparent:true
URxvt*shading:25
URxvt*background:Black
URxvt*foreground:White
URxvt*scrollBar:false
URxvt*scrollBar_right:true
URxvt*scrollBar_floating:false
URxvt*scrollstyle:plain
URxvt*secondaryScroll:true

# how many lines you want it to save per session
URxvt*saveLines:32767
URxvt*troughColor:#000000
URxvt*scrollColor:#222222
URxvt*font: xft:Dejavu Sans Mono:pixelsize=11
#URxvt*letterSpace: -4

# with this set to true, when an app sends a bell to the
terminal, awesome hilights the appropriate tag(s) ;)
URxvt*urgentOnBell: true

#for weechat alt-key characters
UXTerm*metaSendsEscape: true

#for copypaste, done with urxvt-perls-git
URxvt.perl-ext-common: ...,clipboard
URxvt.keysym.M-c:   perl:clipboard:copy
URxvt.keysym.M-v:   perl:clipboard:paste
URxvt.keysym.M-C-v: perl:clipboard:paste_escaped

# these three lines enable clicking on links to open them ;)
## if you want to enable tab support, append ,tabbed to the next line
## then use shift+down arrow to create tabs and shift+{left,right} arrows to switch between them
URxvt*perl-ext-common:
default,matcher,-option-popup,-selection-popup,-realine
URxvt*matcher.button: 1

# dont forget to change this to your favorite browser
URxvt*urlLauncher: chromium

PS: is

URxvt.clipboard.autocopy:true

the same as

URxvt*clipboard*autocopy:true

?
PSS: Im using udiskie to automount usb devices. Do i have to use udienkie-umount to cleanly unmount? Do i do a sync? Google confused me with contradictory answers.


Thx and I hope anyone can help me understand this OS better big_smile

Offline

#2 2013-07-22 15:03:17

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: Have to use "xrdb -merge ~/.Xresources". Why?

1. When you start X using a custom xinitrc, you need to specify X config files to be loaded. Otherwise you'll be presented with the plain default look & feel.
2. Asterisk and Wildcard matching.
3. I'm using udevil to automount and I need to issue 'udevil umount <mount_point/drive>' to unmount cleanly. (Actually, I created a couple of aliases in .bashrc to do this.) In a DE you usually choose 'Eject drive' to do this; the result is just the same.

Welcome to Arch. wink

Last edited by bohoomil (2013-07-22 15:09:08)


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#3 2013-07-22 15:29:41

Neoreon
Member
Registered: 2013-07-22
Posts: 7

Re: Have to use "xrdb -merge ~/.Xresources". Why?

bohoomil wrote:

I'm using udevil to automount and I need to issue 'udevil umount <mount_point/drive>' to unmount cleanly. (Actually, I created a couple of aliases in .bashrc to do this.) In a DE you usually choose 'Eject drive' to do this; the result is just the same.

Ok, so an unmount is better. Is "sync" before that required or does the unmount does.. things?

bohoomil wrote:

When you start X using a custom xinitrc

Im confused about why yesterday urxvt took changes in the .Xdefaults file immediatly and not it doesnt.

Thanks anyway for the input and the warm welcome big_smile

Last edited by Neoreon (2013-07-22 15:30:13)

Offline

#4 2013-07-22 16:06:08

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Have to use "xrdb -merge ~/.Xresources". Why?

Unmounting implies a sync. 

The .Xdefaults and .Xresources are different files.  They accomplish the same thing, but the .Xresources is apparently the new and current way of doing things.  In your first post you seem to switch back and forth between the two as though they are equivalent.  With the .Xdefaults file, it used to be that it would simple be parsed and configurations loaded when you started an application, but I am not sure if this is still the case today.  I *think* the .Xdefaults way is considered deprecated.

I'm not sure why the .Xresources requires a load via xrdb, but I will say that I think it is a good thing.  If you have something that is borked in your .Xresources, it is probably better that it is not automatically reloaded as you try to fix things.  I think it just gives more control over what gets loaded when (thats my personal opinion anyway).  It wouldn't surprise me if there are some desktop environments that try to handle this for you, but I have been using a stand alone window manager for some time now, so I am not entirely sure about that one.  I know that most try to do things like load .xmodmap for you, so autoloading .Xresources wound't be to big of a jump from there.

As bohoomil said above, the asterisks is a wildcard.  It is used in all kinds of things, and basically represents any characters of any length.  So if I had a directory with aaa, aab, bac, and bca, if I did "ls a*" it would list aaa and aab.  Likewise if I did *a*, it would list aaa, aab, and bac.  Does that make sense?  Basically, you use URxvt*whatever so that it will match URxvt.whatever as well as URxvtc.whatever and URxvtd.whatever.  I'm not sure that URxvt requires different configurations for urxvt vs urxvtc/d, but that is what a wildcard would cover.

Also, again, welcome to the community.  Enjoy your stay!

Offline

#5 2013-07-22 16:25:52

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

Re: Have to use "xrdb -merge ~/.Xresources". Why?

I personally load Xresources using xrdb because I keep X config files in a custom location, so basically I don't have a single ~/.Xresources. So, a custom location of your files is IMO a nice add-on when using xrdb inside .xinitrc. smile

As far as I can remember, ~/.Xdefaults was to be loaded automatically by urxvt, while ~/.Xresources used to be more xterm specific. However, I don't know really how this would explain the inner structure of both terminal emulators, let alone the X as a whole. It's enough for my needs to follow model files in /etc/X11/xinit: xinitrc comes with the following inside

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi

if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
    xmodmap "$usermodmap"
fi

meaning that the procedure is considered correct by the upstream.

And just for the record: take a look at X resources Wiki page. Not directly an answer to your question(s), but still my clarify a few things when going through it.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

Board footer

Powered by FluxBB