Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am building a app with quickly, and I wanted to add a daemon that will run in the background. How do you do this?

share|improve this question
You should take a look at D-Bus. – ADcomp Jul 2 '12 at 21:38
Please provide a link to the quickly homepage. With a name like that one cannot google it. – dotancohen Jul 3 '12 at 10:50
What is this deamon supposed to do? Does it need to be public or just for your application? – Timo Jul 3 '12 at 13:30
@dotancohen Done. Although I'd suggest the import bit is that it's in Python. – 8128 Jul 3 '12 at 16:23
@Timo I can't speak for Vigesh, but for my bounty I'm looking at something just for my application – 8128 Jul 3 '12 at 16:23

As far I know there is nothing specific in quickly to prevent or assist you with running daemons, but there is at least two options I know/guess you can do it with python:

Option #1: Distutils

NOTE: I didn't tried this one yet :)

  1. put your daemon script into the bin directory of your quickly project, e.g.: bin/yourapp-launcher

  2. add the following into the data/yourapp-launcher.desktop file:

    [Desktop Entry]
    Name=Your App
    Exec=/bin/sh -c 'yourapp-launcher'
  3. edit and specify additional data_files in DistUtilsExtra section, e.g.:
    #author='Your Name',
    #description='UI for managing â¦',
    #long_description='Here a longer description',
    cmdclass={'install': InstallAndUpdateDataDirectory},
    data_files=[('/etc/xdg/autostart', ['data/yourapp-launcher.desktop'])]

Seems a way to go when daemon must be running for all users, e.g. similar how U1 works.

Option #2: Hardcode

Hardcode everything into your app logic, for example initialize ~/.config/autostart/yurapp-launcher.desktop on the first run, e.g. similar to how GmailNotify App does it.

Unlike GmailNotify App you can relie on the python-xdg library to access standards:

import xdg
print xdg.BaseDirectory.xdg_config_home

Seems good for user managed daemons.

share|improve this answer

From what I can see there is no template to add a daemon in quickly. However, you can contribute by creating a daemon template. How to create your own template is explained in the answer to this question: How to create a new quickly application template

You could also join the community templates group at Launchpad, to make your template available for others to use.

EDIT: There is also the Unity lens template. It will only work with Ubuntu Unity, so you will be platform dependent (rather significant weakness if you ask me). But it seems to have D-Bus things ready from the start. Kind of like a daemon, but maybe not quite. You could use this as a starting-point to create a platform independent daemon, perhaps...

I don't know any details other than what I can link from others, sorry. Just looking at this myself to find out how to use Qt4 with quickly. EDIT2: Just found that there is a D-Bus component to Qt, which would make your daemon platform independent (working on Windows and Linux etc). This discussion forum ( has an example (in C++, but still) of how to use it. Or you can google for QDBusConnection and QDBusMessage.

share|improve this answer

Looking through the Quickly docs, it seems that Quickly does not natively support creating daemons. Therefore I suggest the Python Daemon Library. Also, go over the following Python tutorials that could be interfaced easily from a Quickly application:

Also, this Stack Overflow question addresses Python daemons.

share|improve this answer
I have gone through many of the links, but I am looking for a recommended way to connect my quickly GUI app and a daemon that will run in parallel.The daemon has to be packaged with the same app and should be started on boot. – Vignesh Jul 3 '12 at 18:42
Again, Quickly does not support this. You will have to graduate the application from Quickly to 'real' Python. That is why I provided the example links. – dotancohen Jul 4 '12 at 4:37

Python 3.3 will have a daemon module for the management of daemons.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.