macOS Control Center - MCC

I'll have a look!

Your first version works quite well!
Is there a reason you removed the function BTTNotification(note) {}? It allows you to immediately get the now playing info when it changes, without having to constantly query BTT.

Small issue: the variable playingt is currently undeclared, thus throwing an exception.

Probably i missed that part from your code, is that sending system notifications?
also which one is better for cpu usage, async or intervals?

BTT calls this function BTTNotification(note) {} every time a variable in BTT changes (and for some other things), thus it immediately notifies the webview when the now playing information has changed, so it can only call the update methods then. This would be more performant than intervals.

Async / await & intervals are both useful, I like async await because I don't have to work with callbacks so it's easier to read for me :slight_smile: Intervals are still needed with async await though.

One more hint: use let instead of var whenever possible. Var has a lot of weird behavior :slight_smile:

Actually i'm comparing async / intervals when floating window closed. i guess intervals not using resources when mcc not in use

I think you use spotify when you have a issue about playingt variable, i didnt tested mcc on spotify app or web. I have to listen some songs on there for testing :slight_smile:

Can you share the code/extension? Would love to help too.

just click to folder icon after installing preset. you will see html file

1 Like

If it's ok for you I'll link your Control Center & Window Manager in an upcoming blog post about the Floating HTML View. I think they are great examples of what can be achieved. I'm currently writing completely new documentation for the webview with many examples and will be publishing a blog post when I'm done.


You are the boss :smiley: its ok for sure

Hello, just tried your v0.1 preset @yw4z and it asks me for the shared secret every single time i click on a button. I managed to figure out what my BTTHTMLScriptingSharedSecret was by going into my keychain. So entering that into the popup that asks for my shared secret totally works but i have to input it every single time i click on any button which is a pain. How do i set it once and for all?

delete it from keychain for now, I think there is a bug which doesn't show previously set secrets on your machine correctly. I'll have a look. (You probably previously set a shared secret for some webview)

1 Like

How do you use the file after importing it into BTT? Is it compatible with my existing touch bar setup?

Can I recommend some floating tooltips similar to what happens on the OS X dock when you mouse over some the buttons/icons?

@Ryan_Mak double click title bar or use fn+1 shortcut, it shouldn't be problem if you dont use these shortcuts for other triggers, always you can customise settings

@sundar2012 i didnt add tooltips. because not needed on this one. i guess if apple made this, they didn't add too. but i need some help on customising icons. i will design a settings pane but i'm not sure how can i change icons of mcc with a external html page

@sundar2012 im not planning to add tooltips but i was thinking to add these type notifications for changes (ex wifi on/off, next track ... ). Also it can work like tooltips when user waited for a while on icon. I can add this if you help on this

This is first concept of settings pane. Im not sure how it will work :smiley: Any helps are welcome on this

So I was thinking just more if you hold your mouse for a while over one of the icons it says what it does. e.g using the :hover CSS and showing a

with the txt description.

@yw4z to save data / settings for your config window I'd put them into a JS object and then just use JSON.stringify and save it into a BTT string variable (using BTT's set_string_variable), then when getting the string variable you can use JSON.parse to decode it again.

Also I think the new "Custom Menubar Icon" could be great to access your control center:

I will try to do mcc settings, probably it will not done in near future :smiley: thanks for guide
That menubar icon looks like nice feature, i will try that for SWM too

Is there a way to customize the date/time format?

you can customise it from html code at the moment, i will add a settings pane that have time format options on future

How do you get the code out and customize it in BTT? Can't seem to find the settings used by the preset in BTT. Dragging the file into Sublime Text does not seem to work.