LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-10-2016, 02:09 AM   #1
aeifn
LQ Newbie
 
Registered: Apr 2016
Posts: 17

Rep: Reputation: Disabled
xinitrc.d


Hello!

How to start particular program and set environment variable at Xorg starts?
.xinitrc in home directory is overwritten by xwmconfig, and /etc/X11/xinit/* is overwritten while system upgrade.
Is it any right way to add following to all xinitrc scripts without worrying of overwriting:

Code:
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
    for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
        [ -x "$f" ] && . "$f"
    done
    unset f
fi
 
Old 12-10-2016, 03:25 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Rep: Reputation: Disabled
Each WM/DE has its own way to start applications at startup, so it may not be that simple.

To do things like that in Slint, I customized not only the/etc/X11/xinit/xinitrc.* but also edited some /usr/bin/start*, created a wrapper script in /usr/libexec, and feeded /etc/skel.

If you are more specific on what you want to do (which application you want to run, what environment variable you need to set and why) we can give hints.

And no, I don't think that you can avoid redoing (or at least reviewing) your customizations upon system upgrade.

Last edited by Didier Spaier; 12-10-2016 at 03:28 AM.
 
1 members found this post helpful.
Old 12-10-2016, 03:40 AM   #3
aeifn
LQ Newbie
 
Registered: Apr 2016
Posts: 17

Original Poster
Rep: Reputation: Disabled
All I need is to run
Code:
xflux
at Xorg startup time for display color management
and set
Code:
export XDG_CURRENT_DESKTOP=kde
for better look and feel of qt5 apps on non-kde wm.
 
Old 12-10-2016, 04:47 AM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Rep: Reputation: Disabled
First, a word of caution.

If do:
Code:
export XDG_CURRENT_DESKTOP=KDE
all applications that have in their .desktop KDE among the NotShowIn list won't be easily accessible from other WM/DE. This includes nm-applet and nm-connection-editor.

In Slint, we set XDG_CURRENT_DESKTOP to LXDE by default, to avoid some duplicate and missing entries in the xdg menus of the WMs. This overcomes some faulty implementation (in my opinion) of the XDG specifications by some tools.

This is done in this file, installed in /usr/libexec/slint: http://slackware.uk/slint/x86_64/sli...nel/lxpanel.sh

This wrapper script also starts fbautostart that allows to start an application at startup of any WM/DE that implement the autostart specification (all WM/DE shipped in Slackware do).

You could use that to autostart xflux, or more exactly the xflux-gui applet: https://github.com/xflux-gui/xflux-gui if this is what you want.
But bear in mind that not all WM shiped in Slackware have a tray.
For those that do not have one like blackbox and twm you could use stalonetray.

To allow the user to change the value of XDG_CURRENT_DESKTOP we ship the script http://slackware.uk/slint/x86_64/sli...mmy-desktop.sh that go in /etc/profile.d

If you do something like that you will also need to find a place to start the wrapper scripts.
In Slint we do that in /usr/bin/{startfluxbox,startfwm2,starttwm,startwmaker}.
We also create /usr/bin/starttwm, not shipped in Slackware.

Maybe this an overkill for what you need to do

Last edited by Didier Spaier; 12-10-2016 at 04:54 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
xinitrc mbvo Linux - Software 1 09-06-2008 07:15 AM
.xinitrc RAH104 Linux - Newbie 1 06-20-2008 04:27 AM
.xinitrc oldsko0l Linux - Software 10 06-10-2006 04:44 PM
.xinitrc unimaginative Linux - Newbie 1 01-03-2004 10:53 PM
.xinitrc nakkaya Linux - Software 1 04-11-2003 03:12 PM

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

All times are GMT -5. The time now is 07:45 PM.

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