You are not logged in.

#1 2014-05-29 06:44:22

bennylb0
Member
From: Melbourne, Australia
Registered: 2010-05-21
Posts: 66

[SOLVED]Starting TMUX is somehow reloading ~/.Xresources

I've been searching for a solution for this for quite a while but came to the conclusion that it would be best to ask on the forum.

I have the following in ~/.Xresources:

Xft.dpi: 84
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.autohint: false
Xft.hintstyle: hintfull
Xft.lcdfilter: lcddefault

Xft.dpi is set to the DPI of my monitor. When starting tmux the settings are somehow overridden to the following:

Xcursor.size:   0
Xcursor.theme:  Adwaita
Xcursor.theme_core:     1
Xft.antialias:  1
Xft.autohint:   0
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintfull
Xft.lcdfilter:  lcddefault
Xft.rgba:       rgb

First it seems like xrdb is being run again and secondly it seems as if there must be file other than ~/.Xresources being sourced somewhere.

The most important setting is Xft.dpi as KDE applications DPI are being changed based on the overridden values. Does anyone know what could be causing this?

Last edited by bennylb0 (2014-06-14 10:49:12)

Offline

#2 2014-05-29 07:04:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED]Starting TMUX is somehow reloading ~/.Xresources

What's in your tmux.conf?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-05-29 08:43:59

bennylb0
Member
From: Melbourne, Australia
Registered: 2010-05-21
Posts: 66

Re: [SOLVED]Starting TMUX is somehow reloading ~/.Xresources

I have a pretty minimal ~/.tmux.conf with following:

set -s escape-time 0

# Change default prefix key as it is used in vim
unbind-key C-b
set-option -g prefix `
bind-key ` send-prefix

# Create vim like functionality
#setw -g mode-mouse on
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

I should also mention that desktop sessions are configured to run xrdb using /etc/lightdm/Xsession and in ~/.xinitrc with:

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

Doing so sets xrdb on login with lightdm to the correct values until I start tmux in XFCE terminal.

Last edited by bennylb0 (2014-05-30 02:34:30)

Offline

#4 2014-05-30 13:03:41

bennylb0
Member
From: Melbourne, Australia
Registered: 2010-05-21
Posts: 66

Re: [SOLVED]Starting TMUX is somehow reloading ~/.Xresources

Alright I've exhausted everything I could think of including:

  • pstree

  • strace -e trace=process,file bash 2>&1 | tee strace-bash.log

  • strace -e trace=process,file tmux 2>&1 | tee strace-tmux.log

  • a vimdiff between the output of env before and after tmux was started

  • removed then reinstalled tmux

To no avail.

This is by no means a solution and hugely hacky but for the time being I've had to put

[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources

at the end of my ~/.bashrc.

The locations of resource files that I could find in the documentation were ~/.Xresources and /etc/X11/Xresources and /etc/X11/Xresources doesn't exist on my system.

If anyone can shed some light as to where these incorrect resource values are being sourced or where xrdb is being started in the first place please let me know.

Offline

#5 2014-06-14 09:47:48

bennylb0
Member
From: Melbourne, Australia
Registered: 2010-05-21
Posts: 66

Re: [SOLVED]Starting TMUX is somehow reloading ~/.Xresources

So installed GNU screen which doesn't have the same problem as tmux and managed to narrow down the problem to the fact that running

tmux

executes a shell based on the $SHELL environment variable, in my case

/bin/bash

which is a non login shell but somehow when running tmux a login shell is being executed instead as in

/bin/bash --login

In the case of screen this isn't a problem because screen calls /bin/bash as expected.

Executing /bin/bash --login is somewhere randomly calling xrdb -load /path/to/unidentified/resourcefile

To force tmux the same behaviour as screen I've added the following to ~/.tmux.conf

 set-option -g default-command $SHELL 

An added bonus of this setting is that you no longer need to source ~/.bashrc from ~/.bash_profile like below for your ~/.bashrc to take effect every time tmux is started.

[[ -f ~/.bashrc ]] && . ~/.bashrc

This still isn't technically solved but it's a pretty good workaround. Mods do you want this marked as solved?

Offline

#6 2014-06-14 10:12:37

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED]Starting TMUX is somehow reloading ~/.Xresources

You can mark it as solved by editing your first post.

This strikes me as indicative of something else slightly off in the way that your shell is being initialised.

The default for tmux is to create a login shell, but that shouldn't create your original issue (I wouldn't have thought, anyway).


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2014-06-14 10:47:38

bennylb0
Member
From: Melbourne, Australia
Registered: 2010-05-21
Posts: 66

Re: [SOLVED]Starting TMUX is somehow reloading ~/.Xresources

I had also suspected a file on shell initialisation but just can't find anything in a bash rc or profile, global or local that points to this. It'll turn up at some stage.

I'll mark this as solved.

Thanks

Offline

#8 2014-06-15 06:03:57

bennylb0
Member
From: Melbourne, Australia
Registered: 2010-05-21
Posts: 66

Re: [SOLVED]Starting TMUX is somehow reloading ~/.Xresources

Finally found the problem. I thought it would be best to post the solution here in case anyone else has the same problem.

I have the infinality bundle installed. Infinality bundle installs infinality-settings.sh to /etc/profile.d which is sourced when a login shell is started.

infinality-settings.sh sets the following resources that override anything in the user defined ~/.Xresources when the login shell is started.

XFT_SETTINGS="
Xft.antialias:  1
Xft.autohint:   0
Xft.dpi:        96
Xft.hinting:    1
Xft.hintstyle:  hintfull
Xft.lcdfilter:  lcddefault
Xft.rgba:       rgb
" 

echo "$XFT_SETTINGS" | xrdb -merge > /dev/null 2>&1

To fix this just comment out

#echo "$XFT_SETTINGS" | xrdb -merge > /dev/null 2>&1

And that's it, done.

Offline

#9 2014-06-15 06:07:07

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED]Starting TMUX is somehow reloading ~/.Xresources

Nice catch.

I had forgotten all about that. I set my DPI in xorg.conf.d and had commented out the dpi line in infinality-settings some time ago.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2014-06-15 06:35:24

bennylb0
Member
From: Melbourne, Australia
Registered: 2010-05-21
Posts: 66

Re: [SOLVED]Starting TMUX is somehow reloading ~/.Xresources

Yeah thanks, it had me stumped. A good reminder that when all else fails use strace.

Cheers

Offline

Board footer

Powered by FluxBB