8000 Add automatic Ice Bar toggle based on screen width threshold by ronilaukkarinen · Pull Request #795 · jordanbaird/Ice · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@ronilaukkarinen
Copy link

Summary

This PR adds an automatic Ice Bar toggle feature that enables/disables Ice Bar based on screen width. Users can set a width threshold (in pixels), and Ice Bar will automatically enable when the screen width is below that threshold and disable when it's above.

Screenshots

SCR-20251124-ndka-2

SCR-20251124-nekv-2

Motivation

When using Ice on multiple displays with different sizes, users currently need to manually toggle "Use Ice Bar" on and off. This becomes tedious when frequently switching between displays:

  • On smaller displays (e.g., MacBook built-in screens), Ice Bar is useful for showing menu bar items under the notch
  • On larger displays (e.g., ultrawide monitors), Ice Bar is unnecessary and can be distracting

This feature eliminates the manual toggling by automatically detecting screen width changes and adjusting the Ice Bar setting accordingly.

How it works

  1. User enables "Auto-enable on narrow displays" in Ice settings
  2. User sets their desired width threshold (default is 3000 pixels)
  3. When screen configuration changes (connecting/disconnecting displays, changing arrangements):
    • The app checks the main screen's width
    • If width < threshold: Ice Bar is enabled
    • If width >= threshold: Ice Bar is disabled
  4. The change happens automatically without user intervention

Testing

As I'm not a Swift expert and this is my first Apple app modification, I tested this feature locally by:

  1. Building the app from Xcode with the feature branch
  2. Granting necessary Accessibility and Screen Recording permissions
  3. Verifying the new settings appear in the General settings pane
  4. Testing the automatic toggle by:
    • Setting a width threshold of 3000 pixels
    • Enabling the auto-enable toggle
    • Testing with my Display Port disabled and MacBook Pro monitor enabled and vice versa

The feature compiled successfully and the UI appears as expected

Notes for reviewers

  • This is my first contribution to an Apple/Swift project, so please review carefully for any non-idiomatic code or potential issues
  • This is PARTLY vibe coded as I am NOT experienced in Swift - please check for any mistakes
  • Screen width is measured in logical points (accounting for Retina scaling), not physical pixels
  • The feature uses macOS's native NSApplication.didChangeScreenParametersNotification to detect display changes

Related issues

@KoukeNeko
Copy link
image image

Maybe add "Only on screens with a notch" option too ?

@ronilaukkarinen ronilaukkarinen force-pushed the feature/auto-iceBar-display-detection branch from b043d6a to a1c3b17 Compare November 27, 2025 14:21
@ronilaukkarinen
Copy link
Author

Maybe add "Only on screens with a notch" option too ?

Done! Tried my best... I hope it's fine. Did some testing and it works. Added "Only on screens with a notch" toggle.

  • When "Auto-enable Ice Bar" is enabled, users can now toggle "Only on screens with a notch" to use notch detection instead of the width threshold. The width threshold input is hidden when notch detection is enabled.

Uses the existing hasNotch property which checks safeAreaInsets.top != 0.

image

Ultrawide 3440px width:

SCR-20251127-olex-2

Macbook Pro M1 with notch:

SCR-20251127-olaa-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0