From: Richard Dale Date: 2005-04-30T18:49:28+09:00 Subject: Re: KDE 'applets' in Ruby? tsuraan wrote: >> It seems I recall an announcment sometime in the last six months or so >> about a Ruby library/package/module that allows you to write KDE >> 'applets' (I may be misnaming this object). > > It's quite a bit older than six months, but korundum is the name of the > kde-ruby bindings, I believe. If you use gentoo, it's in the portage > tree. Or you can download it from RubyForge: http://rubyforge.org/projects/korundum/ >> What I want to do is have an icon on my KDE desktop which, when clicked >> will open a terminal and connect via ssh to a particular remote host >> without my having to enter username or password. > > I don't think you need to write a kde app to do this. Just writing > your script and putting it on the desktop will let you click it to > execute it. I would use KDE::System tray to add an icon with a menu to the kicker system tray, here's an example: require 'Korundum' class MainWin < KDE::MainWindow slots 'slotQuitSelected()' def initialize(*args) super @exitFlag = false icons = KDE::IconLoader.new systray = KDE::SystemTray.new(self) systray.setPixmap(icons.loadIcon("stop", 0)) connect(systray, SIGNAL("quitSelected()"), self, SLOT('slotQuitSelected()')) systray.show end def queryClose hide return @exitFlag end def slotQuitSelected @exitFlag = true $kapp.quit end end about = KDE::AboutData.new("systray", "A system tray", "0.1") KDE::CmdLineArgs.init(ARGV, about) app = KDE::Application.new mainWindow = MainWin.new(nil, "main window") mainWindow.show app.exec Then start a konsole instance with a DCOP call: error = "" pid = Qt::Integer.new errcode = KDE::Application.startServiceByDesktopName("konsole", "", error, "", pid) dcopService = "konsole-" + pid.to_s I'm not sure how you send an ssh login command to konsole though. -- Richard