Developer

eXtern OS uses Nw.js as front-end to run Apps. Most of the documentation can be found on the official Nw.js documentation page.

Important: Due to a change made in the base code in the last moments before Beta 1 release affects new Apps created using the DevKit. The template package.json for your apps needs to have the “window { show:…}” set to true instead of false. Otherwise your App window will not show. If you ended up running your app and you can’t close it, select the power option on the bottom explore bar and chose “refresh”. This will not restart your computer, but restart Node. You changes will be remembered.

There are important changes from the official Node.js API you need to know about.

  • Window.open(url, [options], [callback]) is currently not implemented yet. Although this will be implimented later, due to the UI set up of eXtern OS, it is recommended to avoid multiple windows whenever possible. You can have your app still open in multiple windows/instances by specifying this in your manifest file with:

    multi_window" : true

    See example Apps for more info

  • Window.openFiles = function(files) { }; is used to handle files “pushed” to that App. You need to do this (i.e override the function) to handle new files pushed to the app. This function can be called at anytime especially if multi_window is disabled. Here is the full example of how to use it. This might change soon, however, it is currently this way:

    win = nw.Window.get();
    win.onOpenFiles = function(files) {
    /*Handle the files array here*/
    }

    See example Apps for more info

  • Window.fileTypesApps is an array. It contains installed apps under different categories as defined here:

    fileTypesApps = {
    audio : [],
    video : [],
    image : [],
    text : [],
    web : []
    }

    See example Apps for more info

  • Window.fileTypesApps.prefferedFileTypesApps is an array (a sub-array). It contains installed apps that are preffered for each corresponding category. It is defined the same as the parent array Window.fileTypesApps with different categories as defined here:

    fileTypesApps.prefferedFileTypesApps = {
    audio : [],
    video : [],
    image : [],
    text : [],
    web : []
    }

    See example Apps for more info

  • Window.openApp(AppId, [files]) is a function that handles opening files using a specified App. Files should be an array even if it is only a single file. One way to accomplish this can be done like this:

    win = nw.Window.get();
    var files = []
    files.push(file);
    var requiredApps = win.fileTypesApps.prefferedFileTypesApps;
    win.openApp(requiredApps.web.id,files);

    See example Apps for more info

DevKit

In order to create eXtern compatible apps, you need to create an eXtern App project or open one. .

You need to enable developer mode in eXtern OS to view console information, inspection etc. This is currently not available and will be enabled by installing the sdk through the App store soon.

UI Elements

DevKit will have almost all of the important UI elements defined in Beta 2. The UI uses stylized bootstrap theme, so as a rule of thumb, a bootstrap element, plugin etc will work well with eXtern. Check this page in the next couple of days for sample apps. However, here are a few important ones:

  • Buttons


    <!--a tag/link based button. An example of a large button using the "btn-lg" class -->
    <a class="btn btn-alt btn-lg"> Hello </a>

    <!-- Button tag based button -->
    <button class="btn btn-alt m-r-5"> Hello </button>

    See example Apps for more info

Advanced

Since eXtern as of Beta 1 does not have a terminal, you can use the Linux binary powered gnome-terminal. You can do this by typing this into the I.T.A.I assistant input area (the bottom input area that says “What would you like to do?”:


gnome_terminal_exec

Then press enter.