Automatically hide menu bar icons after timeout

I'm trying to use the menu bar features to create a collapsible set of menu bar icons. I've successfully set this up with BTT so that when I click the "..." icon I created it will show/hide icons to the left of itself.

I also want those icons to hide themselves after a period of inactivity. I've done that with the Execute Action Sequence after Timeout/Delay. However, the best I can tell, this action moves your mouse cursor to "click" on the created ... icon.

Is there a way to trigger this action without losing control of the mouse?

status items can only be moved/hidden by using mouse events to drag them to specific positions. Thus there will always be a quick interaction with the mouse - it should be pretty fast though and move the mouse back to the position it was at

I achieved this with the below chained actions, and it doesn't move my mouse.

Steps to reproduce:

  1. Go in to configured action in BTT and add 'Pause Execution /Delay Next Action (Async)'
  2. Set desired delay (mine is 4 seconds).
  3. Add 'Execute Actions for Existing Configured Trigger'
  4. Before updating this trigger, disable it (right click > enable/disable)
  5. Now set up the trigger by either selecting the show/hide icons trigger from the 'select trigger' menu or paste the UUID manually (I did the latter).
  6. Add 'Break Repeat' action (otherwise the actions will loop forever).
  7. Check that your menu list is toggled to close. If it is not, toggle close.
  8. Right click on 'Execute Actions for Existing Configured Trigger' and enable.

The trigger should now work as desired.

Disable logic: I found that by disabling the second instance of the trigger, setting it up and then enabling it, the state the show/hide trigger was in is preserved establishing a default state (as it is show/hide, not seperate show and hide triggers). I tried scripts etc. to set the toggle closed by default, but they created issues.

Update: I've found that the starting state of the show/hide can be a bit unpredictable, so I've adjusted this slightly:

  1. Set a keyboard shortcut to hide the icons
  2. Hide the icons, disabled the two bottom actions in the above workflow
  3. Changed the UUID in the 'Execute Actions for Trigger' to the shortcut to hide icons.
  4. Ran the shortcut to hide the icons
  5. Enabled the Break Repeat then Execute Actions

Now, the icons are hidden by default, but if it does toggle open when there's a restart (etc), I just run the shortcut to hide the icons and I'm now back to my original state so on left click it will toggle open and then auto-close. Not perfect, but a good enough workaround.