Logo Search packages:      
Sourcecode: aewm++ version File versions  Download package

main.cc

/* 
 * frankhale@gmail.com
 * http://frankhale.org
 *
 * This code is released under the GPL license www.gnu.org
 */
 #include "aewm.hh"

// Dunno where I ripped this from. Kudos to the author whoever he is!
void forkExec(char *cmd)
{
    if(! (strlen(cmd)>0)) return;
    
    pid_t pid = fork();

    switch (pid) {
        case 0:
            execlp("/bin/sh", "sh", "-c", cmd, NULL);
          cerr << "exec failed, cleaning up child" << endl;
            exit(1);
        case -1:
          cerr << "can't fork" << endl;
    }
}

int handleXError(Display *dpy, XErrorEvent *e)
{
    if (e->error_code == BadAccess && e->resourceid == RootWindow(dpy, DefaultScreen(dpy)) ) {
      cerr << "root window unavailable (maybe another wm is running?)" << endl;
        exit(1);
    }
   
    return 0;
}

int main(int argc, char **argv)
{
      WindowManager aewm(argc, argv);
      return 0;
}

Generated by  Doxygen 1.6.0   Back to index