Technical discussions | Discussions techniques
Guest, Sunday 13 December 2015 à 12:55
|
|
|
Hi There,
I'm working on building a cairo-dock applet in python for my nodeutil suite (http://antisol.org/nodeutil, https://github.com/AntiSol/nodeutil). This is an ADSL usage meter for the Internode ISP here in Australia. My existing codebase already has a CLI tool, a gnome applet, and an applet for the avant window navigator, and I want to make it also support cairo dock. I have looked through the documentation at http://www.glx-dock.org/ww_page.php?p=Documentation&lang=en#4-Writing%20easily%20an%20applet%20in%20your%20favorite%20language%20%28Python,%20Ruby,%20Vala,%20Mono,%20Bash,%20etc.%29 and I have some questions:
1. Is is possible to define the name of the applet using something other than the filename? For instance I'd like to have the file be named cairo-applet.py but have it show up in cairo dock as "Internode Usage Meter". I don't see any way to do this other than using symbolic links to e.g create a symlink named ~/.config/cairo-dock/third-party/Internode Usage Meter which points to /path/to/cairo-applet.py, is it possible to set the applet name in a config file somewhere? If so, how?
2. Regarding the [Icon] and [Desklet] parts of auto-load.conf - is there a set of stock items which I should be including, e.g many/most of the applets include "name of the dock it belongs to" in the [Icon] section and "position" in the [Desklet] section. Is this stuff handled automatically by cairo dock or is there something I need to do?
3. Is there a way to have default configuration items computed at runtime? In particular I want to be able to load the username and password (if there is one) from the existing gconf mechanism and have it show up in cairo dock automatically rather than the user having to re-enter it. I'm able to load the config items via gconf but I'd like to have them show up in cairo dock's configuration screen automatically. I've found that if I write the configuration file in the get_config method with the code like the following:
def get_config(self):
username = keyfile.get("Configuration","username")
if username == "":
#get configuration via gconf
username = self.gconf_client.get_string("/apps/internode-applet/username")
f = open(self.cConfFile,'w')
keyfile.write(f)
f.close()
This mostly works, but when the keyfile.write() code is called during startup, cairo dock shows an empty configuration window for my applet. If I then restart cairo dock it works fine and the values are shown correctly. Is there a better/correct way to do what I want? Should I just bypass the cairo dock config mechanism and use my own gconf/gtk preferences window?
3. Is there a preferred way to build/show GTK dialogs from a cairo dock applet? I'd like to have the GTK dialog show when the user clicks on my applet showing detailed usage statistics (you can see the dialog here: http://antisol.org/nodeutil/Screenshot-0.png). Is there a mechanism for this?
I hope my questions make sense. Please ask if there's any more information you'd like or anything i can do to clarify.
Also if these are stupid questions and there is a more detailed info/reference on working with cairo dock in python which I've missed, please let me know.
Thanks! |
Guest, Wednesday 16 December 2015 à 02:54
|
|
|
One More:
4. How to set the tooltip of my cairo dock icon? |
Guest, Thursday 01 September 2016 à 18:22
|
|
|
Wow, what an overwhelming response! Thanks! |
Subscription date : 04 October 2016
Messages : 1
|
spam |
Technical discussions | Discussions techniques
|