LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-30-2018, 05:43 AM   #1
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
xrdb and .Xresources


14.2 amd64

Until recently I never** had a problem with merging X resources by including the line below in ~/.xinitrc :

Code:
xrdb -merge $HOME/.Xresources
Last week I copied some terminal themes to ~/.Xresources.d/themes/ and added an #include ./Xresources.d/themes/<theme-name> to the ~/.Xresources file. Since then, for some unknown reason, the xrdb command in ~/.xinitrc no longer works. I have to run it manually from within Xfce and restart the xterm or urxvt. Only then does the terminal honour the resources file.

**I do remember having a similar problem some time ago and I solved it by using xrdb $HOME/.Xresources in .xinitrc, instead of xrdb -merge $HOME/.Xresources. I'd like to know what I'm doing wrong before resorting to that again.

Last edited by Gerard Lally; 09-30-2018 at 06:47 AM.
 
Old 09-30-2018, 08:06 PM   #2
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Rep: Reputation: Disabled
You definitely need double quotes around the filename in #include, as required by cpp (C pre-processor). I don't know if there is anything else wrong, but start with that.
 
Old 10-01-2018, 01:26 PM   #3
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Original Poster
Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by ljb643 View Post
You definitely need double quotes around the filename in #include, as required by cpp (C pre-processor). I don't know if there is anything else wrong, but start with that.
Sorry: forgot to include relevant excerpts. Double quotes were there.

~/.xinitrc
Code:
userresources=$HOME/.Xresources
/usr/bin/xrdb -merge $userresources
~/.Xresources
Code:
#include ".Xresources.d/themes/relaxed.xrdb"
 
Old 10-01-2018, 09:33 PM   #4
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
Does it work if you pass -I$HOME to xrdb?

Code:
/usr/bin/xrdb -merge -I$HOME ~/.Xresources
 
Old 10-02-2018, 04:25 AM   #5
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Original Poster
Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by coralfang View Post
Does it work if you pass -I$HOME to xrdb?

Code:
/usr/bin/xrdb -merge -I$HOME ~/.Xresources
Not from .xinitrc, but it does work from within Xfce, if I restart xterm. After starting Xfce with startx, a new xterm completely ignores the colour scheme specified in .Xresources, but once I run the exact same "xrdb -merge ... " command from within that xterm, the colours are applied properly to any xterms opened afterwards.
 
Old 10-02-2018, 04:57 AM   #6
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
How about trying -load instead of -merge.
Maybe something else is over riding your settings when merging the config?

I remember having trouble with -merge previously, and have habitually run -load ever since.
 
1 members found this post helpful.
Old 10-02-2018, 05:14 AM   #7
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Original Poster
Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by coralfang View Post
How about trying -load instead of -merge.
Maybe something else is over riding your settings when merging the config?

I remember having trouble with -merge previously, and have habitually run -load ever since.
Tried load, and no joy. The thing is, it does work, but only within Xfce, not from .xinitrc.
Attached Thumbnails
Click image for larger version

Name:	snapshot1.png
Views:	57
Size:	20.0 KB
ID:	28696   Click image for larger version

Name:	snapshot2.png
Views:	61
Size:	25.9 KB
ID:	28697  
 
Old 10-02-2018, 05:25 AM   #8
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
I'd check first the /etc/X11/xinit/xinitrc.xfce to compare what it does differently, then make xinitrc.custom with that info.
Could also be startxfce4 script that did something your xinitrc did not do.
 
1 members found this post helpful.
Old 10-02-2018, 06:17 AM   #9
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Original Poster
Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by elcore View Post
I'd check first the /etc/X11/xinit/xinitrc.xfce to compare what it does differently, then make xinitrc.custom with that info.
Could also be startxfce4 script that did something your xinitrc did not do.
Well, it appears you're onto something. My ~/.xinitrc has the same contents as the system xinitrc.xfce (except for urxvtd -q -o -f and setxkbmap gb), so that doesn't appear to be the problem. But I've just tried fvwm and fluxbox and xterm does honour X resources when I start with those WMs. Now to find out why Xfce has suddenly decided to change its mind. It was working fine until I put that #include line in .Xresources.

edit: After typing #include above, I've just discovered the # is mapped to \ instead. So my gb keyboard layout, as specified in .xinitrc with setxkbmap gb, is also being ignored. For some reason Xfce is ignoring ~/.xinitrc altogether, and not just the .Xresources line. I don't have a display manager, so startx should invoke ~/.xinitrc, shouldn't it?

Last edited by Gerard Lally; 10-02-2018 at 06:31 AM.
 
Old 10-02-2018, 12:35 PM   #10
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Original Poster
Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by Gerard Lally View Post
edit: After typing #include above, I've just discovered the # is mapped to \ instead. So my gb keyboard layout, as specified in .xinitrc with setxkbmap gb, is also being ignored. For some reason Xfce is ignoring ~/.xinitrc altogether, and not just the .Xresources line. I don't have a display manager, so startx should invoke ~/.xinitrc, shouldn't it?
Sorry, false alarm. My ~/.xinitrc was overwritten and restored to default values when I used xwmconfig to switch between fvwm, fluxbox and xfce. That explains the keyboard problem, but not the .Xresources problem.
 
Old 10-03-2018, 02:21 AM   #11
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
Well if other WM works, then it's startxfce problem (which I can't help with tbh)
Thing is I don't use startx, I use (and prefer) XDM and ~/.xsession file coupled with custom start(xfce) script:
Code:
#!/bin/sh
#  startxfwm4 v1.1
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
   eval `dbus-launch --sh-syntax --exit-with-session`
fi
/usr/bin/Thunar --daemon --display=:0.0 &
/usr/bin/xfwm4 --daemon --display=:0.0 --sm-client-disable &
/usr/bin/xfdesktop --display=:0.0 --disable-wm-check --sm-client-disable &
/usr/bin/xfce4-panel --display=:0.0 --disable-wm-check --sm-client-disable
And .Xresources loads from ~/.xsession file over here like:
Code:
#!/bin/sh

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

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

if [ -f $sysmodmap ]; then
    /usr/bin/xmodmap $sysmodmap
fi

if [ -f $userresources ]; then
    /usr/bin/xrdb -merge $userresources
fi

if [ -f $usermodmap ]; then
    /usr/bin/xmodmap $usermodmap
fi

if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
  exec ck-launch-session /usr/bin/startxfwm4
else
  exec /usr/bin/startxfwm4
fi
Not sure how you'd do this with 'startx' but it's an interesting topic nonetheless.
 
1 members found this post helpful.
Old 10-03-2018, 03:23 AM   #12
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Original Poster
Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by elcore View Post
Well if other WM works, then it's startxfce problem (which I can't help with tbh)
Thing is I don't use startx, I use (and prefer) XDM and ~/.xsession file coupled with custom start(xfce) script:
I tried this method and it works. It solves the Xresources problem, but creates one or two others, most likely down to me not being familiar with xsession, and session management in general. First, I could not change GTK settings using the Xfce settings manager. I had to install lxappearance and that did the trick by creating ~/.gtkrc-2.0. Second, I get an error when I try to logout using the whisker menu:

Code:
Could not get owner of name 'org.xfce.SessionManager': no such name
And through the action buttons:

Code:
The name org.xfce.SessionManager was not provided by any .service files
So at the moment I've no way of logging out from Xfce other than by switching to another VT and running telinit 3.
 
Old 10-03-2018, 05:46 AM   #13
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
Yes, this is normal, nothing to worry about. The .gtkrc is simple to fix, maybe it's worth to add one into /etc/skel
Reboot/Shutdown is bit of a hack, but I got that fixed with dbus and some desktop files:
Code:
[Desktop Entry]
Version=1.0
Type=Application
Name=Reboot
Exec=dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
Icon=system-reboot
StartupNotify=false
Terminal=false
Categories=System;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
X-XFCE-CommandsWithParameter=dbus-send "--system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart"
X-XFCE-Commands=dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
Code:
[Desktop Entry]
Version=1.0
Type=Application
Name=Shutdown
Exec=dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
Icon=system-shutdown
StartupNotify=false
Terminal=false
Categories=System;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
X-XFCE-CommandsWithParameter=dbus-send "--system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop"
X-XFCE-Commands=dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
XML if you need for menu:
Code:
<Or>
        <Filename>xfce4-session-logout.desktop</Filename>
        <Filename>xfce4-session-reboot.desktop</Filename>
        <Filename>xfce4-session-shutdown.desktop</Filename>
</Or>
I already posted about that thing in 2016-2017 (it was for fluxbox menu, but later I used it to get rid of 'session manager' because I don't like *managers)
 
2 members found this post helpful.
Old 10-03-2018, 05:57 AM   #14
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,753

Rep: Reputation: Disabled
Almost forgot logout:
Code:
cat /usr/share/applications/xfce4-session-logout.desktop 
[Desktop Entry]
Version=1.0
Type=Application
Name=Logout
Exec=xfce4-panel -q
Icon=system-shutdown
StartupNotify=false
Terminal=false
Categories=System;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
 
2 members found this post helpful.
Old 10-03-2018, 07:17 AM   #15
Gerard Lally
Senior Member
 
Registered: Sep 2009
Location: Leinster, IE
Distribution: Slackware, NetBSD
Posts: 2,177

Original Poster
Rep: Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761Reputation: 1761
Quote:
Originally Posted by elcore View Post
Almost forgot logout:
Code:
cat /usr/share/applications/xfce4-session-logout.desktop 
[Desktop Entry]
Version=1.0
Type=Application
Name=Logout
Exec=xfce4-panel -q
Icon=system-shutdown
StartupNotify=false
Terminal=false
Categories=System;X-XFCE;X-Xfce-Toplevel;
OnlyShowIn=XFCE;
Thank you for your help. GTK is fixed; as for logout, I'll just alias xfce4-panel -q. I always have an xterm open anyway. This newfangled .desktop and dbus thing brings me right back to ini files in Windows for Workgroups 3.11, and that's not a pleasant memory.

I'm not going to mark this solved because the workaround, which I'm satisfied with, still doesn't solve the original problem.

Last edited by Gerard Lally; 10-03-2018 at 07:18 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xrdb and Xresources Mr. Alex Linux - Software 2 05-10-2015 01:26 PM
[SOLVED] xrdb -merge .Xresources, how can i get rid of that ? cola Slackware 2 12-19-2009 06:54 AM
WoW, xlaunch and xrdb gbj Linux - Games 2 11-25-2007 09:40 AM
xrdb and x resources not merged Mark_in_Hollywood Linux - General 0 04-12-2006 04:39 PM
xrdb for cygwin max2878 Linux - General 0 06-25-2002 03:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration