Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
This repository contains a number of very diverse tools implemented in different languages, some of which are independent, others are part of KanoOS apps, and therefore they rely on them.
The best way to develop is to read through the README file if available, or jump straight into the source code for those that are simple enough.
Remember that all the code is to be run on an ARM architecture, therefore you need a RaspberryPI or equivalent and a Debian based Linux system. The complete package can be build on a ARM root jail as well.
In KanoOS we needed a way to detect a special key sequence during bootup, which enabled us to switch to a safe display mode. This tool resolves this problem.
The Linux keyboard driver provides an IOCTL called
EVIOCGKEY known as Get Input Keys Status. This facility basically means that the currently pressed keys on the keyboard can be determined with a single system call.
Since the call returns immediately, this tool provides 2 extra parameters (delay and repeat values) so that we can give some time for the user to hold these keys during the bootup process.
You can learn more about
EVIOCGKEY facility in the Linux Kernel sources, in
kano-splash is a tool which displays a splash screen when our apps are started. Much of the code is based on the hard work of Andrew Duncan. It uses the dispmanx API to display a png file over the X11 screen. Usage information can be found in its README file.
Since many apps are resource hungry, and our younger users may not be sophisticated enough to realise that an app is running poorly because another app has been left open, we call our apps through a tool, kano-launcher, which closes the other apps. This restriction is lifted on the Raspberry Pi 2 platform, which has enough resources to leave apps running. For more information on kano-launcher, see its README file.
kano python modules
Kano toolset python modules provide for several general use aids for the desktop UI. The two most remarkable ones are
Window: Manipulate desktop apps windows
Allows you to manipulate desktop windows on the desktop: position, size, decoration. It adds the capability to wait for the window to appear on the desktop, to avoid visual flickering noise.
Practical usage example:
- Launch xcalc from a terminal, it will appear centered on the desktop
- Tell kano toolset to move the Calculator to the top left corner of the screen
from kano import window calc=window.find_window(title=‘Calculator’) window.gdk_window_settings(calc, x=0, y=0)
WebApp: A simple yet powerful web browser
Based on the Webkit engine, it makes it very easy to get a fully working browser on the Desktop with minimal effort.
Here’s a quick example:
#!/usr/bin/python # # Kano Toolset opening a fully fledged Web browser from kano.webapp import WebApp class MyBrowser(WebApp): def __init__(self): super(MyBrowser, self).__init__() self._index='http://world.kano.me' self._title='My first browser' self._width=600 self._height=400 self._y=5 self._x=800 if __name__ == '__main__': w = MyBrowser() w.run()
This will open a browser window on the desktop which will render the
echo "alert(\"Hello Kano\")" > /tmp/webapp.pipe