#include #include #include /* To use this, make a file called 'xscript' in your path, and stick in it things you would ordinarily put in your xinitrc. */ int main() { pid_t wm_pid; pid_t ppid = getpid(); wm_pid = fork(); if(getpid() != ppid) { /* Child Code here */ execlp("wmaker","wmaker",NULL) || printf("Could not run windowmaker\n"); exit(); } printf("Moo Moo Moo \n%d\n",wm_pid); sleep(3); if(fork() == 0) { execlp("xscript","xscript",NULL) || printf("Could not run xscript\n"); exit(); } waitpid(wm_pid,NULL,0); }