Hi all,
A while back I asked how to start console apps automatically
in a certain konsole session.
I just want share the little script I wrote last night: it
launches the atop utility in an existing session named "Atop".
Might be the general idea behind is useful for somebody out
there. That's why I've put a few more comments in it ...
Rgds,
Stephan.
-------------- snip here -----------------------------------------------
#!/bin/sh
###
### Script to start certain apps in konsole sessions automatically.
###
### Requires the "dcop" utility to be installed and the konsoles must
### be started with the "--script" option to enable extended features
### like sendSession. The sessions must exist already.
###
### Here we go ...
### Looking for all konsoles.
for i in `dcop konsole\*` ; do
### Checking if the "sendSession" feature available.
if [ `dcop $i session-1 functions | grep sendSession | wc -l` -eq 1 ] ; then
### sendSession available, continue.
### Looking for all sessions.
for j in `dcop $i | grep session-` ; do
### What's the name ?
NAME=`dcop $i $j sessionName`
### If the name matches a predefined session name, launch
### the desired application.
if [ "$NAME" = "Atop" ] ; then
dcop $i $j sendSession "atop"
fi
# if [ "$NAME" = ...
# add here more names and commands.
# fi
done
else
### sendSession not available.
echo "Konsole $i not started with the \"--script\" option".
fi
done
exit 0
-------------- snip here -----------------------------------------------
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]