mirror of
https://github.com/neon443/DockPhobia.git
synced 2026-03-11 14:56:16 +00:00
yessssss
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:
@@ -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)")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user