3 if package
.loaded
["mod_xrandr"] then return end
5 if not notioncore
.load_module("mod_xrandr") then
9 local mod_xrandr
=_G
["mod_xrandr"]
13 if not package
.loaded
["mod_xinerama"] then
14 dopath("mod_xinerama")
17 function filter(t
, predicate
)
19 for k
,v
in pairs(t
) do
27 function mod_xrandr
.get_outputs(screen
)
28 -- get outputs based on geometry of this screen
29 return mod_xrandr
.get_outputs_for_geom(screen
:geom())
32 function falls_within(geom
)
33 return function(output
)
34 local result
= output
.x
>= geom
.x
and output
.y
<= geom
.y
35 and output
.x
+ output
.w
<= geom
.x
+ geom
.w
36 and output
.y
+ output
.h
<= geom
.y
+ geom
.h
41 function mod_xrandr
.get_outputs_within(all_outputs
, screen
)
42 return filter(all_outputs
, falls_within(screen
:geom()))
45 -- Mark ourselves loaded.
46 package
.loaded
["mod_xrandr"]=true
48 -- Load configuration file
49 dopath("cfg_xrandr", true)