On KDE there is probably some dbus call that will do the trick.