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.
More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"