User Tools

Site Tools


script_change_homescreen

**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 set a desktop as the home desktop * Author : [[https://plus.google.com/+LukasMorawietz|LM13]] * Current Version : 1.0 * Link : ====== Changelog ====== * Version 1.0 (15/2/2015): initial release in wiki ====== How to use the script ====== * Create a shortcut to this script and pass the id of the desktop you want as homescreen in the data field ====== 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"); //set Desktop with Id as Homescreen setHomeDesktop=function(id) { //create the needed structure var file=new File("data/data/net.pierrox.lightning_launcher_extreme/files/config");//this file contains desktop 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(); } //change the property var data=JSON.parse(s); data.homeScreen=id; //write the changed stuff back to the file var w=new FileWriter(file); w.write(JSON.stringify(data)); w.flush(); w.close(); //restart the launcher System.runFinalization(); System.exit(0); } setHomeDesktop(LL.getEvent().getData()); </sxh>

script_change_homescreen.1424030332.txt.gz · Last modified: 2015/02/15 19:58 by lm13