about summary refs log tree commit diff stats
Commit message (Expand)AuthorAgeFilesLines
...
* added viewall to mainstream (only Ross Mohns version, not the toggle)Anselm R. Garbe2006-08-315-0/+17
* implemented Button2 press on tags for toggletag on the focused clientAnselm R. Garbe2006-08-312-2/+15
* applied sanders patch to remove unnecessary commit()Anselm R. Garbe2006-08-313-16/+9
* small fix in config.arg.hAnselm R. Garbe2006-08-301-3/+3
* Added tag 1.2 for changeset e3179ce2b90451d2807cd53b589d768412b8666bAnselm R. Garbe2006-08-301-0/+1
* prepared 1.2 1.2Anselm R. Garbe2006-08-301-1/+1
* now using Salmi's menu commandAnselm R. Garbe2006-08-301-2/+3
* removed a warning reported by JukkaAnselm R. Garbe2006-08-301-1/+0
* simplified configurerequestAnselm R. Garbe2006-08-291-25/+22
* now dwm enforces max screen size also in tiled mode on non-floating clients w...Anselm R. Garbe2006-08-291-13/+14
* fixedAnselm R. Garbe2006-08-291-1/+3
* configurenotify remembers max geom now, and restores this if necessary, howev...Anselm R. Garbe2006-08-292-4/+14
* applied patch similiar proposed by dave tweedAnselm R. Garbe2006-08-291-10/+13
* improved selection policyAnselm R. Garbe2006-08-291-20/+24
* still something wrong with reorder()Anselm R. Garbe2006-08-294-56/+33
* this algorithm seems to keep order for any scenarioAnselm R. Garbe2006-08-291-14/+41
* fix client position in list also on tag and toggletagAnselm R. Garbe2006-08-291-0/+4
* added attach/detach functions which don't attach at the begin of list, but at...Anselm R. Garbe2006-08-293-29/+52
* removed crappy variablesAnselm R. Garbe2006-08-283-5/+5
* changed config.arg.h - I really need the 4th tagAnselm R. Garbe2006-08-282-2/+2
* updated html pageAnselm R. Garbe2006-08-281-2/+2
* Added tag 1.1 for changeset 44a55e6e46bf6c231780b09d919977d6f01083deAnselm R. Garbe2006-08-281-0/+1
* added a comment to spawn 1.1Anselm R. Garbe2006-08-281-0/+1
* applied sanders focus_ patchesAnselm R. Garbe2006-08-282-26/+49
* applied sanders somepatches.patchAnselm R. Garbe2006-08-284-8/+16
* oh frking dear big font...Anselm R. Garbe2006-08-251-1/+1
* term enlightenedAnselm R. Garbe2006-08-251-1/+1
* switching to darker colorscheme with larger fontAnselm R. Garbe2006-08-251-7/+7
* patched arg.hAnselm R. Garbe2006-08-251-1/+1
* new stuffAnselm R. Garbe2006-08-251-1/+1
* switching to dark colors againAnselm R. Garbe2006-08-251-6/+6
* updated man page of dwmAnselm R. Garbe2006-08-251-3/+3
* changed order of optionsAnselm R. Garbe2006-08-252-4/+4
* trying a different configurationAnselm R. Garbe2006-08-255-23/+24
* removed small 1px gap, somehow without it things feel betterAnselm R. Garbe2006-08-251-1/+1
* oopsAnselm R. Garbe2006-08-251-1/+1
* fixed typoAnselm R. Garbe2006-08-252-2/+2
* s/TILED/TILE/gAnselm R. Garbe2006-08-253-3/+3
* removed a bunch of lines, made mode symbols configurableAnselm R. Garbe2006-08-254-8/+7
* changed symbols for float/tiled mode, added mouse-driven mode toggle to butto...Anselm R. Garbe2006-08-252-11/+13
* small fix to separate client title from right-most tagAnselm R. Garbe2006-08-251-2/+2
* restored config.arg.hAnselm R. Garbe2006-08-251-16/+12
* new color stuff/new rendering stuffAnselm R. Garbe2006-08-256-58/+70
* back to 3 colorsAnselm R. Garbe2006-08-255-38/+35
* fixedAnselm R. Garbe2006-08-241-6/+6
* 3->4 colorsAnselm R. Garbe2006-08-246-26/+22
* Added tag 1.0 for changeset bbc98e77ae89a7c9232a5be0835f60ea00d8036eAnselm R. Garbe2006-08-241-0/+1
* prepared dwm-1.0 1.0Anselm R. Garbe2006-08-241-2/+2
* yet another fixAnselm R. Garbe2006-08-241-1/+1
* small man page fixAnselm R. Garbe2006-08-241-1/+2
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
                                                                    

                                        
                


                   


                     
            
 
      
                             
                                    
 
                
                                                                     


                   
    
                                 
                   
 


                                     
                           


    
                        
                                  
 

                                                
                
                       

                                                                               



                                                             
                                 

                                                                             

                                          
                        


                
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
 * See LICENSE file for license details.
 */
#include "dwm.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>

/* extern */

void *
emallocz(unsigned int size) {
	void *res = calloc(1, size);

	if(!res)
		eprint("fatal: could not malloc() %u bytes\n", size);
	return res;
}

void
eprint(const char *errstr, ...) {
	va_list ap;

	va_start(ap, errstr);
	vfprintf(stderr, errstr, ap);
	va_end(ap);
	exit(EXIT_FAILURE);
}

void
spawn(const char *arg) {
	static char *shell = NULL;

	if(!shell && !(shell = getenv("SHELL")))
		shell = "/bin/sh";
	if(!arg)
		return;
	/* The double-fork construct avoids zombie processes and keeps the code
	 * clean from stupid signal handlers. */
	if(fork() == 0) {
		if(fork() == 0) {
			if(dpy)
				close(ConnectionNumber(dpy));
			setsid();
			execl(shell, shell, "-c", arg, (char *)NULL);
			fprintf(stderr, "dwm: execl '%s -c %s'", shell, arg);
			perror(" failed");
		}
		exit(0);
	}
	wait(0);
}