Hooks

Templates can't run code. Hooks are the built-in actions an element can trigger instead, by adding a data-hook attribute.

HookNeedsDoes
dock:item-clickdock capability, data-idOpens the app when clicked

dock:item-click

Add it to the tag for each app, with the app's id in data-id:

{% for app in dock.apps %}
  <div data-hook="dock:item-click" data-id="{{ app.id }}" title="{{ app.name }}">
    <img src="{{ app.iconPath }}" alt="" class="w-10 h-10 object-contain" />
  </div>
{% endfor %}
  • Clicks inside the tag count, so wrap the whole icon and label.
  • Clicks are ignored while the desktop is in edit mode.

Other hooks

Unknown data-hook values do nothing. New hooks come with StormGauge updates and are listed here.