New project:KiLauncher

Last night i uploaded a new project to my github page, KiLauncher. Β It’s a fullscreen, static (as in not auto-updating) launcher menu aimed at kiosks, kids computers, corporate systems, and any other situation where an administrator wants to be able to both provide a simple interface and exercise some control over what applications are available to the user.

The software is still in the early stages, of course; I’m still working out the best way to structure the config file; yet it meets all its primary goals at this point and works just fine. Β It’s built in python and QT of course, and after my positive experience using YAML in wcgbrowser, I’m of course using it for KiLauncher too. Unlike wcgbrowser, I don’t have a real-world use for this software yet, but maybe someone who does can give me some feedback on it.

12 Thoughts on “New project:KiLauncher

  1. Stefan Baur says:

    Hi Alan,

    here’s some feedback regarding kilauncher.

    ——————————————
    Please move stylesheet and config to ‘/etc/kilauncher/*’. It makes /etc/ less messy, and also makes it easier to package and include kilauncher into various Linux distributions.

    If I’m not mistaken, the following two patches to kilauncher.py should fix that:
    218:
    – self.stylesheet = kwargs.get(“stylesheet”) or config.get(“stylesheet”, ‘stylesheet.css’)
    + self.stylesheet = kwargs.get(“stylesheet”) or config.get(“stylesheet”, ‘/etc/kilauncher/stylesheet.css’)
    289:
    -config_locations = [‘/etc/kilauncher.yaml’, ‘~/.kilauncher.yaml’]
    +config_locations = [‘/etc/kilauncher/kilauncher.yaml’, ‘~/.kilauncher.yaml’]

    Since the documentation is in the config, we need to change kilauncher.yaml as well:
    13:
    -# Default: stylesheet.css
    +# Default: /etc/kilauncher/stylesheet.css

    A Bug:
    Tabs/Titles/Exit button don’t show if number of tabs equals 1.
    While I could live with the tab title not being displayed, having no exit button is bad. πŸ™
    Not sure how to fix that, though. I’m not a python programmer, I just prodded the code until it worked. πŸ˜‰

    Another bug:
    At least when using desktop_path (haven’t checked for individual launchers, but I’m guessing you’ll have the same issue there), you’re assuming that if you can see that the entry exists, you can read it, thus you display it.
    If the directory contains *.desktop files that are for certain user groups only, this leads to unneccessary broken launchers.
    Please only display a launcher button when you detect that you have read permission on the particular *.desktop file.
    Some people hide administrative tools by changing group ownership to an administrative group and removing the “world-readable” right.

    Feature requests:
    1) It would be cool if kilauncher could figure out the available screen width by itself and group launcher items automagically instead of requiring an integer value (n) in “launchers per row: n”. There may be use cases where specifying a maximum numer may be useful, so I would suggest adding an allowed value of 0 or “auto”.
    2) It would be cool if the horizontal and vertical distance between the launchers could be changed.

    Info:
    For Debian Wheezy, I found I had to run this installer command to get kilauncher to run. This list may be incomplete, as I didn’t try it on a freshly installed system, but rather one that serves as development box.

    apt-get install python-qt4 python-xdg yaml python-yaml

    (plus “apt-get install tint2” for your suggestion on how to actually use kilauncher)
    ——————————————
    I would love to hear from you regarding my patches, ideas and requests (my mail address may look strange, but it works the way I entered it).

    Kind Regards, Stefan Baur

    1. Alan says:

      Thank you for taking the time to report these things. I will definitely look into this stuff when I get a chance. I think you’re right about the /etc location especially.

      I’m assuming you don’t have a github account, but in case you do, it’s always best to report issues there rather than the blog. If not, I understand; and I do appreciate you reporting it however you can.

      1. Stefan Baur says:

        Nope, sorry, I don’t have a github account yet. I don’t really consider myself a coder (I’m more of a bash/perl sysadmin guy), so, up until recently, I never saw the need for a github account. Since a customer of mine started publishing his code on github, though, I might either gain access to his account soon (committing stuff on his behalf) or create my own one. πŸ™‚

    2. Alan says:

      I just uploaded changes to KiLauncher.

      – I added the suggested config and stylesheet paths. It will still automatically find a config file at the old locations, but /etc/kilauncher/kilauncher.yaml works too.

      – .desktop files that can’t be read will be skipped when a directory was specified, and a warning will be sent to stderr. As for an unreadable .desktop file that was manually specified, this is trickier. I don’t just want to ignore it, because the user may have specified some override variables. It kind of seems like the user’s fault if they manually specifiy a file that they don’t have read access too (and given that this isn’t software aimed at non-technical users, that seems ok). I decided just to log a warning to stderr and go on with a blank, useless button.

      1. Stefan Baur says:

        A big “thumbs up” for the quick response. πŸ™‚

        Your idea of logging inaccessible files to STDERR instead of simply moving on (as was my original idea) sounds reasonable.
        I probably won’t get arund to test drive your new code until Wednesday, though. πŸ™

        Judging from the diffs, I guess that the bug about the tab title and the exit button not showing when there’s only a single tab to be displayed is still present?

        Kind Regards, and again, thanks!
        -Stefan

        1. Alan says:

          Yes, I haven’t gotten to that one yet. It’s a bit deeper, because the button is specified as the “corner widget” of the tab widget. Apparently if you hide the tab bar, this widget is hidden as well. That may be configurable, but if not I’ll have to figure out a workaround.

          The tabs hiding if there is only one tab is by design, though; it makes no sense to show tabs if there’s only one. I suppose that could be configurable if you really wanted to see the tab.

          1. Stefan Baur says:

            Hi, Alan!

            Not showing the tab title in case of a single tab is something I could totally arrange myself with. It could be used to display a greeting/welcome message/ownership notice or something like that, though.
            Think “Springfield Library – Available Applications” or something like that.

            If the single tab is the reason the exit button disappears, maybe adding an extra button “Exit” among the other launcher buttons would be an easy workaround?

            Is there a way (in Python, and in particular, in kilauncher.py) to pass the current process ID to a program started by a launcher button?

            If so, something like this might work:


            name: “Exit”
            comment: “Click/Tap here to log off.”
            icon: “ExitLogoGoesHere”
            command: “/usr/bin/kill $MYPROCESSIDHERE”

          2. Alan says:

            Now that I fixed the exit button thing, I wanted to mention two other points that might help you:

            – If you simply omit “launchers_per_row”, the default behavior is to auto-calculate based on screen size. This was already the default behavior, I’d just forgotten it until I got back into the code.
            – The tab description text accepts basic HTML tags like headlines, bold, italic, etc. So if you want some kind of title on a single-tab launcher, the simplest way is just to put it in the description between H1 tags.

          3. Stefan Baur says:

            Hi Alan,

            I solved it like this:

            1:
            name: “Quickstart Menu – Title not shown anyways”
            desktop_path: “/path/to/desktopfiles/*.desktop”
            icon_size: 48×48
            launchers_per_row: 4
            launcher_size: 280×100
            launchers:

            name: “Exit”
            comment: “Click/Tap here to log off.”
            icon: “whatever-you-want-it-to-be”
            command: “/usr/local/bin/exeunt”

            with /usr/local/bin/exeunt containing

            #!/bin/bash
            kill $(awk ‘ /^PPid:/ { print $2 } ‘ /proc/$$/status)

            I’m sure you’ll be able to come up with a mor eelegant solution, though. πŸ˜‰

            Kind Regards,
            Stefan

  2. Jason says:

    I am not savvy in Linux enough to do what is required to get this running for a project I am working on to refurbish old laptops from freegeek to send to Native Americans to remote areas in Alaska.

    One of the user types will be elders that have never used a computer before however want to use it to connect and communicate which is where I think your locked down launcher can help. I am wondering if you can generate a base installer ISO (or at least an img) with your program already set for auto launching, and where all the configuration can be done using nano in terminal and including apt-get package manager. I considered xPud however that seems abandoned, very limited in repository and under developed. And if there is some basic file manager that makes it possible to only see mounted drives and the folders in home. Auto-mount would be best. Would be happy with a foot print of 100mb more or less. If you would like to help with this project and learn more please shoot me an email.

    Would love to see a screen shot as an example, too.

    Regards,
    Jason

    1. Alan says:

      I don’t think I want to commit myself to creating something like that at this point in time. I don’t really have a solution for the file manager lock-down offhand. Since even a base install of Debian is at least 600mb (may be larger now, last time I checked was on Squeeze), 100mb is a tall order. You could probably do something like this with TinyCore, but that limits your application selection somewhat.

      What would be more generally beneficial to the project, and what might be more in the scope of my available time and resources, is if you could suggest a basic use case and configuration spec from which I could write a basic configuration file and maybe an installer script that would take you from a standard Debian install to a working kiosk. I feel like the examples I’ve provided are a little weak and contrived, it would be nice to present some useful base configurations with a certain use case in mind.

Leave a Reply

Your email address will not be published. Required fields are marked *