we can do most of the stuff in the python rewrite, screen size getting 
move dock 
get dock height
now just need to bring it together
This commit is contained in:
neon443
2025-03-15 15:20:36 +00:00
parent 90376a0857
commit 329f972afb
5 changed files with 104 additions and 32 deletions

View File

@@ -89,9 +89,6 @@ struct DockPhobiaApp: App {
moveDock("right")
}
Divider()
Button("Move Dock to Right2") {
moveDockWithDefaults("right")
}
Button("Move Dock to Left") {
moveDock("left")
}
@@ -264,20 +261,3 @@ func moveDock(_ to: String) {
print("Error running AppleScript: \(error)")
}
}
func moveDockWithDefaults(_ to: String) {
let validPositions = ["left", "right", "bottom"]
guard validPositions.contains(to) else {
print("Invalid Dock position: \(to)")
return
}
let command = "defaults write com.apple.Dock orientation -string \(to);launchctl kickstart -k gui/$(id -u)/com.apple.Dock"
let result = shell(command)
if let error = result.error {
print("Error moving Dock: \(error)")
} else {
print("Dock moved to \(to)")
}
}