Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f55861be7 | ||
|
|
ccc172d218 | ||
|
|
4bc6b333dc |
@@ -34,14 +34,12 @@ automatically.
|
|||||||
|
|
||||||
What it can and cannot hide:
|
What it can and cannot hide:
|
||||||
|
|
||||||
- It hides **other third-party apps' icons** (cmux, Kapture, WireGuard, input
|
- It hides **other third-party apps' icons** (cmux, Kapture, moomoo, WireGuard).
|
||||||
source, Now Playing, …) so only your apps' icons leave the bar.
|
- It **keeps Wi-Fi, Now Playing, the input-source indicator, Spotlight, Clock,
|
||||||
- It **keeps Wi-Fi, Spotlight, Clock, Battery and Control Center**. The spacer's
|
Battery and Control Center** visible, with the **hamburger at the left edge of
|
||||||
boundary is tuned (preferred position 250) to fall just left of Wi-Fi, so the
|
that group**. The spacer's boundary (preferred position 330) falls just left
|
||||||
Apple items on the right stay visible. macOS reserves that far-right area: a
|
of the input-source indicator. macOS reserves the far-right area, so an item
|
||||||
third-party item can never be placed to the right of it, so those icons cannot
|
can never be placed to the right of the system icons.
|
||||||
be pushed away even in principle. (Bartender and Ice hit the same wall and
|
|
||||||
cover the area with their own overlay bar instead.)
|
|
||||||
- Newly launched apps are placed to the left of the spacer, so they are hidden
|
- Newly launched apps are placed to the left of the spacer, so they are hidden
|
||||||
automatically.
|
automatically.
|
||||||
- Advanced: set `defaults write dev.tzgyn.simpletopbar debug.spacerPos -float <n>`
|
- Advanced: set `defaults write dev.tzgyn.simpletopbar debug.spacerPos -float <n>`
|
||||||
|
|||||||
@@ -103,9 +103,13 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
let name = "SimpleTopBar"
|
let name = "SimpleTopBar"
|
||||||
let positionKey = "NSStatusItem Preferred Position \(name)"
|
let positionKey = "NSStatusItem Preferred Position \(name)"
|
||||||
// Only seed the position on first run so the user's own drag wins and
|
// Only seed the position on first run so the user's own drag wins and
|
||||||
// persists through the autosave name.
|
// persists through the autosave name. Kept just below the hider's
|
||||||
if UserDefaults.standard.object(forKey: positionKey) == nil {
|
// preferred position so the hamburger lands at the left edge of the
|
||||||
UserDefaults.standard.set(100.0, forKey: positionKey)
|
// visible icons. `debug.hamburgerPos` overrides it.
|
||||||
|
if let override = UserDefaults.standard.object(forKey: "debug.hamburgerPos") as? Double {
|
||||||
|
UserDefaults.standard.set(override, forKey: positionKey)
|
||||||
|
} else if UserDefaults.standard.object(forKey: positionKey) == nil {
|
||||||
|
UserDefaults.standard.set(320.0, forKey: positionKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
let item = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
let item = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
|
||||||
|
|||||||
@@ -313,10 +313,15 @@ final class MenuBarHider: ObservableObject {
|
|||||||
// The boundary between "hidden" and "kept" falls just left of Wi-Fi at
|
// The boundary between "hidden" and "kept" falls just left of Wi-Fi at
|
||||||
// ~250, so the other apps hide while Apple's Wi-Fi/Clock/Battery/Control
|
// ~250, so the other apps hide while Apple's Wi-Fi/Clock/Battery/Control
|
||||||
// Center/Spotlight stay visible. `debug.spacerPos` overrides the seed.
|
// Center/Spotlight stay visible. `debug.spacerPos` overrides the seed.
|
||||||
|
// The boundary sits just left of the input-source indicator, so every
|
||||||
|
// system item (input source, Now Playing, Wi-Fi, …) stays visible while
|
||||||
|
// the apps hide. It must stay *above* the hamburger's preferred position
|
||||||
|
// (see AppDelegate) for the hamburger to remain on the visible side.
|
||||||
|
// `debug.spacerPos` overrides the seed.
|
||||||
if let override = UserDefaults.standard.object(forKey: "debug.spacerPos") as? Double {
|
if let override = UserDefaults.standard.object(forKey: "debug.spacerPos") as? Double {
|
||||||
UserDefaults.standard.set(override, forKey: key)
|
UserDefaults.standard.set(override, forKey: key)
|
||||||
} else if UserDefaults.standard.object(forKey: key) == nil {
|
} else if UserDefaults.standard.object(forKey: key) == nil {
|
||||||
UserDefaults.standard.set(350.0, forKey: key)
|
UserDefaults.standard.set(330.0, forKey: key)
|
||||||
}
|
}
|
||||||
let item = NSStatusBar.system.statusItem(withLength: 0)
|
let item = NSStatusBar.system.statusItem(withLength: 0)
|
||||||
item.autosaveName = name
|
item.autosaveName = name
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
VERSION="${1:-0.4.5}"
|
VERSION="${1:-0.4.7}"
|
||||||
|
|
||||||
swift build -c release
|
swift build -c release
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user