Question about dcop bindings in python.

Steven W. Orr steveo at syslang.net
Mon Aug 11 03:08:50 BST 2008


On Friday, Aug 8th 2008 at 17:20 -0000, quoth Shaggy Wolf:

=>On Fri, Aug 8, 2008 at 2:28 PM, Steven W. Orr <steveo at syslang.net> wrote:
=>      I've looked but I didn't see anything that was useful. I
=>      wrote a shell
=>      script that uses dcop to run the 3ddesk program:
=>
=>      #! /bin/bash
=>
=>      typeset -i desktop="$1"
=>      [[ -z "$desktop" ]] && exit 0
=>      # Get current desktop
=>      curr_desk=$(dcop kwin KWinInterface currentDesktop)
=>      if [[ $curr_desk == $desktop ]]
=>      then
=>          dcop kwin KWinInterface refresh
=>      else
=>          exec 3ddesk --gotocolumn=$desktop
=>      fi
=>
=>      I want to write this in python and I'm sort of stuck. Can
=>      someone please
=>      tell me how to get the equiv of this line of shell into
=>      python?
=>
=>      dcop kwin KWinInterface currentDesktop
=>
=>      I got as far as
=>
=>      #! /usr/bin/python
=>      import pcop
=>      import pydcop
=>
=>      and after that I'm verstumpfed.
=>
=>      Also, I ran kdcop to see the tree but when I select python
=>      mode I don't
=>      see that it actuallty does anything. Is it suppoed to tell me
=>      what to do
=>      in python or does it not work yet?
=>You could use something like this:
=>
=>#!/usr/bin/env python
=>from pydcop import *
=>
=>#This will create a pointer (as it were) to the dcop object
=>desktop = DCOPApplication("kwin")
=>
=>#You can then perform all the actions that you can on the command line
=>currentDesktop = desktop.KWinInterface.currentDesktop()

Thanks, this solved my problem, but I'd also like to find out how (or 
if) the Extra -> Language Mode menu option works. I don't see anything 
happen if I pull down any of the three options, Shell, C++ or Python.

Anyone for that?

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net
-------------- next part --------------
___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.


More information about the kde mailing list