M BUZZ CRAZE NEWS
// general

How to make a Openbox dockapp with GTK?

By Joseph Russell

I'm using Openbox and I want to make a dock-app (NOTE: not a dock like plank/docky but a dock-app like stalonetray or lal) in GTK+. How do I get the simple app I have written to sit in the dock area?

#!/usr/bin/env ruby
require "gtk3"
module Bang class Clock < Gtk::Window def initialize(clock_fmt) super(:toplevel) @label = Gtk::Label.new @fmt = clock_fmt self.add(@label) end def start(time) GLib::Timeout.add(time) do @label.markup = Time.now.strftime(@fmt) self.show_all end end end
end
if __FILE__ == $PROGRAM_NAME Gtk.init @clock = Bang::Clock.new('%T') @clock.signal_connect("destroy") do Gtk.main_quit end @clock.start(1000) @clock.show_all Gtk.main
end

1 Answer

I would strongly suspect that any tray applet worth its salt is following the Freedesktop system tray specifications so that every X11 application works on every desktop environment as expected.

GTK+ 3 certainly follows these specs. That should give you a rough idea of the bindings you'll be using. I've no idea how these are translated through Ruby though.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy