Skip to content

Upgrade from 2.x to 2.2

Kasper Hirvikoski edited this page Apr 15, 2018 · 6 revisions

Follow this guide to upgrade your configuration from 2.x to the new API in 2.2. Sorry for the trouble!

Events

  1. start -> didLaunch

Phoenix

  1. Phoenix.bind(String key, Array<String> modifiers, Function callback) -> new Key(String key, Array<String> modifiers, Function callback)
  2. Phoenix.on(String event, Function callback) -> new Event(String event, Function callback)
  3. Phoenix.after(double interval, Function callback) -> new Timer(double interval, boolean repeats, Function callback)
  4. Phoenix.every(double interval, Function callback) -> new Timer(double interval, boolean repeats, Function callback)

Also, you can use the new managed handlers to let Phoenix manage the references to the handlers for you (i.e. you will not need to explicitly keep references to your handlers).

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() -> #neighbours('west') or #neighbors('west')
  8. #windowsToEast() -> #neighbours('east') or #neighbors('east')
  9. #windowsToNorth() -> #neighbours('north') or #neighbors('north')
  10. #windowsToSouth() -> #neighbours('south') or #neighbors('south')
  11. #focusClosestWindowInWest() -> #focusClosestNeighbour('west') or #focusClosestNeighbor('west')
  12. #focusClosestWindowInEast() -> #focusClosestNeighbour('east') or #focusClosestNeighbor('east')
  13. #focusClosestWindowInNorth() -> #focusClosestNeighbour('north') or #focusClosestNeighbor('north')
  14. #focusClosestWindowInSouth() -> #focusClosestNeighbour('south') or #focusClosestNeighbor('south')

Command

  1. Command.run(String path, Array arguments) -> Task.run(String path, Array arguments, Function callback)
Clone this wiki locally