Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

KDE 'applets' in Ruby?

8 views
Skip to first unread message

Phil Tomson

unread,
Apr 29, 2005, 8:58:53 PM4/29/05
to

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).

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.

Phil

tsuraan

unread,
Apr 29, 2005, 9:29:23 PM4/29/05
to
> 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.

> 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.

Richard Dale

unread,
Apr 30, 2005, 5:29:24 AM4/30/05
to
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

Alexandre CLERICI

unread,
May 9, 2005, 10:30:23 AM5/9/05
to
> >> 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.
>

Easier
Right-click on your desktop->Create New->Link to location and put
ssh://<your login>:<your pass>@<your ssh serv>

its should work
You can also use the ssh:// kioslave on your bookmarks

0 new messages