-
Notifications
You must be signed in to change notification settings - Fork 11
Development
- Make sure you install and start Kano DevBox
- Install kdesk using the icon on the desktop
- Now you will be able to run and develop kdesk on Kano DevBox!
- Open a terminal and type
kdesk &
From the base directory you can invoke make to build a release version: $ make
Alternatively, if you prefer to work on further development you should build a debug version: $ make debug
The debug version will inline debug statements across all major operations to easily follow up the code. The debug statements are defined as inlined code, which means they are completely removed on release versions, hence compacting the binary and speeding up the work.
You can easily tell if you are running a debug build because the desktop icons will show a narrow black border. To build the Debian package just execute the following: $ debuild -us -uc
The binaries are self-contained in 2 files: kdesk and kdesk-eglsaver. Their runtime and build dependencies are defined in the file debian/control.
kdesk plays well under Kano OS, Debian-based systems and also on Intel. You can run it on top of a VNC session using Fluxbox or other window managers during testing/development.
Locating a bug at run time can be quite tricky sometimes. You can tell Linux to save a core dump file for you to inspect the crash afterwards:
- edit /etc/sysctl.conf and add the line
kernel.core_pattern = /tmp/core-%e-%p
- edit /etc/security/limits.conf and add the line
* soft core unlimited
Reboot the system. You can easily test it with kill -s SEGV $(pidof kdesk)
.
A dump file will be available under /tmp which you can inspect like this:
$ gdb /usr/bin/kdesk /tmp/core-my-pid
If you use kdesk-dbg instead, you will get a complete source code stacktrace with the bt full
command.
When it comes to testing your desktop apps running through kdesk, there is one very useful tool that greatly simplifies the process and avoids having to do it manually. It is also a great choice to prepare interactive GUI sessions and play them back to the audience on a big screen.
Just follow these simple steps:
$ sudo apt-get install xnee
From an ssh session start a recording GUI session
$ export DISPLAY=:0
$ cnee --record --mouse --keyboard -o myplayback.xns
At this point all interaction on the desktop is being saved to the file. Once complete just hit Ctrl-C to stop recording. Below is an example to replay a session over and over, including a kdesk icon refresh request after each iteration:
#!/bin/bash
while :
do
cnee --replay --mouse --keyboard -ns -sp 200 -f myplayback.xns
sleep 3
kdesk -r
sleep 5
done
kdesk-eglsaver is kdesk openGL screen saver. The source files can be found here.
Just type $ make
You will need to change the variable OPTDIR
in the Makefile to point to your Raspberry /opt
include files and libraries. Usually this is provided by the Raspbian package "raspberrypi-firmware".
Icons are in raw byte format, no encoding, for faster load times.
In order to convert the icons for the cube surfaces, they must be 128x128, 3bpp and no alpha channel. To obtain these raw formats use imagemagick and follow these simple steps:
$ convert source.png -resize 128x128! -alpha off clean.png
$ convert clean.png -size 128x128 -endian LSB -flip rgb:source.raw
This gives each bitmap a small size footprint of 45K Bytes.
The default build process will provide 3 sample Kano bitmaps embedded as C array structures, so the binary does not rely on external files and at the same time loads a bit faster.
You can provide your own screensaver program. In such case please keep in mind the following rules to integrate nicely into kdesk:
- Provide an initial wait delay of approximately 1 second for seamless user experience.
- Periodically listen for user input events from keyboard/mouse (/dev/input is a good source)
- Upon reception of user input, just terminate the program and kdesk will take over control
- If you'd like kdesk to refresh the graphical desktop upon termination, set your return code to 0, any other value will not refresh the X screen.