Reduce menu bar icon spacing to fit more icons

This is not really BetterTouchTool related, but I feel it is useful to many - especially if you have a Macbook with a Notch that constantly keeps hiding menu bar status items.

You can show significantly more menu bar status items / icons by reducing the spacing between them. You don't need an app to do that, you can just run these terminal commands:

defaults -currentHost write -globalDomain NSStatusItemSpacing -int 0
defaults -currentHost write -globalDomain NSStatusItemSelectionPadding -int 0
killall ControlCenter

Change the 0 to any spacing value you want to try.

How do we rollback to default values?

To reset:

defaults -currentHost delete -globalDomain NSStatusItemSpacing
defaults -currentHost delete -globalDomain NSStatusItemSelectionPadding

killall ControlCenter
1 Like

This is great @Andreas_Hegenberg :clap:

On a similar note, is there any way one can also adjust the left & right margins of menu bar buttons?

For example, I have this Menu Bar Item that runs JavaScript to fetch the latest price of ETH.

This is how it looks in the Menu Bar:
Screenshot 2025-04-23 at 1.20.45 PM
Screenshot 2025-04-23 at 1.24.04 PM

And here is the config:

Currently, there doesn't seem to be such an option to reduce the margin / padding of menu bar items?

Thanks

1 Like

Could you please share the preset that displays the latest price of ETH, if it doesn’t contain any sensitive information? Thank you!

@tobias could you check whether that margin issue is resolved in 5.337 alpha? (uploading now). I will very soon allow to place floating menus into the menubar, that will make it much more configurable.

1 Like

Sure, please find the file here:
eth_menu_bar_icon.bttpreset (9.5 KB)

It's running the following script:

(async () => {
  
  const coinsToLoad = ["ETH"];
  const currenciesToLoad = ["USD"];
  
  async function fetchCrypto(coins, currencies) {
    const fsyms = coins.join(",");
    const tsyms = currencies.join(",");
    const cryptoCompareURL = `https://min-api.cryptocompare.com/data/pricemultifull?fsyms=${fsyms}&tsyms=${tsyms}`;
  
    const response = await fetch(cryptoCompareURL);
    const json = await response.json();
  
    const currentPrices = [];
  
    for (const currency of currencies) {
      for (const coin of coins) {
        currentPrices.push(json["RAW"][coin][currency]["PRICE"] + " " + currency);
      }
    }
  
    return currentPrices;
  }
  
  const resultPrices = await fetchCrypto(coinsToLoad, currenciesToLoad);
  const result = resultPrices.map(x => `${parseInt(x.replace(' USD', ''))} $`);
  
  returnToBTT(result.join(" | "));

})();
1 Like

Thanks @Andreas_Hegenberg I'm now running version 5.339. It looks like the outside margin is now working for me :slight_smile: However, I'm still wondering if there is an option to control the inside padding of the menu bar icon / item?

This is how the menu button looks with the new version. There is still some extra padding inside the button. Is there any chance that could be further reduced? I've drawn two red lines in the below screenshot to indicate where the button could end instead.

Screenshot 2025-04-24 at 5.12.36 PM

I assume the icon itself also takes up a bit of extra horizontal padding, but perhaps one could include a padding and/or margin option in the Common configuration of Menu Bar Icon / Items?

WDYT?

unfortunately at the moment this is using a standard macOS status bar item button - it doesn't offer any such customization options.
However once I allow floating menus to be added to the status bar, this will be possible.

1 Like

Thanks very much