User Tools

Site Tools


script_skip_lockscreen

====== About the script ====== * Purpose : This script lets you change between desktops without entering the lockscreen and/or the floating desktop * Author : [[https://plus.google.com/u/1/105066926163073195690|TrianguloY]] ====== How to use the script ====== **Updated (12/11/2015): Now you can also skip or not the floating desktop** Set the script in the two fingers swipe left and two fingers swipe right event in general settings. Won't work from another different event (but if you want to it can be easily changed) If you want to go to the lock screen or to the floating desktop, use a shortcut or go to settings, configure desktops, long click the one you want to go to. Configuration: Simply change true<->false if you want to skip the lock screen and/or the floating desktop. ====== Script code ====== <sxh javascript> /* 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<desktopsarray.getLength();++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]); </sxh>

script_skip_lockscreen.txt · Last modified: 2015/11/12 13:31 by trianguloy