LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Getting xprofile to work ... (https://www.linuxquestions.org/questions/slackware-14/getting-xprofile-to-work-707202/)

chexmix 02-24-2009 02:20 PM

Getting xprofile to work ...
 
I have been using Openbox in my Slack --current install for a few weeks now. I like it, but would also like some apps to autostart when I fire up X. When I decided I wanted this I realized I'd totally forgotten how to make it happen!

So I went searching here and saw a few threads re: using a file (variously /etc/xprofile and ~/.xprofile) to store these commands. So I created /etc/xprofile with the lines

conky &
xscreensaver &
xclock &

and set it executable. It didn't work. I tried creating a symlink called '.xprofile' in my home directory to this /etc/xprofile. That didn't work. I chmod -x 'd /etc/xprofile, thinking it might be a permissions thing. That didn't work.

I'm sure it's something simple (I am something simple!), but I am currently stumped. All these commands are in /usr/bin, so I don't think adding the complete path is the answer, though it's easy enough to try ...

Thanks for any hints.

Glenn

Alien Bob 02-24-2009 02:29 PM

Just checking... but you do know that /etc/xprofile and ~/.xprofile are only used in runlevel 4?

Eric

chexmix 02-24-2009 02:31 PM

Quote:

Originally Posted by Alien Bob (Post 3455991)
Just checking... but you do know that /etc/xprofile and ~/.xprofile are only used in runlevel 4?

Eric

Uh, well, no. I do now (he said sheepishly).

So this isn't an option for folks who like to handstart X then? E.g. it is a thing to utilize if you go straight to KDM (or whatever) and do not collect $200?

alkos333 02-24-2009 03:48 PM

I'm not sure about openbox, but in fluxbox, there's a ~/.fluxbox/startup that gets this job done.

P.S. I launch my X manually as well.

mRgOBLIN 02-24-2009 03:57 PM

Code:

echo '#!/bin/sh
conky &
xscreensaver &
xclock &' > ~/.xsession

chmod +x ~/.xsession

Should do it I think

P.S an additional thought... back up your current ~/.xsession file if it exists as this will over-write it.

Woodsman 02-24-2009 04:29 PM

You can use /etc/xprofile or $HOME/.xprofile in run level 3. Just modify /usr/bin/startx to source the files.

Perhaps the following will help:

A More Intelligent startx Script

chexmix 02-24-2009 04:56 PM

Quote:

Originally Posted by mRgOBLIN (Post 3456075)
Code:

echo '#!/bin/sh
conky &
xscreensaver &
xclock &' > ~/.xsession

chmod +x ~/.xsession

Should do it I think

So weird. I did this, made sure the file was there and had the right perms, and no dice. I wonder if it is because .xinitrc doesn't reference it ...?

Seems like it should work fine ...

I am studying Woodsman's link. So much good stuff there!

chexmix 02-25-2009 10:31 AM

Quote:

Originally Posted by chexmix (Post 3456128)

I am studying Woodsman's link. So much good stuff there!

So on the strength of the 'better startx' page at humanreadable, I altered /usr/bin/startx so it sources .xprofile and presto! it works! Now I can tweak to my heart's content. :)

Thanks to all for the responses. I am at home recovering from surgery, and it is fun to get back to playing ...

- G

chexmix 02-27-2009 05:59 AM

Quote:

Originally Posted by chexmix (Post 3457106)
I altered /usr/bin/startx so it sources .xprofile and presto! it works!

Well, it sort of works. I noticed neither xscreensaver nor xclock was starting up. I captured stderr from startx and found this:

xscreensaver: 06:40:23: warning: $DISPLAY is not set: defaulting to ":0.0".
xscreensaver: 06:40:23: Can't open display: :0.0
xscreensaver: 06:40:23: initial effective uid/gid was chexmix/shadow (1000/43)
xscreensaver: 06:40:23: running as chexmix/users (1000/100)

xscreensaver: 06:40:23: Errors at startup are usually authorization problems.
But you're not logging in as root (good!) so something
else must be wrong. Did you read the manual and the FAQ?

http://www.jwz.org/xscreensaver/faq.html
http://www.jwz.org/xscreensaver/man.html

Conky: can't open display:
Error: Can't open display:
xauth: creating new authority file /home/chexmix/.serverauth.3212


... which makes sense - it seems xscreensaver is trying to start up TOO SOON, e.g. before there is a display for it to start on. Am going to play with the placement of the lines in /usr/bin/startx where .xprofile gets sourced and see if that helps.

GB

Woodsman 02-27-2009 03:02 PM

Quote:

I noticed neither xscreensaver nor xclock was starting up.
Perhaps starting those apps from within xinitrc would be better? Take a look at /etc/X11/xinit/xinitrc.twm and xinitrc.xfce for examples.


All times are GMT -5. The time now is 07:44 AM.