Page 1 of 1
Go to specified panel position action
Posted: Sat May 09, 2020 8:42 pm
by exnova
Hello,
I have a panel that is 3 desktops wide, scrollable.
I'd like to assign Home key to scroll it back to the middle section.
I was looking into Bookmarks, but can't see how one can be launched with an action, only a shortcut.
Re: Go to specified panel position action
Posted: Fri May 15, 2020 4:06 pm
by exnova
Did I really discovered something this Launcher can't do? Even with a script?
To be clear, I just want to replicate the "Go to home desktop" action, but for a panel instead of the desktop.
Re: Go to specified panel position action
Posted: Fri May 15, 2020 8:13 pm
by F43nd1r
First, to get the terminology straight: I think you're talking about pages, as LL has a concept of multiple desktops which aren't connected to each other.
Second, scripts can do that. Something along the lines of
Code: Select all
getActiveScreen().getContainerById(<your panel container id>).setPosition(0,0)
Re: Go to specified panel position action
Posted: Sat May 16, 2020 11:40 pm
by exnova
Thanks!
Although the script doesn't make my panel scroll, I should probably figure it out, now that I know the correct approach.
edit: can't get it to work after all
Re: Go to specified panel position action
Posted: Tue May 26, 2020 1:14 am
by exnova
I only managed to move the panel, not scroll it. Using:
Code: Select all
getActiveScreen().getItemById(<your panel container id>).setPosition(0,0)
Can setPosition be used to scroll as well?
Or do I need to create 3 panels, instead of having one that's 3 pages wide?
Also I had to add "0x" to the start of panel ID, taken from the hierarchy. Just wanted to mention it's not obvious from the documentation.
Re: Go to specified panel position action
Posted: Wed May 27, 2020 12:03 am
by F43nd1r
You need to get the container, not the item. My script above uses the container id. If you want to use the item id, use
Code: Select all
getItemById(...).getContainer().setPosition(...)
Re: Go to specified panel position action
Posted: Wed May 27, 2020 2:45 am
by exnova
Thanks, now it works!
I did need to add getActiveScreen() at the beginning, otherwise I got: "getItemById" is not defined"
so
Code: Select all
getActiveScreen().getItemById(0x<panel item id>).getContainer().setPosition(0,0)
I guess I just incorrectly assumed the Panel's id in the hierarchy is the container id.