Code Monkey home page Code Monkey logo

bat's Introduction

BAT - Build Awesome Tools For Desktop using WEB Technologies

Patreon PayPal AMA Version Downloads Get help on Codementor

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

Installation

Linux

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

Mac OS X

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

Windows

There are no binaries available for Windows. The application needs to be compiled on Windows. Contributions are welcome! πŸ˜„

Help

$ 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.

Demo

Demo

JavaScript API

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)
  • 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
  • TOOLTIP - converts the window in a tooltip
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 contribute

Have an idea? Found a bug? See how to contribute.

πŸ’° Donations

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! ❀️

πŸ“œ License

MIT © Ionică Bizău

bat's People

Contributors

dooma avatar ionicabizau avatar silviubogan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.