User Tools

Site Tools


script_change_homescreen

====== About the script ====== * Purpose : This script will set a desktop as the home desktop * Author : F43nd1r * Current Version : 1.0 * Link : https://plus.google.com/115366157037831519359/posts/dGNPBbTqUHA ====== 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.txt · Last modified: 2016/06/28 12:27 by f43nd1r