[vox-tech] Show & hide Konversation via dcop

Bill Kendrick nbs at sonic.net
Mon Dec 27 22:14:33 PST 2004


So I'm using Konversation as my main IRC client these days.

You can completely close the window without disconnecting from any
servers or channels you're in, which is a nice way to clear out screen
(and taskbar) real estate.

It shows a little icon in the sysem tray which flashes if there are any
new messages in channels I'm sitting in, and can show little call-outs
(that look like comic strip speech bubbles) with messages contain certain
words (like my nickname; so I know people are talking to me -- or about me).

Click the icon in the system tray, and the Konversation window reappears.

However, I'm pretty lazy when it comes to moving my hand from the keyboard
to the mouse, so I just whipped up a little shell script that uses KDE's
dcop system to ask Konversation to show itself (and raise itself, if it's
already showing).

I used the 'Keyboard Shortcuts' section of KDE's Control Center to assign
a keystroke to my shell script (which I had to first add to my K menu using
the KDE Menu Editor).  Go to Settings->Control Center, then in there
go to the Regional & Accessibility section and click Keyboard Shortcuts.

Once in Keyboard Shortcuts, go to the Command Shortcuts tab.
(There's actually a hyperlink to launch KDE's menu editor from there, too!)
Then go in and assign a shortcut!


Here's the simple shell script.  It will launch Konversation if it appears
it's not even running.  If it's running and hidden, it will show it
(and raise it, if it's already shown, but covered by other windows).
If it's running and shown, it will hide it.  (So this acts as a toggle,
just like the Konv. icon in the systray).

Enjoy!



---begin---
#!/bin/sh

KONV=`dcop konversation\* | head -1`

if [ "x$KONV" == "x" ]; then
  konversation
else
  SHOWING=`dcop $KONV konversation-mainwindow\#1 shown`

  if [ $SHOWING == "true" ]; then
    dcop $KONV konversation-mainwindow\#1 hide
  else
    dcop $KONV konversation-mainwindow\#1 show
    dcop $KONV konversation-mainwindow\#1 raise
  fi
fi
---end---


-bill!
bill at newbreedsoftware.com                               Have I been helpful?
http://newbreedsoftware.com/    http://svcs.affero.net/rm.php?r=billkendrick


More information about the vox-tech mailing list