I don't recall having to use .Xdefaults-`hostname` in the past, but it
certainly behaves that way now.  Maybe this is to support NFS mounted
homedirs?  In any case, I can't think of a case where I've ever wanted to
change the behaviour of an X program based on which host it was executed
from.

Consider using .Xresources rather than .Xdefaults: the former are loaded
into the X server, so are linked to a particular display environment,
whereas the latter are set based on the client.

In my case, typically I care more about the server than the client for
things like font size: for example, when using my laptop the resources are
configured to suit a 14" screen at a particular resolution, and those same
settings are used when I run xvile either locally, or remotely on my
workstation over ssh.  When sitting at my workstation which has a somewhat
larger screen, I want different settings configured in the X server.  By
using .Xresources rather than .Xdefaults the same invocation of xvile
behaves appropriately depending on where it is being displayed, rather than
where was invoked from.

For most desktop environments, ~/.Xresources should be loaded at login.
Note that if you make changes you will need to run xrdb to pick them up.

See also https://wiki.archlinux.org/index.php/x_resources

On Sat, 9 Nov 2019 at 10:02, Thomas Dickey <dic...@his.com> wrote:

> On Fri, Nov 08, 2019 at 12:34:14PM +0100, Gary Jennejohn wrote:
> > Hi,
> >
> > I'm using Xvile 98.t and am trying to create a bash alias using
> > -xrm to set various X resources.
> >
> > I'm doing this because I'm starting Xvile over a ssh login and
> > for some reason the XVile settings in .Xdefaults are not being
> > used by the Xorg server on the computer from which I'm logging
> > in.  Using ssh -X does not help.
>
> man X tells me
>
>        XENVIRONMENT
>                Any  user-  and  machine-specific resources may be
> specified by
>                setting the XENVIRONMENT environment variable to the name
> of  a
>                resource  file to be loaded by all applications.  If this
> vari‐
>                able is not defined, a file named
> $HOME/.Xdefaults-hostname  is
>                looked  for  instead,  where  hostname  is the name of the
> host
>                where the application is executing.
>
>        -xrm resourcestring
>                Resources can also be specified from  the  command  line.
>  The
>                resourcestring  is  a  single  resource name and value as
> shown
>                above.  Note that if the string contains characters
> interpreted
>                by the shell (e.g., asterisk), they must be quoted.  Any
> number
>                of -xrm arguments may be given on the command line.
>
> Perhaps your ".Xdefaults" isn't linked to ".Xdefaults-hostname"
>
> > The target computer has just enough of Xorg installed to allow
> > Xvile to run.
> >
> > Unfortunately, the syntax required for -xrm isn't explained
> > anywhere in the help file.
> >
> > Any examples on how to use -xrm?
>
> It's borrowed from xterm, but actually is an X Toolkit option.
>
> Here, "appres XVile" gives me a longish list, e.g.,
>
> *menubar*foreground:    black
> *menubar*borderColor:   grey
> *menubar.hSpace:        1
> *menubar.vSpace:        1
> *menubar*background:    grey
>
> and I could pass each of those as an -xrm option by quoting it,
> e.g.,
>         xterm \
>                 -xrm '*menubar*foreground:      black' \
>                 -xrm '*menubar*borderColor:     grey' \
>                 -xrm '*menubar.hSpace:  1' \
>                 -xrm '*menubar.vSpace:  1' \
>                 -xrm '*menubar*background:      grey'
>
> but actually setting XAPPLRESDIR (mentioned just before the chunk I quoted)
> lets one set up a directory where X will search for the "XVile" file:
>
>        application-specific files
>                Directories named by the environment variable
> XUSERFILESEARCH‐
>                PATH  or  the  environment  variable XAPPLRESDIR (which
> names a
>                single directory and should end with a '/' on  POSIX
> systems),
>                plus   directories   in   a   standard   place  (usually
> under
>                /usr/share/X11/, but this can be  overridden  with  the
> XFILE‐
>                SEARCHPATH  environment variable) are searched for for
> applica‐
>                tion-specific  resources.   For  example,  application
> default
>                resources  are  usually  kept  in
> /usr/share/X11/app-defaults/.
>                See the X Toolkit Intrinsics - C Language Interface manual
> for
>                details.
>
>
> --
> Thomas E. Dickey <dic...@invisible-island.net>
> https://invisible-island.net
> ftp://ftp.invisible-island.net
>

Reply via email to