now browsing by category
Dim background when folder open
For a video look here: https://plus.google.com/115366157037831519359/posts/3ZY4BWnZbmp
On desktop:
– create an item
– disable it
– hide label and icon
– set label to “bg”
– set content color to black (not transparent)
set up configuration:
– dim has to be the same value in both scripts
-speed can be different
Set in folders resume event:
/*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”);
var p=i.getProperties();
d.setItemZIndex(i.getId(),d.getItems().getLength()-1);
p.edit().setBoolean(“i.onGrid”,false).setString(“i.pinMode”,”XY”).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;
var a=function()
{
i++;
p.edit().setInteger(“i.alpha”,i*dim/speed).commit();
if(i } a(); Set in folders paused event: /*config */ var speed=10;//lower is faster, 1 for instant var dim=150;//0 for nothing, 255 for solid black /*endconfig */ var p=LL.getCurrentDesktop().getItemByLabel(“bg”).getProperties(); var i=speed; var a=function() { i–; p.edit().setInteger(“i.alpha”,i*dim/speed).commit(); if(i>0)setTimeout(a,0); } a();
Hi, I wrote a script in the Resume event of a folder. The first few lines look like this:
var item = LL.getEvent().getItem();
alert(“item=”+item);
This shows “item=null” in the resulting alert.
I expected that in line 2, item would contain a reference to the folder on which the resume event was triggered, but it looks like I’m missing something here. I want to darken the folder item on my desktop when the folder is opened, and lighten it back to the original color when it is closed. What would be the right way to achieve this effect?
Thanks in advance!
]]>Honestly – I tried to look for this myself, but…still too much for me.
I’d like a script for the lockscreen that unlocks and then goes to the home desktop.
I also remeber some talk that through scripting one could use multiple LL actions in sequence. How can I send the script to look for an action then or is this supposed to be done only via scripts?
Also I’ve got some weird issues with stop points (still on the lockscreen): I have a stop point at 0,0 position and I’ve set that as a desktop wide barrier…it worked as it should until a few days ago I was able to scroll to the left (which was supposed to be restricted).
I now added another stop point further to the left to have two different actions on the lockscreen – this works…for now at least.
Any ideas what might have happened and why?
The same weird stop point is also supposed to be the only snapping stop point so that if I don’t reach a stop point with a reached event then it returns to the original position, but often there’s no movement to the original position – sometimes I works quite well, other times almost not at all.
Could the last part be done via script? Would that be more reliable?
I’m in no rush with these scripts, so don’t push something important to a later time for me =D No need for that!
Thanks for the help, guys!
]]>I’d like to use setVisibility on certain icons, but know absolutely Nothing about scripting. Can anyone help?
Finally the resumed event was added, so here is my lock screen.
Finally the resumed event was added, so here is my lock screen. Maybe you don’t believe, but I have this lock screen (two scripts) since the alpha! I even posted the scripts once (now they are improved) And that’s why I can publish it now, I just managed to have some free time to record the video.
Story: I read once that pattern/pin/password as lock screen are not really secure in the fact that the fingerprint tells you the path/numbers/letters.
It was said on a research, but unfortunately I couldn’t find it (if someone know, write here the link)
In the research, the conclusion was that the ‘best’ lock screen (in the fingerprint part) will be one with a color password, colors placed randomly on the screen so you just need to click the color password in order. Since the position of the colors is random, even if you know where exactly the user clicked, you can’t know which colors did they click.
The only thing I saw was the app ORBIE
This lock screen is made of two scripts: one that unlocks the screen if you click the items in order (configurable, uses the id of the items) and the other just place the items in random cells (configurable too).
Since the items can be whatever you want, you can make the lock screen with apps, pictures, colors, shapes…
Of course you can use them separately, perhaps you just want the lock sequence
Instructions:
– Place some items in cell mode.
[If you want to move them randomly]
– Set the resumed event to run the ‘randomize’ script. If you want some items to not move, place them in free mode
– IMPORTANT: configure the script with the available cells where you want to place the items.
[The lock part]
– Set the click event of the items (all that will be part of the ‘pattern’ ) to run the ‘locksequence’ script.
– Click one item to set your first password
– To change it just perform the sequence while unlocked and follow the instructions. (The time to wait is configurable)
—————————————
Locksequence script
—————–
var interval = 2000; /* time in milliseconds to wait until new lock set*/
var tag = LL.getScriptTag();
/* in case they don’t exist*/
if( tag != undefined ){
var data = JSON.parse( tag );
}else{
var data = new Object();
}
if(! (“a” in data)){
data.a=0;
}
if(! (“secuence” in data)){
data.secuence = [];
data.secuence[0]=0;
}
var item = LL.getEvent().getItem();
/* to notify the click*/
item.setVisibility(false);
setTimeout(function(){ item.setVisibility(true) ;},50);
if(data.a<0){
/* The set procces: negative numbers*/
data.secuence[ -data.a -1]=item.getId();
–data.a;
data.timeout = setTimeout( function(){isDone(data.a);},interval);
}else{
/* The unlock procces: positive and zero numbers*/
if(item.getId()!=data.secuence[data.a]){
/* wrong*/
data.a=0;
}else{
++data.a;
if(data.a==data.secuence.length){
/* good*/
data.a=0;
/* unlock or set new one*/
if(LL.isLocked()){
LL.unlock();
}else{
reset();
}
}
}
}
/* if no data found*/
if( data.secuence[0]==0 ) reset();
save(data);
function save(tosave){
LL.setScriptTag( JSON.stringify(tosave) );
}
function reset(){
if(!confirm(“Set a new lock?”))return;
data.secuence = [];
data.a= -1;
Android.makeNewToast(“Click the items in order\nWait “+ interval/1000 + ” second after the last click to apply” , false ).show() ;
}
function isDone(old){
var now = JSON.parse( LL.getScriptTag() );
if(old!=now.a)return;
now.a=0;
Android.makeNewToast(“Lock set with “+ data.secuence.length + ” steps”, false ).show();
save(now);
}
—————————————
Randomize script
————–
//Cell: [first position , size ]
var h = [1,3];
var v = [1,3];
var all = LL.getEvent().getContainer().getItems(); //Or use the container you want
var items = [];
var len = 0;
for(var i=all.getLength()-1;i>=0;–i){
var p = all.getAt(i);
if(p.getProperties().getBoolean(“i.onGrid”) ) items[len++]=p;
}
var free = new Array();
if(len > h[1]* v[1] ){
alert(“WARNING: a lot of items, or a small layout”);
return;
}
for(var i=0; i var sh = 0; var sv = 0; do{ sh=Math.floor(Math.random()* h[1] ); sv=Math.floor(Math.random()* v[1] ); } while(free[sv* h[1]+sh]!=undefined) free[sv* h[1]+sh]=0; sh+=h[0]; sv+=v[0]; items[i].setCell(sh,sv,sh+1,sv+1); }
Label Case switcher
Just a fast script that will change the labels of all the items in the app drawer (or a custom container if necessary, ask about)
The change can be done permanently or just visual (a restart will change them back)
Available types: ( you can write your own one if you know scripting)
– UPPER CASE
– lower case
– Sentence case
– Title Case (from http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript)
(Note: sorry for the lack of posts, in fact I have a lot of scripts I’m working on, but my free time has decrease suddenly, maybe in summer)
———————————————–
var container = LL.getContainerById(99);//LL.getEvent().getContainer();
var permanent = confirm(“Permanent change?”);
var type = parseInt(prompt(“1- UPPER CASE\n2- lower case\n3- As a sentence\n4- Title Case”,0));
run(container);
Android.makeNewToast(“Done”,true).show();
function run(cont){
var items = cont.getItems();
for(var i=items.getLength()- 1;i>=0; –i){
var item=items.getAt(i);
item.setLabel(change(item.getLabel()),permanent);
if(item.getType()==”Folder”||item.getType()==”Panel”)run(item.getContainer());
}
}
function change(label){
var ret=label;
switch(type){
case 1: ret=ret.toUpperCase(); break;
case 2: ret=ret.toLowerCase(); break;
case 3: ret=
ret.charAt(0).toUpperCase() + ret.substring(1,ret.length).toLowerCase(); break;
case 4: ret=ret.split(” “).map(function(i){return i[0].toUpperCase() + i.substring(1)}).join(” “);
break;
//Write here your custom label changer
}
return ret;
}
]]>Interactive proportional scrollbar for both horizontal and vertical scrolling.
Please post feedback and comments below :P
]]>I’ve got to know. Has anyone made googly eyes that look at where you tap on the screen?
If not I think such a project should be a very high priority, Pierre Hébert.
]]>
D5 Creation