User Tools

Site Tools


script_always_there_bar

**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 is a script that place an item (in the video a panel) always on top of the screen. Scroll down the desktop to show it. Scroll up to hide. * Author : [[https://plus.google.com/u/1/105066926163073195690|TrianguloY]] * Link: https://plus.google.com/u/1/105066926163073195690/posts/DPufvGD2SjF (With video) ====== How to use the script ====== Instructions: * Copy paste this script as a new one. * IMPORTANT: you need to label "always-bar" the item you want to move * Pin that item and detach it from the screen * Set the script in the position change event of the desktop ====== Script code ====== <code> var desk = LL.getCurrentDesktop(); /* Label of the item to move.*/ var bar = desk.getItemByLabel("always-bar"); /* current position // in case don't exist //difference //save */ var deskpos = desk.getPositionY(); if(!("prev" in self )) self.prev = deskpos; var d = deskpos-self.prev; self.prev = deskpos; var barpos = bar.getPositionY(); var size=bar.getScaleY() * bar.getHeight(); /*hide the bar */ if(d>0 && barpos>-size){ if(barpos-d<-size || barpos<-size){ bar.setPosition(0,-size); }else{ bar.setPosition(0,barpos-d); } } /*show the bar */ if(d<0 && barpos<0){ if(barpos-d*2>0 || barpos>0){ bar.setPosition(0,0); }else{ bar.setPosition(0,barpos-d*2); } } </code>

script_always_there_bar.1398428843.txt.gz · Last modified: 2014/04/25 12:27 by trianguloy