riow: add mod4+shift+q (delete current window)

This commit is contained in:
Sigrid Solveig Haflínudóttir 2023-05-12 16:42:40 +00:00
parent 970710ce92
commit cc7a274d01
2 changed files with 19 additions and 0 deletions

View file

@ -66,6 +66,9 @@ option.
Spawn a new
.IR window (1).
.TP
.B Kmod4+shift+q
Delete the current window.
.TP
.B Kmod4+h/j/k/l
Focus left/down/up/right.
.TP

View file

@ -261,6 +261,18 @@ arrowaction(int x, int y)
close(f);
}
static void
delete(void)
{
int f;
wsupdate();
if(wcur == nil || (f = wwctl(wcur->id, OWRITE)) < 0)
return;
fprint(f, "delete");
close(f);
}
static struct {
int x, y;
}cyclectx;
@ -356,6 +368,10 @@ keyevent(char c, Rune r)
cycleaction(0, -1);
return 0;
}
if(r == 'Q' && mod == (Mmod4|Mshift)){
delete();
return 0;
}
if(r >= '0' && r <= '9' && (mod & Mctl) == 0){
vdaction(r - '0');
return 0;