Skip to content

Name and stylistic changes to the API #108

@kasper

Description

@kasper

Make some name and stylistic changes to the API to make it more coherent. Many of these are remains from the refactor and have bothered me partly due to their naming, but partly due to not feeling natural.

It’s most likely reasonable to change these, but make the existing ones aliases, deprecate them and remove then in the future — so that users don’t have to make configuration changes so often?

Any others?

Screen

  1. Screen.mainScreen() -> Screen.main()
  2. Screen.screens() -> Screen.all()
  3. #visibleWindows() -> #windows({ visible: true })

Space

  1. Space.activeSpace() -> Space.active()
  2. Space.spaces() -> Space.all()
  3. #visibleWindows() -> #windows({ visible: true })

Mouse

  1. Mouse.moveTo(...) -> Mouse.move(...)

App

  1. App.focusedApp() -> App.focused()
  2. App.runningApps() -> App.all()
  3. #visibleWindows() -> #windows({ visible: true })
  4. #forceTerminate() -> #terminate({ force: true })

Window

  1. Window.focusedWindow() -> Window.focused()
  2. Window.windows() -> Window.all()
  3. Window.visibleWindows() -> Window.all({ visible: true })
  4. Window.visibleWindowsInOrder() -> Window.recent()
  5. #otherWindowsOnSameScreen() -> #others({ screen: window.screen })
  6. #otherWindowsOnAllScreens() -> #others()
  7. #windowsToWest() -> #neighbors('west')
  8. #windowsToEast() -> #neighbors('east')
  9. #windowsToNorth() -> #neighbors('north')
  10. #windowsToSouth() -> #neighbors('south')
  11. #focusClosestWindowInWest() -> #focusClosestNeighbor('west')
  12. #focusClosestWindowInEast() -> #focusClosestNeighbor('east')
  13. #focusClosestWindowInNorth() -> #focusClosestNeighbor('north')
  14. #focusClosestWindowInSouth() -> #focusClosestNeighbor('south')

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions