DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 11th January 2015
kerasi kerasi is offline
Shell Scout
 
Join Date: Mar 2013
Location: Germany
Posts: 90
Default .Xdefaults or .Xresources

Hello

I have read that now it is better to use .Xresources instead of .Xdefault is that right?

Last edited by J65nko; 12th January 2015 at 08:25 PM. Reason: .Xressources -> .Xresources
Reply With Quote
  #2   (View Single Post)  
Old 11th January 2015
blackhole's Avatar
blackhole blackhole is offline
Spam Deminer
 
Join Date: Mar 2014
Posts: 316
Default

Have a look at xrdb(1)
Reply With Quote
  #3   (View Single Post)  
Old 12th January 2015
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

Quote:
I have read that now it is better to use .Xressources instead of .Xdefault is that right?
OpenBSD currently provides you with an .Xdefaults in your home directory. According to ArchWiki Xresources, the upstream Xorg developers are deprecating .Xdefaults in favor of .Xresources. I still use the .Xdefaults file in OpenBSD which automatically incorporates changes on user login.

I have been tweaking my settings for years and if I try say Debian Testing, I just copy most of my OpenBSD .Xdefaults into ~/.Xresources.
Reply With Quote
  #4   (View Single Post)  
Old 12th January 2015
JWJones's Avatar
JWJones JWJones is offline
got root?
 
Join Date: Jan 2014
Location: Cascadia
Posts: 68
Default

I use the same .Xresources file for both OpenBSD and Linux, and no longer use .Xdefaults. Everything works great.
Reply With Quote
  #5   (View Single Post)  
Old 12th January 2015
kerasi kerasi is offline
Shell Scout
 
Join Date: Mar 2013
Location: Germany
Posts: 90
Default

Ok thank you

Can you please show your .Xdefaults or .Xressources?
Reply With Quote
  #6   (View Single Post)  
Old 12th January 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by kerasi View Post
... or .Xressources?
That's three times that you've misspelled the filename. The file is spelled .Xresources. There are only two "s" characters used in the filename, not three as you have been using.

Last edited by jggimi; 12th January 2015 at 02:59 PM. Reason: error count. :)
Reply With Quote
  #7   (View Single Post)  
Old 12th January 2015
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

Quote:
Can you please show your .Xdefaults or .Xressources?
This ArchWiki Xresources link has numerous examples and links at the bottom of the page to other examples. One warning, most of the scripts in the ArchIWiki page are bash scripts and OpenBSD uses csh(1). A second warning is that syntax may vary, ie XTerm vs xterm. It is best to read the manual page for the applications you are configuring.
$ man xterm

Last edited by shep; 12th January 2015 at 04:33 PM. Reason: spelling and clarity
Reply With Quote
  #8   (View Single Post)  
Old 12th January 2015
kerasi kerasi is offline
Shell Scout
 
Join Date: Mar 2013
Location: Germany
Posts: 90
Default

Sorry for the misspelling
Reply With Quote
  #9   (View Single Post)  
Old 12th January 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I was just concerned that you would have problems with the file, and might not be able to identify the cause.
Reply With Quote
Old 13th January 2015
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

I think this is pretty good answer somebody posted on superuser

Quote:
~/.Xdefaults is the older method of storing X resources. This file is re-read every time an Xlib program is started. If X11 is used over the network, the file must be present on the same filesystem as the programs.

~/.Xresources is newer. It is loaded with xrdb into the RESOURCE_MANAGER property of the X11 root window. Whenever any program looks up a resource, it is read straight from RESOURCE_MANAGER.

If this property does not exist, Xlib falls back to the old method of reading .Xdefaults on every program startup. Note that most distributions will load ~/.Xresources automatically if it is present, causing .Xdefaults to be ignored even if you have never run xrdb manually.

The advantage of the new method is that it's enough to call xrdb once, and the resources will be available to any program running on this display, whether local or remote. (The name ~/.Xresources is only a convention – you can use xrdb to load any file, even .Xdefaults.)
I personally have both files but they are identical

Quote:
predrag@oko$ more .Xresources
XTerm*termName: xterm-color
XTerm*loginShell: true
XTerm*faceName: Mono
XTerm*faceSize: 11
XTerm*background: black
XTerm*foreground: gray

Xft.antialias: true

XClock*analog: false
XClock*strftime: %T %A %e %B
XClock*face: ter-d12n
XClock*interval: 1
XClock*margin: 0
XClock*foreground: gray
XClock*background: black
Quote:
predrag@oko$ more .Xdefaults
XTerm*termName: xterm-color
XTerm*loginShell: true
XTerm*faceName: Mono
XTerm*faceSize: 11
XTerm*background: black
XTerm*foreground: gray

Xft.antialias: true

XClock*analog: false
XClock*strftime: %T %A %e %B
XClock*face: ter-d12n
XClock*interval: 1
XClock*margin: 0
XClock*foreground: gray
XClock*background: black
Reply With Quote
Old 13th January 2015
kerasi kerasi is offline
Shell Scout
 
Join Date: Mar 2013
Location: Germany
Posts: 90
Default

thank you Oko for your .Xdefaults and .Xresources
Reply With Quote
Old 24th January 2015
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 133
Default

Code:
ln -s ~/.Xdefaults ~/.Xresources
, then they will be the same. However, why doesnot "Emacs.geometry: 178x38+0+380" work ?

Regards!
Reply With Quote
Old 11th February 2015
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Quote:
Originally Posted by Oko View Post
I think this is pretty good answer somebody posted on superuser

Code:
~/.Xdefaults is the older method of storing X resources. This file is re-read every time an Xlib program is started. If X11 is used over the network, the file must be present on the same filesystem as the programs.

~/.Xresources is newer. It is loaded with xrdb into the RESOURCE_MANAGER property of the X11 root window. Whenever any program looks up a resource, it is read straight from RESOURCE_MANAGER.

If this property does not exist, Xlib falls back to the old method of reading .Xdefaults on every program startup. Note that most distributions will load ~/.Xresources automatically if it is present, causing .Xdefaults to be ignored even if you have never run xrdb manually.

The advantage of the new method is that it's enough to call xrdb once, and the resources will be available to any program running on this display, whether local or remote. (The name ~/.Xresources is only a convention – you can use xrdb to load any file, even .Xdefaults.)
I personally have both files but they are identical
On my system, they behave the same. If I modify ~/.Xdefaults and start a new xterm the settings do *not* take effect. I need to do xrdb ~/.Xdefaults first.

However, if I do strace xterm (Linux), I get:

Code:
open("/home/martin/.Xdefaults-martin-xps.lico.nl", O_RDONLY) = -1 ENOENT (No such file or directory)
martin-xps.lico.nl is my machine's hostname.

I see no sign of either ~/.Xdefaults or ~/.Xresources

When I create this file, I get:

Code:
open("/home/martin/.Xdefaults-martin-xps.lico.nl", O_RDONLY) = 4
And these settings immediately take effect (and override my ~/.Xdefaults that I loaded with xrdb).
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 12th February 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 314
Default minor point/correction

Quote:
Originally Posted by shep View Post
One warning, most of the scripts in the ArchIWiki page are bash scripts and OpenBSD uses csh(1).
OpenBSD's default shell is /bin/ksh - ksh(1), which is (a tweaked version of)[?] the Public Domain Korn Shell - pdksh.
Reply With Quote
Old 12th February 2015
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

Quote:
Originally Posted by hanzer View Post
OpenBSD's default shell is /bin/ksh - ksh(1), which is (a tweaked version of)[?] the Public Domain Korn Shell - pdksh.
Good catch!!! I usually assume that people who are posting are samewhat informed

Code:
# echo $SHELL                                                           
/bin/ksh
# uname -a
OpenBSD oko.mydomain.org 5.6 GENERIC.MP#301 amd64
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
.Xdefaults/.Xresources user configuration files shep Guides 0 3rd May 2013 10:49 PM


All times are GMT. The time now is 01:01 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick