best way to start desired X clients on login with xorg-server?

Richard L. Hamilton rlhamil at smart.net
Sat Jun 1 14:32:10 UTC 2019



> On Jun 1, 2019, at 01:20, Richard Cobbe <rcobbe at pobox.com> wrote:
> 
> [Responding to the list this time]
> 
> On Wed, May 29, 2019 at 04:10:56AM -0400, Richard L. Hamilton wrote:
> 
>> While the system xinitrc does plenty you don't want, it might still be
>> worth looking at; having an ~/.xinitrc.d directory with separate files
>> for different setup actions, running xmodmap if the files for it are
>> present, etc, may be useful.
> 
> Ah, yes, I'd forgotten about that; thanks for the reminder!
> 
>> One thing to add before starting urxvt if you want color to work!!
>> export TERMINFO=/opt/local/share/terminfo
>> 
>> because the rxvt-unicode-256color entry is only there, not in
>> /usr/share/terminfo.  I noticed that as soon as I installed urxvt and ran
>> the system version of vi or vim (as opposed to the MacPorts version,
>> which will look in the MacPorts terminfo directory without being told).
> 
> Huh -- there's something weird going on here.  As you say, that terminfo
> entry is only in /opt/local/share/terminfo, not under /usr/share/terminfo.
> However, I was able to start /usr/bin/vi in urxvt, with
> TERM=rxvt-unicode-256-color, *without* setting TERMINFO, and I'm getting
> color just fine.

Are you sure it was /usr/bin/vi and not /opt/local/bin/vi?  The latter uses the MacPorts libncurses, which knows its own TERMINFO location.
What surprises me is that /usr/bin/vi (actually vim in vi mode) works at all with a nonexistent terminfo file; but it seems to be smart about assuming an xterm or an ANSI terminal in those cases, although for whatever reason it doesn't complain with TERM=rxvt-unicode-256color as it would with e.g. TERM=nosuch


> One other thing: it is possible to set XDG_CONFIG_HOME in the X server's
> environment?  I'm finding that applications that I add to the
> "Applications" menu aren't seeing that variable, despite it being set in
> one of the files in .xinitrc.d.  (And I know that setting is happening for
> the clients started later in that file, because I'm getting the expected
> font in urxvt.  Since xquartz is also started in that file, I'd expect it
> to pick up that variable as well.)
> 
> I can edit the command in the Applications menu entry to be
> 
>    /usr/bin/env LC_CTYPE=en_US.UTF-8 XDG_CONFIG_HOME=/Users/cobbe/etc /opt/lcoal/bin/urxvt
> 
> and this works just fine, but I'm wondering if there's a more elegant way
> to set that up.

I suspect it's not the X server at all, but the app program that acts like a wrapper, which handles the app's dock menu items. The whole issue of environment variables and Mac app bundles is a bit nasty; there used to be a file to put those in, but that's not supported for a long time.  You may be able to use launchctl commands to put it in the environment of everything started by user-level launchd, but you'd have to arrange for those commands to be run every time you logged in.  Or to set it for a specific app (but for everybody, unless you make your own copy of the app), I guess you can put it in the app's Info.plist file in the appropriate manner. Your solution is probably simplest, even if it means both an xinitrc file and the menu entries have to be tweaked, esp. since you want to only use user files and not systemwide files.

> Thanks!
> 
> Richard
> 



More information about the macports-users mailing list