mirror of
https://github.com/neon443/DockPhobia.git
synced 2026-11-30 20:34:48 +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:
1 parent
90376a0857
commit
329f972afb
5 files changed
+104
-32
No files matched your search
@@ -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)")
|
||||
}
|
||||
}
|
||||