Add the -f flag, which tells tabbed to run the given command again, in case
the last tab is closed.
This commit is contained in:
parent
cc1b72371a
commit
5e1c53ad3c
4
tabbed.1
4
tabbed.1
@ -24,6 +24,10 @@ tabbed will just print its xid and run no command.
|
||||
.B \-d
|
||||
detaches tabbed from the terminal and prints its XID to stdout.
|
||||
.TP
|
||||
.B \-f
|
||||
fill up tabbed again by spawning the provided command, when the last tab is
|
||||
closed.
|
||||
.TP
|
||||
.B \-h
|
||||
will print the usage of tabbed.
|
||||
.TP
|
||||
|
16
tabbed.c
16
tabbed.c
@ -145,7 +145,7 @@ static void (*handler[LASTEvent]) (const XEvent *) = {
|
||||
};
|
||||
static int bh, wx, wy, ww, wh;
|
||||
static unsigned int numlockmask = 0;
|
||||
static Bool running = True, nextfocus, doinitspawn = True;
|
||||
static Bool running = True, nextfocus, doinitspawn = True, fillagain = False;
|
||||
static Display *dpy;
|
||||
static DC dc;
|
||||
static Atom wmatom[WMLast];
|
||||
@ -954,6 +954,11 @@ unmanage(int c) {
|
||||
focus(lastsel);
|
||||
}
|
||||
|
||||
if(nclients == 0) {
|
||||
if(fillagain)
|
||||
spawn(NULL);
|
||||
}
|
||||
|
||||
drawbar();
|
||||
XSync(dpy, False);
|
||||
}
|
||||
@ -1023,7 +1028,7 @@ char *argv0;
|
||||
|
||||
void
|
||||
usage(void) {
|
||||
die("usage: %s [-dhsv] [-n name] [-r narg] command...\n", argv0);
|
||||
die("usage: %s [-dfhsv] [-n name] [-r narg] command...\n", argv0);
|
||||
}
|
||||
|
||||
int
|
||||
@ -1034,6 +1039,9 @@ main(int argc, char *argv[]) {
|
||||
case 'd':
|
||||
detach = 1;
|
||||
break;
|
||||
case 'f':
|
||||
fillagain = 1;
|
||||
break;
|
||||
case 'n':
|
||||
wmname = EARGF(usage());
|
||||
break;
|
||||
@ -1052,8 +1060,10 @@ main(int argc, char *argv[]) {
|
||||
usage();
|
||||
} ARGEND;
|
||||
|
||||
if(argc < 1)
|
||||
if(argc < 1) {
|
||||
doinitspawn = False;
|
||||
fillagain = False;
|
||||
}
|
||||
|
||||
setcmd(argc, argv, replace);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user