diff options
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/screen.c b/screen.c index 5907ba7..8abe3d7 100644 --- a/screen.c +++ b/screen.c @@ -191,6 +191,28 @@ restack(void) { } void +setlayout(Arg *arg) { + unsigned int i; + + if(arg->i == -1) { + for(i = 0; i < nlayouts && lt != &layout[i]; i++); + if(i == nlayouts - 1) + lt = &layout[0]; + else + lt = &layout[++i]; + } + else { + if(arg->i < 0 || arg->i >= nlayouts) + return; + lt = &layout[arg->i]; + } + if(sel) + lt->arrange(); + else + drawstatus(); +} + +void settags(Client *c, Client *trans) { char prop[512]; unsigned int i, j; @@ -253,21 +275,6 @@ toggletag(Arg *arg) { } void -togglelayout(Arg *arg) { - unsigned int i; - - for(i = 0; i < nlayouts && lt != &layout[i]; i++); - if(i == nlayouts - 1) - lt = &layout[0]; - else - lt = &layout[++i]; - if(sel) - lt->arrange(); - else - drawstatus(); -} - -void toggleversatile(Arg *arg) { if(!sel || lt->arrange == versatile) return; |