patch: open-selected
This commit is contained in:
16
x.c
16
x.c
@@ -5,6 +5,7 @@
|
||||
#include <locale.h>
|
||||
#include <signal.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <libgen.h>
|
||||
@@ -56,6 +57,7 @@ static void clipcopy(const Arg *);
|
||||
static void clippaste(const Arg *);
|
||||
static void numlock(const Arg *);
|
||||
static void selpaste(const Arg *);
|
||||
static void selopen(const Arg *);
|
||||
static void zoom(const Arg *);
|
||||
static void zoomabs(const Arg *);
|
||||
static void zoomreset(const Arg *);
|
||||
@@ -289,6 +291,20 @@ selpaste(const Arg *dummy)
|
||||
xw.win, CurrentTime);
|
||||
}
|
||||
|
||||
void
|
||||
selopen(const Arg *dummy)
|
||||
{
|
||||
pid_t chpid;
|
||||
|
||||
if ((chpid = fork()) == 0) {
|
||||
if (fork() == 0)
|
||||
execlp("xdg-open", "xdg-open", getsel(), NULL);
|
||||
exit(1);
|
||||
}
|
||||
if (chpid > 0)
|
||||
waitpid(chpid, NULL, 0);
|
||||
}
|
||||
|
||||
void
|
||||
numlock(const Arg *dummy)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user