Ikke's Blog

Post details: Common interfaces

Apr 11
Common interfaces

The recent discussion on desktop-devel on the inclusion of GNOME Power Manager into the 2.16 desktop release (big thanks to the developers for this software, it took a while to get suspension working on my desktop but now it does, I really like GPM even if it's no laptop) ended up in two completely different discussions: the usage of notifications (libnotify) and the notification area versus normal applets, and sharing a base daemon with eg the KDE power manager (somewhat related to what NetworkManager does: a central daemon running as root, and a client applet on top of that, using DBus for IPC, although the power management daemon should not run as root, as all privileged tasks are handled by hald, which runs as root).

The second issue is one which interests me a lot, as more than a year ago (IIRC I was still using Windows as main desktop at that time :oops: as my Linux machine was too slow to run any desktop app) I sent an email to the XDG list about what was to become CDIS, the Common Desktop Interface Specification (the email I link to is just the first of bunch of long threads, from the initial idea almost nothing was kept). Lots of email on the list later, no actual result came out of it (which is mainly due to me).

Shared interfaces are, just like open file formats etc, very important. We got some great desktop specifications that ensure a developer his/her code and application will work on all platforms supporting the specification. Think of the notification area spec, autostart spec, .desktop files,...
Shared IPC interfaces (think DBus) are very important too. In the case of a power management app like GPM or it's K* equivalent, they should both use the same interface for several functions, eg "DontHibernateNext5Minutes" (dumb and useless example, but hey). If I write an application that doesn't need user input, but does a lot of work (think of a CD burning app), I don't want the machine my software runs on hibernates during the burning process, whilst it's perfectly possible the user leaves the machine and his sessions idles out. But I don't want some construct like

if(user_runs_gnome)
    do_gpm_dont_suspend_call();
if(user_runs_kde)
    do_kde_power_manager_dont_suspend_call();

or something alike. Maybe this isn't a big issue for some simple program, but think of a large app that should be cross-desktop made by some ISV...
Same thing for a DVD player: I don't want to notify both gnome-screensaver, kde-screensaver and whatever they shouldn't pop up next minute, I just want to notify the org.freedesktop.ScreenSaver service it shouldn't take control of the desktop.

Another sample: I'm a VoIP softphone (think Ekiga), and I get an incoming call. Obviously, I'd like all media players that might run on the current console/desktop to pause. I don't want to send one signal to PlayerA using some custom socket, one to PlayerB using his own DBus interface! I just want to notify all media players they should pause, and send a "Pause" signal to (eg) org.freedesktop.CDIS.MediaPlayer. When the call is ended, I could send a "Resume" signal to the same object path.

I don't know whether all this is possible using DBus, still need to read the docs once again (there's some black magic in there, really!), but I guess you get the idea.
Obviously, an application implementing a CDIS interface can also implement extra functionality, and if multiple applications start implementing the same extra functions, this functionality might be added to the a new version of that interface spec. Like this, we never limit the service developers. There can even be "NotImplemented" errors etc.

The only thing we need is getting some developers together in all fields to write down such a spec in some standard format. Not too many people though, so there's less chance of huge flamewars and more results.

Some application types I think of now that can use a shared interface:

  • Screensavers
  • Power management
  • Media players
  • Instant Messaging apps ("SetStatus(STATUS_AWAY)",...)
  • Email clients ("NewMailArrived")
  • ...

Maybe it's time to get this on XDG again...


Completely unrelated: dear lazyweb, within a month or so (at least, I hope) I should get a laptop computer (Asus W3J, dualcore 2*1.83Ghz, 1GB, 80GB, pretty cool stuff). Obviously I'd like to run Linux on the machine (oops, GNU/Linux, sorry!) once I can, as it got an ATI X1600 GPU which is completely unsupported today.
I was thinking to run both Gentoo Linux (like I do now on my dekstop) and Ubuntu on it: Gentoo for development things and just playing around, Ubuntu as "serious" desktop and university stuff. Next to that I also need Windows on it (some university soft is Windows-only).
I wrote down a possible partition layout for this setup today, and got some questions about it:

  • Will this work? The Gentoo part will, as that's +- what I run now, but will Ubuntu be able to handle a foreign bootloader, and the LVM stuff?
  • Won't I get in trouble by sharing my homedir between both distributions? I shouldn't, but there are no more certainties in life these days

Thanks!

Comments:

Comment from: RubenV [Visitor] · http://www.Lambda1.be/
As you might (or might not) remember, I was a very big fan of this idea and I'm glad that it's back. This is a huge thing to ISVs, highly desired!
PermalinkPermalink 04/11/06 @ 20:45
Comment from: David Mills [Visitor]
OK, Lazy web here :-P

-Ubuntu should be able to handle a foreign bootloader, and as far as lvms are concerned, just tell the partitioner to handle a partition as a lvm and you're laughing :).

-For the lvms: the system lvm won't be able to grow more than 512M, since it's partition is more or less that size, I'd use just 1 lvm for everything, like that you can grow or shrink any section as needed.


HTH

David
PermalinkPermalink 04/11/06 @ 22:14
Comment from: Ikke [Visitor] · http://www.eikke.com
As mentioned in the document, vg-system will be 10GB bigger than the necessary space, so I can grow as necessary.
I made the split into 2 VGs so I can eg drop all Ubuntu lv's if I want to get rid of ubuntu on my system, and then doing a vgresize without the risk of losing any real data...
PermalinkPermalink 04/11/06 @ 23:58
Comment from: Ali [Visitor] · http://hybrid.tuxfamily.org
This might be a very good idea, and it's not that hard to implement, FreeDesktop should define a set of DBus interfaces (org.freedesktop._media, ._screensaver, ._power, ._im, ._mail ...) and every application that relate to some category should bind on them. This will have really huge benefits on the desktop usability.
PermalinkPermalink 04/12/06 @ 08:24
Comment from: luis gutierrez [Visitor]
Hi Ikke,
you shouldn't have serious issues for sharing your home folder between ubuntu and gentoo (just make sure they share the same user ID ##).
My problem has been with grub configuration, particullary ubuntu being a nasty player and erasing the gentoo configs.
PermalinkPermalink 04/12/06 @ 22:40
Comment from: Ikke [Member] · http://www.eikke.com
Good catch about the UID, I should take care about that indeed.
Maybe I could just let ubuntu access my Gentoo /boot too, and use Ubuntu's grub unstead of Gentoo's, which would solve all problems :)
PermalinkPermalink 04/17/06 @ 00:36

This post has 3 feedbacks awaiting moderation...

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

Categories

Who's Online?

  • Guest Users: 468

Misc

XML Feeds

What is RSS?