kcheckrunning.

Allen Winter winter at kde.org
Sat Dec 15 15:32:25 GMT 2007


On Friday 14 December 2007 16:42:36 Tom Albers wrote:
> Hi,
> 
> Ade noticed that startkde is using kcheckrunning:
> 
> --
> if kcheckrunning >/dev/null 2>&1; then
>     echo "KDE seems to be already running on this display."
> --
> 
> kcheckrunning has been moved to playground/base/kdesktop. 
> 
> The startkde script does not seem to fail when kcheckrunning does not exist (on linux), but I can not imagen it works either ;-)
> 
> So, what would be the solution?
> 
Seems like a useful check to me.
kcheckrunning is a 5 line program.

Should I bring kcheckrunning back into kdebase/workspace?

here's the code:
#include <X11/Xlib.h>
int main()
    {
    Display* dpy = XOpenDisplay( NULL );
    if( dpy == NULL )
        return 1;
    Atom atom = XInternAtom( dpy, "_KDE_RUNNING", False );
    return XGetSelectionOwner( dpy, atom ) != None ? 0 : 1;
    }





More information about the kde-core-devel mailing list