Lister Style Cycle Hotkey

Hello!

I've tried to make a hotkey for cycling between Lister Styles. I can't get it to work. I've tried

Prefs LAYOUT=Cycle
@icon:largeicons,Prefs LAYOUT="Dual Horizontal"
@icon:largeicons,Prefs LAYOUT="Dual Vertical"
@icon:largeicons,Prefs LAYOUT=Filmstrip

I've also tried

Prefs LAYOUT="BMW Default,BMW Default - DualBig,BMW Default - DualBigVert,BMW Default - DualHorizPrev"

I've also tried setting a hotkey for these view commands but can't get them to invoke (except brining up the preferences menu)

image

  • Documentation on the Prefs command is here.

  • Prefs LAYOUT=Cycle would try to load a layout named "Cycle".

  • Prefs LAYOUT=... is for loading layouts, not styles. You want Prefs STYLE=... for loading styles.

  • @icon is for changing the icon a button displays based on a condition. It doesn't affect the commands that get run and so won't help here (even with the right arguments). In the example you're also setting the icon to the same thing for each condition. Docs on @icon are here.

Except where documented, commands do not have cycling built-in, but you can often make a button/hotkey which does the same thing:

@if:Prefs STYLE="Dual Horizontal"
Prefs STYLE="Dual Vertical"
@if:Prefs STYLE="Dual Vertical"
Prefs STYLE="Filmstrip"
@if:else
Prefs STYLE="Dual Horizontal"
1 Like

Thank you!

If I wanted to make one for layouts, would I just

@if:Prefs LAYOUT="Dual Horizontal"
Prefs LAYOUT="Dual Vertical"
@if:Prefs LAYOUT="Dual Vertical"
Prefs LAYOUT="Filmstrip"
@if:else
Prefs LAYOUT="Dual Horizontal"

(substituting layout names obvs)

That wouldn't work since Layouts aren't a "state". Layouts potentially save multiple windows, and you might have windows from multiple layouts (or a mixture, with some that aren't from any layouts) open at once. You could also open a layout and then close some of all of its windows. The concept of a "current layout" doesn't really make sense as a result, so there's no way to test that, at least not directly via simple commands.

Scripting lets you enumerate and inspect the open windows to see which (if any) layouts opened them. So you could do that and then have some script logic which says "if some/all windows are from layout X, close them and then open layout Y", if you wanted to.

1 Like

thanks leo!

1 Like