User Tools

Site Tools


script_dim_bg

**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 dim all other stuff if you open a folder * Author : [[https://plus.google.com/+LukasMorawietz|LM13]] * Current Version : 2.1 * Link : https://plus.google.com/115366157037831519359/posts/24AHYbCWrXn * Video : https://plus.google.com/115366157037831519359/posts/3ZY4BWnZbmp ====== Changelog ====== * Version 2.0 (28/5/2014): initial release in wiki * Version 2.1 (18/7/2014): auto create item ====== How to use the script ====== * in the folder: set the script to paused and resumed event * set up configuration if you don't like the standard values ====== Issues and hints ====== * the orientation fix may interfere with your desktop boundings, so keep it off unless you need it //please report all bugs in the g+ community// ====== Script code ====== <sxh javascript;>/*config*/ var speed=10;//lower is faster, 1 for instant var dim=150;//0 for nothing, 255 for solid black var orientationfix=false;//true if you want to switch screen orientation while folder open /*endconfig*/ var d=LL.getCurrentDesktop(); var i=d.getItemByLabel("bg")||d.addShortcut("bg",new Intent(),0,0); var p=i.getProperties(); if(LL.getEvent().getSource()=="C_RESUMED") { d.setItemZIndex(i.getId(),d.getItems().getLength()-1); var editor=p.edit(); editor.setBoolean("i.onGrid",false).setString("i.pinMode","XY").setBoolean("i.enabled",false).setBoolean("s.iconVisibility",false).setBoolean("s.labelVisibility",false); editor.getBox("i.box").setColor("c","n",0xff000000); editor.commit(); if(orientationfix){ var s=Math.max( d.getWidth(),d.getHeight())*1.1; i.setSize(s,s);} else i.setSize( d.getWidth(),d.getHeight()); i.setPosition(0,0); var i=0; a(); } else { var i=speed; b(); } function a() { i++; p.edit().setInteger("i.alpha",i*dim/speed).commit(); if(i<speed)setTimeout(a,0); } function b() { i--; p.edit().setInteger("i.alpha",i*dim/speed).commit(); if(i>0)setTimeout(b,0); } </sxh>

script_dim_bg.1406148067.txt.gz · Last modified: 2014/07/23 20:41 by lm13