From: Reginald Kennedy Date: Sun, 10 Jun 2012 21:31:28 +0000 (+0800) Subject: Add horizontal_flip and vertical_flip layout options. X-Git-Tag: SPECTRWM_1_1_0~9 X-Git-Url: https://code.delx.au/spectrwm/commitdiff_plain/f6d686fcff2e80602e91606fa96c7bcf6db1de2c Add horizontal_flip and vertical_flip layout options. Based on patch submitted by Olivier Mauras ok marco --- diff --git a/spectrwm.1 b/spectrwm.1 index 5596af0..2404cfb 100644 --- a/spectrwm.1 +++ b/spectrwm.1 @@ -208,7 +208,9 @@ shrinks the master area by 4 ticks and adds one window to the stack, while maintaining default floating window behavior. Possible stack_mode values are .Pa vertical , -.Pa horizontal +.Pa vertical_flip , +.Pa horizontal , +.Pa horizontal_flip and .Pa fullscreen . .Pp diff --git a/spectrwm.c b/spectrwm.c index 6b94bcb..0569f9c 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -5756,7 +5756,7 @@ setautorun(char *selector, char *value, int flags) int setlayout(char *selector, char *value, int flags) { - int ws_id, i, x, mg, ma, si, raise; + int ws_id, i, x, mg, ma, si, raise, f = 0; int st = SWM_V_STACK; char s[1024]; struct workspace *ws; @@ -5776,9 +5776,15 @@ setlayout(char *selector, char *value, int flags) if (!strcasecmp(s, "vertical")) st = SWM_V_STACK; - else if (!strcasecmp(s, "horizontal")) + else if (!strcasecmp(s, "vertical_flip")) { + st = SWM_V_STACK; + f = 1; + } else if (!strcasecmp(s, "horizontal")) + st = SWM_H_STACK; + else if (!strcasecmp(s, "horizontal_flip")) { st = SWM_H_STACK; - else if (!strcasecmp(s, "fullscreen")) + f = 1; + } else if (!strcasecmp(s, "fullscreen")) st = SWM_MAX_STACK; else errx(1, "invalid layout entry, should be 'ws[]:" @@ -5814,6 +5820,12 @@ setlayout(char *selector, char *value, int flags) SWM_ARG_ID_STACKDEC); stack(); } + /* Apply flip */ + if (f) { + ws[ws_id].cur_layout->l_config(&ws[ws_id], + SWM_ARG_ID_FLIPLAYOUT); + stack(); + } } return (0); diff --git a/spectrwm.conf b/spectrwm.conf index acdfb2d..53c673b 100644 --- a/spectrwm.conf +++ b/spectrwm.conf @@ -64,6 +64,8 @@ # layout = ws[1]:4:0:0:0:vertical # layout = ws[2]:0:0:0:0:horizontal # layout = ws[3]:0:0:0:0:fullscreen +# layout = ws[4]:4:0:0:0:vertical_flip +# layout = ws[5]:0:0:0:0:horizontal_flip # mod key, (windows key is Mod4) (apple key on OSX is Mod2) # modkey = Mod1