LinuxQuestions.org
Review your favorite Linux distribution.
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 02-24-2009, 02:20 PM   #1
chexmix
Member
 
Registered: Apr 2002
Location: Arlington, MA
Distribution: Slackware, Debian, OpenBSD
Posts: 250
Blog Entries: 16

Rep: Reputation: 25
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
 
Old 02-24-2009, 02:29 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

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

Eric
 
Old 02-24-2009, 02:31 PM   #3
chexmix
Member
 
Registered: Apr 2002
Location: Arlington, MA
Distribution: Slackware, Debian, OpenBSD
Posts: 250

Original Poster
Blog Entries: 16

Rep: Reputation: 25
Quote:
Originally Posted by Alien Bob View Post
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?
 
Old 02-24-2009, 03:48 PM   #4
alkos333
Member
 
Registered: Dec 2006
Posts: 271

Rep: Reputation: 31
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.
 
Old 02-24-2009, 03:57 PM   #5
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
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.

Last edited by mRgOBLIN; 02-24-2009 at 04:02 PM.
 
Old 02-24-2009, 04:29 PM   #6
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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
 
1 members found this post helpful.
Old 02-24-2009, 04:56 PM   #7
chexmix
Member
 
Registered: Apr 2002
Location: Arlington, MA
Distribution: Slackware, Debian, OpenBSD
Posts: 250

Original Poster
Blog Entries: 16

Rep: Reputation: 25
Quote:
Originally Posted by mRgOBLIN View Post
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!

Last edited by chexmix; 02-24-2009 at 05:00 PM. Reason: added note re: Woodsman's link
 
Old 02-25-2009, 10:31 AM   #8
chexmix
Member
 
Registered: Apr 2002
Location: Arlington, MA
Distribution: Slackware, Debian, OpenBSD
Posts: 250

Original Poster
Blog Entries: 16

Rep: Reputation: 25
Quote:
Originally Posted by chexmix View Post

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
 
Old 02-27-2009, 05:59 AM   #9
chexmix
Member
 
Registered: Apr 2002
Location: Arlington, MA
Distribution: Slackware, Debian, OpenBSD
Posts: 250

Original Poster
Blog Entries: 16

Rep: Reputation: 25
Quote:
Originally Posted by chexmix View Post
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
 
Old 02-27-2009, 03:02 PM   #10
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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.
 
  


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
can't make ethernet on laptop work, wireless and usb work fine ubuntu 8.10 rz1988 Linux - Newbie 10 01-13-2009 02:21 PM
Getting a touch screen to work, must get PCI serial device to work first sternocera Linux - Hardware 2 10-03-2008 06:23 AM
Does any in this forum have been hire to work with LINUX without work experience? latinmusic74 Linux - Enterprise 20 07-29-2008 10:43 PM
I have AD authentication work, how do i make SSH PAM work in RHEL4? epmd Red Hat 0 09-19-2007 06:04 PM
FALCONS EYE (nethack) FAILS ON STARTUP, use to work, wont work even after reinstall roorings Linux - Software 0 10-08-2003 10:39 PM

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

All times are GMT -5. The time now is 07:31 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