Go to specified panel position action
Go to specified panel position action
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.
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
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.
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
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
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
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
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
I only managed to move the panel, not scroll it. Using:
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.
Code: Select all
getActiveScreen().getItemById(<your panel container id>).setPosition(0,0)
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
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
Thanks, now it works!
I did need to add getActiveScreen() at the beginning, otherwise I got: "getItemById" is not defined"
so
I guess I just incorrectly assumed the Panel's id in the hierarchy is the container id.
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)