about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* Ensure which-function-mode is turned onDavid Morgan2023-01-171-2/+1
|
* Fix occasional aggressive-indent issueDavid Morgan2023-01-171-1/+1
|
* Add htopDavid Morgan2023-01-161-0/+1
|
* Use non-modo themeDavid Morgan2023-01-162-79/+1931
|
* Only use nvm on darwinDavid Morgan2023-01-131-2/+6
|
* Make mopidy extensions workDavid Morgan2023-01-121-7/+25
|
* Improve zsh variable configDavid Morgan2023-01-121-5/+6
|
* Add zsh-nvm and per-directory-historyDavid Morgan2023-01-121-0/+26
|
* Add pmsDavid Morgan2023-01-121-0/+1
|
* Add checkout-pr functionDavid Morgan2023-01-121-0/+5
|
* Add tmux-fuzzback pluginDavid Morgan2023-01-121-0/+1
|
* Improve elisp and clojure diffsDavid Morgan2023-01-121-0/+6
|
* Add ea and some aliasesDavid Morgan2023-01-122-0/+5
|
* Use gnome keyring without gnome (plus pipewire)David Morgan2023-01-061-4/+15
|
* Use sasl for refchatDavid Morgan2023-01-061-0/+1
|
* Add editorconfig-vim pluginDavid Morgan2023-01-061-0/+1
|
* Use avy-style keys for ace-window, and add always dispatch versionDavid Morgan2023-01-061-1/+9
|
* Add sp-{beginning,end}-of-sexp bindingsDavid Morgan2023-01-051-0/+2
|
* Update straight lockfileDavid Morgan2022-12-291-48/+47
|
* Improve avy configDavid Morgan2022-12-261-0/+4
|
* fzf functionsDavid Morgan2022-12-151-1/+20
|
* Don't automatically enable aggressive-indent-mode in clojure-modeDavid Morgan2022-12-151-2/+1
|
* Add mpd and mopidy packages on darwinDavid Morgan2022-12-151-0/+11
|
* Add nixpkgs-reviewDavid Morgan2022-12-151-0/+1
|
* Add avy-copy-as-kill functionsDavid Morgan2022-12-081-1/+15
|
* Add tmux-copy-toolkitDavid Morgan2022-12-081-1/+1
|
* Add irssi window aliasesDavid Morgan2022-12-081-13/+34
|
* Add vimPlugins.vim-nixDavid Morgan2022-12-061-0/+1
|
* nix.trustedUsers -> nix.settings.trusted-usersDavid Morgan2022-12-063-3/+3
|
* Fix hook nameDavid Morgan2022-12-051-1/+1
|
* Make cider completion work with corfuDavid Morgan2022-12-051-0/+14
|
* Disable nrepl-log-messagesDavid Morgan2022-12-051-1/+1
|
* Add function to load debugging toolsDavid Morgan2022-12-051-0/+7
|
* irssi configDavid Morgan2022-12-052-1/+22
|
* Use new packages for forgit and zsh-editDavid Morgan2022-12-051-15/+5
|
* Improve tmux configDavid Morgan2022-12-031-14/+23
|
* Use batpipeDavid Morgan2022-12-032-1/+2
|
* Add FZF_DEFAULT_OPTSDavid Morgan2022-12-031-0/+1
|
* Force seahorse for ssh ask-passDavid Morgan2022-12-031-1/+1
|
* Swap two and three finger tapDavid Morgan2022-12-031-1/+1
|
* Tidy upDavid Morgan2022-12-021-14/+0
|
* Add tmux-jump pluginDavid Morgan2022-12-021-1/+1
|
* Add libinput tappingButtonMapDavid Morgan2022-12-021-2/+1
|
* Remove unstable channelDavid Morgan2022-12-021-4/+1
|
* Add some fzf functionsDavid Morgan2022-12-021-0/+9
|
* Improve fzf optionsDavid Morgan2022-12-021-1/+3
|
* Add tre (plus tree alias)David Morgan2022-12-022-0/+4
|
* Fix tramp + zshDavid Morgan2022-12-022-0/+4
|
* Add zz alias (like z.lua)David Morgan2022-12-021-0/+2
|
* Add zsh-bsd pluginDavid Morgan2022-12-021-0/+5
|
#0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 * (C)opyright MMVI 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>

/* static */

static void
bad_malloc(unsigned int size)
{
	eprint("fatal: could not malloc() %u bytes\n", size);
}

/* extern */

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

	if(!res)
		bad_malloc(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(Arg *arg)
{
	static char *shell = NULL;

	if(!shell && !(shell = getenv("SHELL")))
		shell = "/bin/sh";

	if(!arg->cmd)
		return;
	if(fork() == 0) {
		if(fork() == 0) {
			if(dpy)
				close(ConnectionNumber(dpy));
			setsid();
			execl(shell, shell, "-c", arg->cmd, NULL);
			fprintf(stderr, "dwm: execl '%s'", arg->cmd);
			perror(" failed");
		}
		exit(0);
	}
	wait(0);
}