On Wed, Jan 09, 2008 at 10:54:48AM +0100, Alessandro Dotti Contra wrote:
> Marc Andre Tanner wrote:
> > Hi,
> >
> > I have released dvtm-0.2, it no longer depends on librote instead it
> > includes madtty which has better terminal emulation support.
> > So you only need a curses library to build dvtm.
>
> Hi Marc and all,
>
> I just tried dvtm, and I think it is really really nice. For me, it is
> an evolution of screen with the layouts I need.
>
> I was wondering if it is possible to start some programs automatically.
> I use three different mcabber (a jabber client) instances at the same
> time, and I would like to run them as soon as dvtm starts - I know I can
> achieve more or less the same result with keybindings, and I will go for
> this solution if there is no other way to do what I like to.
See the attached patch for a possible implementation. You will need
current master which you can fetch from the url below than apply the
patch.
http://repo.or.cz/w/dvtm.git?a=snapshot;sf=tgz
Configure the action array to launch your apps. The problem is that after
a keystroke only the content of the selected window is shown.
I will have to take a closer look.
> Thanks, good work!
Thanks,
Marc
--
Marc Andre Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0
diff --git a/config.h b/config.h
index 5835eb3..9e89945 100644
--- a/config.h
+++ b/config.h
@@ -122,3 +122,10 @@ Button buttons[] = {
{ BUTTON1_TRIPLE_CLICKED, { mouse_zoom, { NULL } } },
{ BUTTON2_CLICKED, { mouse_minimize, { NULL } } },
};
+
+/* gets executed when dvtm is started */
+Action actions[] = {
+/* XXX: doesn't yet work, after the first keystroke only the
+ * selected window content is visible. */
+ { create, { SHELL } },
+};
diff --git a/dvtm.c b/dvtm.c
index 9cc4630..6e31feb 100644
--- a/dvtm.c
+++ b/dvtm.c
@@ -738,6 +738,13 @@ resize_screen(){
}
void
+startup(){
+ int i;
+ for(i = 0; i < countof(actions); i++)
+ actions[i].cmd(actions[i].args);
+}
+
+void
setup(){
int i;
mmask_t mask;
@@ -824,6 +831,7 @@ int
main(int argc, char *argv[]) {
parse_args(argc, argv);
setup();
+ startup();
while(running){
Client *c;
int r, nfds = 0;