Comment 36 for bug 494067

Revision history for this message
In , Llunak (llunak) wrote :

Determining if running in KDE: see KDE_FULL_SESSION in /usr/bin/startkde.

The interface from comment #6:

- isDefaultBrowser:
===
browserapp=$(kreadconfig --file kdeglobals --group General --key BrowserApplication)
if test "$browserapp" = "MozillaFirefox" -o "$browserapp" = "!firefox"; then
  echo Yes it is
fi
===

- setDefaultBrowser:
===
kwriteconfig --file kdeglobals --group General --key BrowserApplication MozillaFirefox
===

- setDesktopBackground:
probably no easy way right now, will check

- openApplication:
We do not really have a usercase of just opening a mail client without anything, there is only API for opening mailto: URL. But it can be read from settings:
===
profile=$(kreadconfig --file emaildefaults --group Defaults --key Profile)
client=$(kreadconfig --file emaildefaults --group "PROFILE_$profile" --key EmailClient)
if kreadconfig --file emaildefaults --group "PROFILE_$profile" --key TerminalClient --type bool; then
  term=$(kreadconfig --file kdeglobals --group General --key TerminalApplication --default konsole)
  client="$term -e $client"
fi
if test -z "$client"; then
    client=kmail
fi
echo $client
===
We do not have a setting for news reader at all. Just use "knode".

- desktopBackgroundColor
Is this supposed to actually do something and in which directions? Otherwise it's the same like with the wallpaper.

- openApplicationWithURI:
I'm not sure I get this one, what is it supposed to do other than "<application> <url>" ? Download the file first if necessary? Also, why does the application need to be specified, why not simply ask that URL to be opened, by whatever the desktop finds appropriate?
Opening an URL by whatever KDE finds appropriate is the "kde-open" binary. Downloading the contents of the URL and opening locally by an application is "kioexec" binary (which is not in $PATH and is to be located using "kde4-config --type exe --locate kioexec"). Using that one however is most probably wrong with KDE (that's why it's internal), since most KDE applications can handle URLs directly.

- defaultFeedReader:
Is this supposed to be the default RSS reader? We do not have a setting for this, I don't use RSS, but I think here you simply want to use "akregator".