From a6943aa3f3394a8bee310770f0d10a8849ca5c05 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 28 Sep 2007 13:39:46 +0200 Subject: [PATCH] add uicb_exec --- config.c | 1 + util.c | 15 +++++++++++++++ util.h | 1 + 3 files changed, 17 insertions(+) diff --git a/config.c b/config.c index 18c5de39..a74a9af3 100644 --- a/config.c +++ b/config.c @@ -84,6 +84,7 @@ static const NameFuncLink LayoutsList[] = static const NameFuncLink KeyfuncList[] = { /* util.c */ {"spawn", uicb_spawn}, + {"exec", uicb_exec}, /* client.c */ {"killclient", uicb_killclient}, {"moveresize", uicb_moveresize}, diff --git a/util.c b/util.c index 3fbe0b13..c39c74b2 100644 --- a/util.c +++ b/util.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,20 @@ eprint(const char *fmt, ...) exit(EXIT_FAILURE); } +void +uicb_exec(Display * disp, + DC *drawcontext __attribute__ ((unused)), + awesome_config * awesomeconf __attribute__ ((unused)), + const char *arg) +{ + char path[_POSIX_PATH_MAX]; + if(disp) + close(ConnectionNumber(disp)); + + sscanf(arg, "%s", path); + execlp(path, arg, NULL); +} + void uicb_spawn(Display * disp, DC *drawcontext __attribute__ ((unused)), diff --git a/util.h b/util.h index d902a7b2..3bd5fce9 100644 --- a/util.h +++ b/util.h @@ -197,4 +197,5 @@ Bool xgettextprop(Display *, Window, Atom, char *, ssize_t); double compute_new_value_from_arg(const char *, double); UICB_PROTO(uicb_spawn); +UICB_PROTO(uicb_exec); #endif