diff --git a/doc/fvwm3/fvwm3.adoc b/doc/fvwm3/fvwm3.adoc index 4de132ce6..92e326715 100644 --- a/doc/fvwm3/fvwm3.adoc +++ b/doc/fvwm3/fvwm3.adoc @@ -1661,7 +1661,7 @@ $[pointer.screen]:: + This command is deprecated; use $[monitor.current] instead. -$[monitor..x], $[monitor..y], $[monitor..width], $[monitor..height], $[monitor..desk], $[monitor..pagex], $[monitor..pagey] $[monitor.primary], $[monitor.current], $[monitor.output], $[monitor.count]:: +$[monitor..x], $[monitor..y], $[monitor..width], $[monitor..height], $[monitor..desk], $[monitor..pagex], $[monitor..pagey] $[monitor.primary], $[monitor.current], $[monitor.output], $[monitor.count], $[monitor..prev_desk], $[monitor..prev_pagex], $[monitor..prev_pagey]:: Returns information about the selected monitor. These can be nested, for example: $[monitor.$[monitor.primary].width] + @@ -1683,6 +1683,12 @@ monitor which has the mouse pointer. "pagey" returns the Y page of the referenced monitor. + "primary" is the name of the output set as primary via xrandr(1). ++ +"prev_desk" returns the previous desk on the referenced monitor. ++ +"prev_pagex" returns the previous X page on the referenced monitor. ++ +"prev_pagey" retuns the previous Y page on the referenced monitor. $[screen]:: The screen number fvwm is running on. Useful for setups with multiple diff --git a/fvwm/expand.c b/fvwm/expand.c index 2b2b7db54..1e8a87d47 100644 --- a/fvwm/expand.c +++ b/fvwm/expand.c @@ -594,6 +594,26 @@ static signed int expand_vars_extended( monitor_get_all_heights()); goto GOT_STRING; } + + if (strcmp(rest, "prev_desk") == 0) { + is_numeric = True; + val = m->virtual_scr.prev_desk_and_page_desk; + goto GOT_STRING; + } + + if (strcmp(rest, "prev_pagex") == 0) { + is_numeric = True; + val = (int)(m->virtual_scr.prev_page_x / + monitor_get_all_widths()); + goto GOT_STRING; + } + + if (strcmp(rest, "prev_pagey") == 0) { + is_numeric = True; + val = (int)(m->virtual_scr.prev_page_y / + monitor_get_all_heights()); + goto GOT_STRING; + } } break; }