A tiny tool for building native desktop applications using WEB technologies.
You can compile it from source, using the scripts or, just download the latest binary using the following commands:
# Download the deb package
$ wget https://github.com/IonicaBizau/bat/raw/master/dists/deb/64bit/dev-release.deb
# And install it
$ sudo dpkg -i dev-release.deb
You can just download the latest binary package using the following commands:
# Download the binary package
# Using curl
$ sudo curl https://github.com/IonicaBizau/bat/raw/master/dists/osx/Bat -o /usr/bin/bat
# (OR) Using wget
$ sudo wget -O /usr/bin/bat https://github.com/IonicaBizau/bat/raw/master/dists/osx/Bat
If you prefer to compile it from source, execute the following command(inside source
directory) before running the provided scripts:
# Add CONFIG -= app_bundle into Bat.pro file
$ echo "CONFIG -= app_bundle" >> Bat.pro
There are no binaries available for Windows. The application needs to be compiled on Windows. Contributions are welcome! π
$ bat --help
Usage: bat [options]
Options:
-h, --help Displays this help.
-v, --version Displays version information.
-t, --title <title> Sets the window title on start.
-s, --size <WxH> Sets the BAT window size.
-d, --document <path/to/file.html> The path to the document you want BAT to
load.
-u, --undecorate Starts BAT with an undecorated window.
--tt, --tooltip Starts BAT with a tooltip window.
-m, --most If TOP is provided, then the window is
keept on the top of the other windows. If
BOTTOM is provided, the window will be in
the behind of all windows.
--debug Starts BAT in the debug mode.
The following functions are implemented for the 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) |
|
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. |
Have an idea? Found a bug? See how to contribute.
Another way to support the development of my open-source modules is to set up a recurring donation, via Patreon. π
PayPal donations are appreciated too! Each dollar helps.
Thanks! β€οΈ