add uicb_exec
This commit is contained in:
parent
659adaab5e
commit
a6943aa3f3
1
config.c
1
config.c
|
@ -84,6 +84,7 @@ static const NameFuncLink LayoutsList[] =
|
||||||
static const NameFuncLink KeyfuncList[] = {
|
static const NameFuncLink KeyfuncList[] = {
|
||||||
/* util.c */
|
/* util.c */
|
||||||
{"spawn", uicb_spawn},
|
{"spawn", uicb_spawn},
|
||||||
|
{"exec", uicb_exec},
|
||||||
/* client.c */
|
/* client.c */
|
||||||
{"killclient", uicb_killclient},
|
{"killclient", uicb_killclient},
|
||||||
{"moveresize", uicb_moveresize},
|
{"moveresize", uicb_moveresize},
|
||||||
|
|
15
util.c
15
util.c
|
@ -24,6 +24,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <bits/posix1_lim.h>
|
||||||
|
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
@ -53,6 +54,20 @@ eprint(const char *fmt, ...)
|
||||||
exit(EXIT_FAILURE);
|
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
|
void
|
||||||
uicb_spawn(Display * disp,
|
uicb_spawn(Display * disp,
|
||||||
DC *drawcontext __attribute__ ((unused)),
|
DC *drawcontext __attribute__ ((unused)),
|
||||||
|
|
Loading…
Reference in New Issue