Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
enlightenment DR16 startup script question
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
adsmith
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1386
Location: NC, USA

PostPosted: Wed Aug 10, 2005 5:09 pm    Post subject: enlightenment DR16 startup script question Reply with quote

I just playing with e16 here, after years of faithfully using WindowMaker. (I just got sick of WM's unmutable titlebar design)

Okay, so simple question (yes, I've googled!):

How to I run scripts at startup? Some things I can do from .xsession, but this isn't true for all programs, just things like xmodmap. Other things I can use the "Remember" tool, but that only works for specific windows.

I.e, What is the equivalent of WindowMaker's "~/GNUstep/Library/WindowMaker/autostart" ?



Thanks,
Back to top
View user's profile Send private message
boneyfrog
Apprentice
Apprentice


Joined: 26 Apr 2005
Posts: 152

PostPosted: Wed Aug 10, 2005 8:15 pm    Post subject: Reply with quote

the restart application on login radio button in the remember options submenu is the only way that i know of having programs start automagicly on login for 16.7 and prior the information about what is reloaded is read from the triple dot (...) file that has snapshots in its name i cant remmeber exactly what it is called right now, if you are using the CVS version of dr16 (16.8) it is in .e16/e_config--1.0.snapshots. if you are going to edit it make sure that enlightenment isnt running or things may get screwy next time you reboot.

just out of curiosity what programs are you looking at autoloading on startup?
Back to top
View user's profile Send private message
adsmith
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1386
Location: NC, USA

PostPosted: Wed Aug 10, 2005 8:21 pm    Post subject: Reply with quote

Okay, thanks.

Some things I've done before include messing with checking that mpd is running, starting some root-tail stuff for log watching, various ssh-agent manipulation, and conky.

conky I could do by running it in its own window, borderless, and Remembering it, but the others I'm not sure about.


hmm.. very hackish, but maybe I should just make a named xterm which forks all my scripts and closes itself, and Remeber it...
Back to top
View user's profile Send private message
kastorff
Apprentice
Apprentice


Joined: 19 May 2004
Posts: 183
Location: Atlanta, GA USA

PostPosted: Wed Aug 10, 2005 8:58 pm    Post subject: Reply with quote

There's a file that ends with .snapshots.0 (at least mine does) in your ~/.enlightenment directory. Add something similar to this at the end:
Code:
NEW: sessionstart
NAME: sessionstart
CMD: /home/username/.enlightenment/sessionstart
My sessionstart is an executable text file that looks like this:
Code:
#!/bin/bash
numlockx
rox --pinboard=Enlightenment &
trayer --edge top --align right --margin 75 --transparent true --alpha 255 --expand true --align right --widthtype request --heighttype request --distance 16 &
xscreensaver -no-splash &
tomboy &
gkrellm2 &
Of course you can put just about anything you want there. And there's nothing special about the name "sessionstart", you could use whatever you liked. And as noted above, I'd edit all this without Enlightenment DR16 running...
_________________
Keith Kastorff


Last edited by kastorff on Wed Aug 10, 2005 9:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
boneyfrog
Apprentice
Apprentice


Joined: 26 Apr 2005
Posts: 152

PostPosted: Wed Aug 10, 2005 9:00 pm    Post subject: Reply with quote

Quote:
hmm.. very hackish, but maybe I should just make a named xterm which forks all my scripts and closes itself, and Remeber it...

yea mattering to what all you said you needed i was going to suggest basicly the same thing, what i would do is set dr16 to remember and to restart a *term log out of enlightenment, log into console mode and edit the snapshots file adding "-e path/to/script, were script is a simple bash script calling the services and backgrounding them if need. That will have the *term open as long as the called script is running.
Back to top
View user's profile Send private message
adsmith
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1386
Location: NC, USA

PostPosted: Wed Aug 10, 2005 9:08 pm    Post subject: Reply with quote

Thanks kastorff!
Back to top
View user's profile Send private message
bluedevils
Apprentice
Apprentice


Joined: 21 Jul 2004
Posts: 252
Location: Vancouver BC -> NYC, NY

PostPosted: Wed Aug 10, 2005 9:18 pm    Post subject: Reply with quote

I'm confused. Why wouldn't you just start scripts in .xinitrc?
Back to top
View user's profile Send private message
adsmith
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1386
Location: NC, USA

PostPosted: Wed Aug 10, 2005 9:43 pm    Post subject: Reply with quote

bluedevils wrote:
I'm confused. Why wouldn't you just start scripts in .xinitrc?


Well, because it doesn't work, for a couple reasons.

First, I am running gdm, so (as I understand it) xinitrc is relatively meaningless, and I'd use xsession. I might be wrong about this -- I haven't traced out the mad tangle of scripts to start scripts to start X in a couple years.

Second and more importantly, the windowmanager has to be last in that xinit/xsession script and it cannot be forked to background, because wm closing ends the X session. Therefore, things which I want to run "after" the wm or as its child cannot be done through xinit/xsession.

please correct me if I'm wring about this, since it would make my life easier!!
Back to top
View user's profile Send private message
bluedevils
Apprentice
Apprentice


Joined: 21 Jul 2004
Posts: 252
Location: Vancouver BC -> NYC, NY

PostPosted: Thu Aug 11, 2005 8:54 pm    Post subject: Reply with quote

I found this: http://66.102.7.104/search?q=cache:8wF4ywK0k-sJ:fluxbox.sourceforge.net/docbook/cs/html/app-setup.html+xinitrc+xsession+start+programs&hl=en&client=firefox-a

Appendix A. Setting up .xinitrc/.xsession

Contributed by Verin.
The place of xinit in things

A window manager is just one more application for X11, like netscape or gimp or xterm. Many people new to X11 come to believe that X11 runs the window manager and the window manager runs programs. But that's not true. If configured right, you can run all your applications under X11, kill the window manager, and start another window manager up.

The real program that X11 runs, that runs other programs, is your .xinitrc or .xsession script. When X11 is started, your .xinitrc or .xsession script is run, and when the script is done, X11 comes down. Let me repeat that, its important: when .xinitrc is finished, that is when X ends. It isn't when your window manager exits.
Script layout

Well, first realize something you already know. When you type a command in a shell, you can't do anything else until that command is done, when it exits. Your .xinitrc or .xsession script is just the same. When it starts going through it, if it hits any program that takes a long time to run (like most X11 programs), it stops right there until that program is finished.

Ideally, you should only have one place where the script 'hangs'. And usually you want this to be at the end. So, if you have any programs you want to run under X11 before you get to this 'hang' spot, you should background them. You put an & at the end of the line. So, say you want xclock to run in addition to other things, put this line before your 'hang' spot:

xclock &

Now, the next thing is the exec thing you see, where lots of sources recommend how to add your window manager to your script. But honestly, its not really necessary, if you put your window manager on the last line of your script, it will hang there just fine without the exec.

So why the exec? Well, lets say you want to put lots of window manager start lines in your script, and you want only one to work. Well, with exec you can put your chosen start-line at the top. Because this is what exec means:

"Replace myself with this program, i.e. start it and terminate myself immediately when it finishes. "

So if you put an exec wmaker line atop of a exec enlightenment line, when wmaker is done, so is the script, it never gets to the next line.

See what I mean by being unnecessary? You could just put a bunch of commented-out window manager lines, and it would work just the same.
Another way to do things

Quote:
As an alternative, you could start up your window manager first, and store the process ID in a environment variable:

wmaker & wmpid=$!

that puts it in the background (&) and puts the process id ($!) in a variable (wmpid). Then, to make your hang point, you can wait:

wait $wmpid

or you could hang on a program you always want to use, like maybe gkrellm, by just not backgrounding it. But remember that as soon as you terminate it, so will your X11 session.

Now, I use the wait method, because I like picking my window manager before I launch my dockapps and stuff. Also, before doing anything else, I like to change the settings on my X11 server, like the dpms, the screen saver, and even add some directories to my font path (fonts I don't want to install universally). And then after everything is done, I like to clean up my fontpath, mainly because if I ran a display manager, its not good at resetting the font path all the time.


Example A-1. .xinitrc

# turn off screen blanking and turn on energy star features
xset s off
xset dpms 600 60 60

# add my optional fonts to the font path
xset +fp "$X_FONTPATH"
xset fp rehash

# export the current environment, in case it needs to be debugged
env > ~/.xenv

# window manager
fluxbox & wmpid=$!

bbrun &
wmCalClock &
wmxmms &

# HANG POINT - wait for window manager to exit
wait $wmpid

# restore the x fontpath
xset fp default


Last edited by bluedevils on Thu Aug 11, 2005 8:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
adsmith
Veteran
Veteran


Joined: 26 Sep 2004
Posts: 1386
Location: NC, USA

PostPosted: Thu Aug 11, 2005 8:57 pm    Post subject: Reply with quote

clever -- I do a lot of bash scripting, but I forgot about "wait" in this context ... cool, I'll try it
Back to top
View user's profile Send private message
bytenirvana
Apprentice
Apprentice


Joined: 10 Jun 2006
Posts: 218
Location: Volksstaat Hessen

PostPosted: Mon Jul 31, 2006 8:20 am    Post subject: Reply with quote

kastorff wrote:
There's a file that ends with .snapshots.0 (at least mine does) in your ~/.enlightenment directory. Add something similar to this at the end:
Code:
NEW: sessionstart
NAME: sessionstart
CMD: /home/username/.enlightenment/sessionstart
My sessionstart is an executable text file that looks like this:
Code:
#!/bin/bash
numlockx
rox --pinboard=Enlightenment &
trayer --edge top --align right --margin 75 --transparent true --alpha 255 --expand true --align right --widthtype request --heighttype request --distance 16 &
xscreensaver -no-splash &
tomboy &
gkrellm2 &
Of course you can put just about anything you want there. And there's nothing special about the name "sessionstart", you could use whatever you liked. And as noted above, I'd edit all this without Enlightenment DR16 running...


after I failed with .xinitrc I tried your approach:
Code:

.e16/sessionstart:

#!/bin/bash
conky -x 900 -y 10 -u 3 -b &



.e16/e_config--0.0.snapshots:
(...)
NEW: sessionstart
NAME: sessionstart
CMD: /root/.e16/sessionstart
(...)



but after each login I get only a window with a message like "there is a error in this program..." (or something like this) with the path to the sessionstart file.
Back to top
View user's profile Send private message
kastorff
Apprentice
Apprentice


Joined: 19 May 2004
Posts: 183
Location: Atlanta, GA USA

PostPosted: Mon Jul 31, 2006 12:21 pm    Post subject: Reply with quote

bytenirvana wrote:
after I failed with .xinitrc I tried your approach:
Code:

.e16/sessionstart:

#!/bin/bash
conky -x 900 -y 10 -u 3 -b &



.e16/e_config--0.0.snapshots:
(...)
NEW: sessionstart
NAME: sessionstart
CMD: /root/.e16/sessionstart
(...)



but after each login I get only a window with a message like "there is a error in this program..." (or something like this) with the path to the sessionstart file.

You're putting the script in the root user's home directory? I hope you aren't logging in as root. Put it in the user's home directory (/home/username/somewhere/sessionstart). I know nothing about conky, so there could be errors in the line you have there, if you are logging in as root. Also be sure sessionstart is executable.
_________________
Keith Kastorff
Back to top
View user's profile Send private message
bytenirvana
Apprentice
Apprentice


Joined: 10 Jun 2006
Posts: 218
Location: Volksstaat Hessen

PostPosted: Mon Jul 31, 2006 9:46 pm    Post subject: Reply with quote

kastorff wrote:

You're putting the script in the root user's home directory? I hope you aren't logging in as root. Put it in the user's home directory (/home/username/somewhere/sessionstart). I know nothing about conky, so there could be errors in the line you have there, if you are logging in as root. Also be sure sessionstart is executable.


yes. I'm logged in as root the whole time. I can't emerge programs as normal user (yet). the conky line is perfectly right, it worked in fluxbox and it works from the cli.

how can I make the file executable?
Back to top
View user's profile Send private message
kastorff
Apprentice
Apprentice


Joined: 19 May 2004
Posts: 183
Location: Atlanta, GA USA

PostPosted: Mon Jul 31, 2006 10:10 pm    Post subject: Reply with quote

bytenirvana wrote:
yes. I'm logged in as root the whole time. I can't emerge programs as normal user (yet). the conky line is perfectly right, it worked in fluxbox and it works from the cli.

how can I make the file executable?

Right-click, and check the permissions...execute is one of them.

It's a bad idea to run the machine as root. Just su to root from a normal user account when you need to run portage.
_________________
Keith Kastorff
Back to top
View user's profile Send private message
bytenirvana
Apprentice
Apprentice


Joined: 10 Jun 2006
Posts: 218
Location: Volksstaat Hessen

PostPosted: Wed Aug 02, 2006 12:40 pm    Post subject: Reply with quote

yes - I changed it now and it works.

curiously after a restart conky changes the desktop. can I tell it somehow on which desktop it has to appear?
Back to top
View user's profile Send private message
kastorff
Apprentice
Apprentice


Joined: 19 May 2004
Posts: 183
Location: Atlanta, GA USA

PostPosted: Wed Aug 02, 2006 1:01 pm    Post subject: Reply with quote

bytenirvana wrote:
yes - I changed it now and it works.

curiously after a restart conky changes the desktop. can I tell it somehow on which desktop it has to appear?

Not sure about conky...seems like i had to make gKrellm show a standard window border to set the option in e16, and then I could turn it off and it would work. I'm in KDE at the moment, so I can't look for the precise option in e16, but play around with the menus...it's there. I think it's the center-click menu...
_________________
Keith Kastorff
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum