User Tools

Site Tools


script_appdrawer_toggle_visibility

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== About the script ====== * Purpose : This script will toggle the Visibility of all shortcuts in the App Drawer. So on first run you only see the hidden Shortcuts, on the second run you have all your visible shortcuts back * Author : [[https://plus.google.com/+LukasMorawietz|LM13]] * Current Version : 1.0 * Link : ====== Changelog ====== * Version 1.0 (14/9/2014): initial release in wiki ====== How to use the script ====== * Run from anywhere ====== Issues and Hints ====== * The launcher gets restarted in the process //please report all bugs in the g+ community!// ====== Script ====== <sxh javascript;>//import java classes LL.bindClass("java.io.FileReader"); LL.bindClass("java.io.BufferedReader"); LL.bindClass("java.io.FileWriter"); LL.bindClass("java.io.File"); LL.bindClass("java.lang.System"); //check the app drawer var containers=["99"]; for(var y=0;y<containers.length;y++) { //search for folders in the current container and add them to the queue var items=LL.getContainerById(containers[y]).getItems(); for(var x=0;x<items.length;x++) { var i=items.getAt(x); if(i.getType()=="Folder")containers.push(i.getContainer().getId()); } //create the needed structure var file=new File("data/data/net.pierrox.lightning_launcher_extreme/files/pages/"+containers[y]+"/items");//this file contains item properties var r=new BufferedReader(new FileReader(file)); var s=""; //read the file var l=r.readLine(); while(l!=null) { s+=l; l=r.readLine(); } var found=false; //search through the text for(var a=s.length-8;a>0;a--) { //find the shortcuts if(s.slice(a,a+8)=="SHORTCUT")found=true; //if a shortcut found, toggle its "g" (hidden) property else if(found&&s.slice(a,a+4)=="\"g\":") { if(s[a+4]=="t")s=s.slice(0,a+4)+"false"+s.slice(a+8,s.length); else s=s.slice(0,a+4)+"true"+s.slice(a+9,s.length); found=false; } } //write the changed stuff back to the file var w=new FileWriter(file); w.write(s); w.flush(); w.close(); } //restart the launcher System.runFinalization(); System.exit(2); </sxh>

script_appdrawer_toggle_visibility.1410707595.txt.gz · Last modified: 2014/09/14 15:13 by lm13