1 -- overwrite some methods in mod_xrandr to mock it
2 print('Mocking RandR inplementation')
4 local outputOne
= { name
= 'ONE', x
= 0, y
= 0, w
= 1280, h
= 960 }
5 local outputTwo
= { name
= 'TWO', x
= 1280, y
= 0, w
= 1280, h
= 1024 }
9 function mod_xrandr
.get_outputs(reg
)
10 if reg
:geom().x
== 0 then
11 return { ONE
= outputOne
}
12 elseif n_screens
> 1 then
13 return { TWO
= outputTwo
}
19 function mod_xrandr
.get_all_outputs()
21 return { ONE
= outputOne
, TWO
= outputTwo
}
23 return { ONE
= outputOne
}
29 mx
:mx_i(function(child
) result
= result
.. child
:name() .. ', ' return true end)
34 function mod_xrandr_mock
.set_number_of_screens(n
)
37 os
.execute("cp xrandr/fakexinerama-1monitor xrandr/.fakexinerama")
39 os
.execute("cp xrandr/fakexinerama-2monitors xrandr/.fakexinerama")