TrianguloY
Posted by: pierrot | on November 1, 2015
TrianguloY
Can you please upgrade your script for skip locked screen? I mean add new option for skip floating desktop too…
]]>
< ![CDATA[
Currently there is no way to know the current floating desktop.
Pierre Hébert: is it somewhere and I missed it or should I ask for it as a suggestion?
]]>
< ![CDATA[
There is no “official” way but you can extract the desktop id by reading the value of the “overlayScreen” field in the JSON global config file
]]>
< ![CDATA[
That’s a solution, but a bit ‘advanced’.
What about LL.getFloatingDesktop() ?
]]>
< ![CDATA[
TrianguloY Pierre Hébert if exist ll.getLockscreenDesktop(), your idea is good…
]]>
< ![CDATA[
Maybe I will add this method (although the right way would be to offer a way to read (and maybe write) the global configuration properties).
]]>
< ![CDATA[
TrianguloY in 12.7.b5 is now ll.getLockscreenDesktop() can you upgrade your script? thx
]]>
< ![CDATA[
I couldn’t test it, could you do it?
———————-
/* config */
var skip_LockScreen = true;
var skip_Floating = true;
/* end config */
var desktopsarray=LL.getAllDesktops();
var desktops=[];
var currentid=LL.getCurrentDesktop().getId();
var currentat=-1;
var lockscreenid=LL.getLockscreenDesktop();
if(lockscreenid!=null)lockscreenid=lockscreenid.getId();
var floatingid=LL.getFloatingDesktop();
if(floatingid!=null)floatingid=floatingid.getId();
var p=0;
for(var t=0;t
var id=desktopsarray.getAt(t);
if(id==currentid){
currentat=p;
}else{
if(skip_LockScreen && id==lockscreenid)continue;
if(skip_Floating && id==floatingid)continue;
}
desktops[p++]=id;
}
var source=LL.getEvent().getSource();
if(source==”C_SWIPE2_RIGHT”){
currentat=(currentat+1)%desktops.length;
}else if(source==”C_SWIPE2_LEFT”){
currentat=(currentat-1+desktops.length)%desktops.length;
}else{return}
LL.goToDesktop(desktops[currentat]);
]]>
< ![CDATA[
Yes, for me working good. I tested, if i have both, if have only lockedscreen, if have only floating desktop, if i dont have both. You can public in repository… Thanks
]]>