-
Notifications
You must be signed in to change notification settings - Fork 2
JavaScript API documentation
It's not written in JavaScript. But this pseudo-code conveys more information, so yeah.
Valid modifiers: cmd | alt | ctrl | shift (case insensitive)
Valid keys: single case insensitive character or special keys (plus F-keys, numpad, etc. listed here)
You can modularize your config using the require function. It will
load the referenced .js file and reload it if changes are detected.
require('<path to some.js file>');If the path is a relative path it's resolved relative to the (real)
location of the .conductor.js file. If the .conductor.js file is a symlink
the symlink is resolved before resolving the location of the required
file.
This feature was contributed by @pascalw.
class api
static Hotkey bind(String key, Array<String> mods, Function callback)
static void reload()
static void launch(String appName)
static void alert(String message, double durationSeconds)
static void runCommand(String commandPath, Array args)
static void log(String message)
endSafe to say most of the stuff we do is in here...
class Window
static Window focusedWindow()
static Array<Window> allWindows()
static Array<Window> visibleWindows()
static Array<Window> visibleWindowsMostRecentFirst()
Array<Window> otherWindowsOnSameScreen()
Array<Window> otherWindowsOnAllScreens()
endEvery screen (aka monitor or display) combines to form a giant rectangle. Every window lives in this rectangle. So this is why window positions and sizes don't have a "screen" parameter. It's already taken into account by the coordinates you give it. To figure out coordinates on a given screen, use the Screen methods.
Rect frame()
Point topLeft()
Size size()
void setFrame(Rect frame)
void setTopLeft(Point thePoint)
void setSize(Size theSize)
void maximize()
void minimize()
void unMinimize()
Screen screen()
App app()
boolean isNormalWindow()
boolean focusWindow()
void focusWindowLeft()
void focusWindowRight()
void focusWindowUp()
void focusWindowDown()
Array<Window> windowsToWest()
Array<Window> windowsToEast()
Array<Window> windowsToNorth()
Array<Window> windowsToSouth()
String title()
boolean isWindowMinimized()
endclass App
static Array<App> runningApps()
Array<Window> allWindows()
Array<Window> visibleWindows()
String title()
boolean isHidden()
void show()
void hide()
int pid()
void kill()
void kill9()
endFrame sizes and get the next previous screen on a multi screen layout, get the current screen for an Window through the Window api. This also allows you to set the brightness. This is done with a number between 0 and 100. This sets the brightness for all screens.
class Screen
Rect frameIncludingDockAndMenu()
Rect frameWithoutDockOrMenu()
Screen nextScreen()
Screen previousScreen()
double getBrightness()
void setBrightness(double brightness)
endA Hotkey definition which can be enabled or disabled, loop them and enable / disable en masse to do modal style control of your desktop.
class Hotkey
boolean enable()
void disable()
String key()
Array<String> mods()
endThe position of the mouse, captured and restored to and from a Point
class MousePosition
static Point capture()
static void restore(Point mousePoint)
endA simple point object for 2D coords.
class Point
property double x
property double y
endA simple 2D size object
class Size
property double width
property double height
endYou guessed it, a 2D oblong.
class Rect
property double x
property double y
property double width
property double height
end