[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RP] load frames and xterms on startup
From: |
Oleg Katsitadze |
Subject: |
Re: [RP] load frames and xterms on startup |
Date: |
Thu, 1 Nov 2007 12:49:02 +0200 |
User-agent: |
Mutt/1.5.16 (2007-06-11) |
On Thu, Nov 01, 2007 at 10:03:55AM +0100, Christian Kieft wrote:
> I cannot figure out how to load apps into my frames on startup.
Well, that's not easy, at least I haven't found an elegant way of
doing it. Of course, if anybody knows a better way of doing
something, tips are more than welcome. This is what I do:
My .xinitrc looks something like:
------------------------------>%------------------------------
ratpoison&
rppid=$!
sleep 2 # Wait until ratpoison starts up. Might need to be
# adjusted. Without this delay, (some of) the apps
# I run below won't start up.
[Any shell command you like]
wait $rppid
------------------------------%<------------------------------
Now, in the `[Any shell command you like]' section I do something like
the following:
------------------------------>%------------------------------
# Start all apps.
app1&
app2&
...
# Wait until ratpoison catches all apps (set LOG to a log file --
# useful during debugging).
for app in app1 app2 ...; do
while ! { ratpoison -c windows | grep '[-*+]'$app'$' > /dev/null 2>&1; }; do
echo "Waiting for app $app to start up..." >> $LOG
sleep 1;
done
done
# Restore the frameset from a dump. Create `~/.ratpoison/frames' with
# ratpoison's command "fdump", after manually creating and resizing
# the frames the way you like.
ratpoison -c "frestore `cat ~/.ratpoison/frames`"
# Empty all frames (NUM_FRAMES should be set to the number of frames).
for i in `seq 0 $((NUM_FRAMES - 1))`; do
ratpoison -c "fselect $((i++))" -c "select -" > /dev/null
done
# Assign each app to its frame.
i=0
for app in app1 app2 ...; do
ratpoison -c "fselect $((i++))" -c "select $app" > /dev/null
done
------------------------------%<------------------------------
The above is just an outline of the actual script. The actual script
is much more complicated, because I'm creating several workspaces,
each with a dock and dockapps. The script is (I think) too hairy and
ad-hoc to be useful for somebody else, but if anybody is interested I
can post it (actually "them" -- there are several scripts involved).
Final note -- I do the setup in .xinitrc and not in .ratpoisonrc so
that I have access to the programming facilities of the shell. But
for a simple setup it might make sense to do everything from
.ratpoisonrc.
HTH,
Oleg