Fork me on GitHub

BAT

A minimalist tool for building native desktop applications using WEB technologies.

Download .zip Download .tar.gz View on GitHub

Installation

# Download the deb package
$ wget https://github.com/IonicaBizau/bat/raw/master/deb/64bit/64-dev-release.deb

# And install it
$ sudo dpkg -i 64-dev-release.deb

Demo

We can create custom windows with CSS, HTML and JS, loading them with BAT.

JavaScript API

Function name Arguments Description
BAT.closeWindow() No arguments Closes the window
BAT.resize(width, height); width - the new width of the window, height - the new height of the window Resizes the window
BAT.setWindowFlags(type)
  • UNDECORATED - undecorates the window
  • BOTTOM_MOST - puts the window on the background
  • TOP_MOST - puts the window on the top
  • REMOVE_MINIMIZE - removes the minimize button
  • REMOVE_MAXIMIZE - removes the maximize button
  • REMOVE_CLOSE - removes the close button
Sets the window flags
BAT.setWindowState(value) One of the following values: MAXIMIZED, MINIMIZED, FULLSCREEN, ACTIVE, RESTORED Sets the window state
BAT.getWindowSize() No argumnets Returns an object that contains width and height fields that represent the sizes of the window.
BAT.getWindowPosition() No argumnets Returns an object that contains top and left fields that represent the coordinates of the window.
BAT.setWindowPosition(top, left) top and left coordinates for the new position of the window Sets the new position of the window on the screen.
BAT.getMousePosition() No argumnets Gets the mouse position on the screen.
BAT.setMousePosition(x, y) x - the x coordinate of the mouse, y - the y coordinate of the mouse Sets the mouse position on the screen.
BAT.debug(message) message - string that will be printed in the console Outputs a message in the terminal.
BAT.setWindowTitle(newTitle) newTitle - string that represents the new title that you want to set to the window Sets the new window title.
BAT.inspectElement() No arguments Opens the BAT developer tools window.
BAT.runBash(command) command - string that represents the command that you want to run in the bash via BAT. Runs a bash command.
BAT.getScreenSize() No arguments Returns an object that contains width and height fields that represent the sizes of the screen.

How to hack?

Do you want to contribute? Great! There are few steps to do this.

  1. File an issue in the repository, using the bug tracker, describing the contribution you'd like to make. This will help us to get you started on the right foot.
  2. Fork the project in your account and create a new branch: your-great-feature.
  3. Commit your changes in that branch.
  4. Open a pull request, and reference the initial issue in the pull request message.