Floating Menu Alpha Development Thread

Yes, so I'd like to open a floating menu that'd initially be in the foreground, but when I press outside of it, I'd like it to move to the background, eg. behind my Safari window (I'm using Stage Manager). From then on if I hovered that floating menu, I'd like it to get to the foreground so I can fully see its contents.

May I ask a probably stupid question? What could I do with a "Textfield Item" in a floating menu?

enter text which can be accessed from a script, e.g. like in the mini browser example, which uses a textfield for entering urls: share.folivora.ai

@mkozjak menus can only react to hover if you are actually hovering them, I think I can't change that. You can set a small & transparent unhovered size, which expands on hover (like in the mini emoji menu example on https://share.folivora.ai

1 Like

@Andreas_Hegenberg Thanks! Btw, any thoughts on my questions Re: caching the state of all my tabs in a "browser" and also set User-Agent per "item"?

Does the Safari user agent not work for all your use cases? I can post a script to update the user agent of a webview item dynamically, but are you sure you need this?

If you check the "keep active in background" option, it should not reload the default when showing it again - basically keeping the last one active:

Here is an Apple Script to load a specific URL and at the same time update the user agen:

tell application "BetterTouchTool"
	update_menu_item "AA101043-441B-4F3E-8638-98ABFF10377A" json "{ BTTMenuItemText: 'https://google.com', BTTMenuItemUserAgent: 'some website specific user agent'  }"
end tell

Yeah, for Bing Chat I need to use the Microsoft Edge User-Agent. Safari for the rest. Thanks for the tip!

The script might require the 4.178 alpha to work properly!

1 Like

Hmm, so I have this kind of a setup (screenshot). When BetterTouchTool starts and my menu bar item gets clicked to call the floating menu, it first loads the default page (some random image from https).

Where should I put the applescript to? All my menu items are having a single action "Load New HTML Or URL ..." which doesn't seem to have applescript option available. Should I just run the regular applescript action before I run "Load New HTML Or URL" to set the user agent?

I tried running Applescript in my Menu Item: Bing-button, but the website doesn't seem to work as with my setup. Maybe I'm misusing something.

Can I use a script to switch the audio output between built-in speakers and AirPods ?
using a Floating menu button

Didn't find any direct BTT Action for this, there're only Bluetooth options, and I don't want to disconnect my Airpods.

Basically you would need to replace the "Load New HTML Or URL" action with the "Run Apple Script" action, and enter the script (with the UUID replaced to reference your web view item's uuid)

There is a great command line utility which you can call from a floating menu (or any other BTT trigger)

If you install it with brew, it will be located at /opt/homebrew/bin/SwitchAudioSource so in the BTT terminal command action you can for example do this:

 /opt/homebrew/bin/SwitchAudioSource -t output -s "MacBook Pro Speakers"

I think I will make this an integrated BTT action soon.

Amazing! It would be easier with a BTT Action :slight_smile:
Some actions to control input devices too would be great ! [Very useful during meetings...]

Been testing,

/opt/homebrew/bin/SwitchAudioSource -t output -s "MacBook Pro Speakers"

Works as expected!

/opt/homebrew/bin/SwitchAudioSource -t output -s "Brahim's AirPods Pro"

Doesn't work

I also want it to be in a button and switch from the current output option to the other every time I click the floating menu button.

Tried this one doesn't work


# Get the ID of the currently active output device
current_device=$(switchaudio-osx -c)

# Get the ID of the AirPods output device
airpods_id=$(switchaudio-osx -a | grep -i "AirPods" | awk '{print $1}')

# If the current device is the built-in speakers, switch to AirPods
if [ "$current_device" != "$airpods_id" ]; then
    switchaudio-osx -s "$airpods_id"
    # If the current device is AirPods, switch back to built-in speakers
    built_in_speakers_id=$(switchaudio-osx -a | grep -i "Built-in" | awk '{print $1}')
    switchaudio-osx -s "$built_in_speakers_id"

Are we able to control (un)hover animation speed with BetterTouchTool or is this a default macOS behavior?

it's currently a fixed value in BTT, but I can make it configurable :wink:


Thanks so much for your work! Here's my little ML browser showcase. :slight_smile:

nice! If it doesn't contain private data, it would be great if you'd share that preset

Thanks! Will do! I changed it a bit so it sticks to the screen edge when not hovered. See below.

Btw, regarding the animation hovering performance, maybe it'd make sense to render item positioning changes after the "resizing" is done so it doesn't look as choppy? In this video you can see that my items (ChatGPT, Bard, Perplexity and Bing) are getting repositioned to multiple rows right before they get "hidden" with the hover.

Following this closely. I re-upped my BTT app, and then decided it was time to get rid of my old touchbar mac and move into the new century of mac silicon. :). I came searching for a way to add new objects to the menu bar (since I no longer have a touchbar) and it sounds like the Floating menu's will be as close as I can get.