Skip to content

Commit

Permalink
Migrate to D-Bus
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkay committed Sep 17, 2011
1 parent b347a7f commit 9243d49
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.o
*.panel-applet
*.tar.gz
.#*
.*.swp
Expand All @@ -14,4 +15,3 @@ install-sh
missing
stamp-h1
xmonad-log-applet
xmonad-log-applet.server
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2009,2010,2011 Adam Wick
Copyright (c) 2011 Alexander Kojevnikov
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
13 changes: 7 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,22 @@ install-data-local:
done ;
endif

serverdir = $(libdir)/bonobo/servers
server_files = xmonad-log-applet.server
server_DATA = $(server_files)
# TODO: use libpanel_applet_dir in GNOME3
appletdir = $(datadir)/gnome-panel/applets
applet_files = org.xmonad.Log.panel-applet
applet_DATA = $(applet_files)

$(server_files): $(server_files:.server=.server.in)
$(applet_files): $(applet_files:.panel-applet=.panel-applet.in)
$(SED) -e "s|\@LIBEXECDIR\@|$(libexecdir)|" \
-e "s|\@DATADIR\@|$(datadir)|" < $< > $@

DISTCLEANFILES = \
$(server_DATA)
$(applet_DATA)

EXTRA_DIST = \
xmonad48.png \
xmonad-log-applet.schema \
xmonad-log-applet.server.in
org.xmonad.Log.panel-applet.in

gtk_update_icon_cache = gtk-update-icon-cache -f -t

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AC_HEADER_STDC

PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.20.0)
PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.80)
PKG_CHECK_MODULES(LIBPANEL, libpanelapplet-2.0 >= 2.26.0)
PKG_CHECK_MODULES(LIBPANEL, libpanelapplet-3.0 >= 2.32.0)
PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 2.26.0)

AM_GCONF_SOURCE_2
Expand Down
29 changes: 17 additions & 12 deletions main.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* Copyright (C) 2009 Adam Wick
/* main.c
*
* Copyright (c) 2009 Adam Wick
* Copyright (c) 2011 Alexander Kojevnikov
*
* See LICENSE for licensing information
*/

#include <string.h>
#include <panel-applet.h>
#include <gtk/gtklabel.h>
Expand All @@ -9,9 +14,10 @@
#include <stdlib.h>

/* AW: I pulled this code off the interwebs. It makes background
* transparency actually work */
void change_bg(PanelApplet *applet, PanelAppletBackgroundType type,
GdkColor *color, GdkPixmap *pixmap)
* transparency actually work
*/
static void change_bg(PanelApplet *applet, PanelAppletBackgroundType type,
GdkColor *color, GdkPixmap *pixmap)
{
GtkRcStyle *rc_style;
GtkStyle *style;
Expand Down Expand Up @@ -81,7 +87,7 @@ void xmonadlog_applet_size_change(GConfClient *client,

static gboolean xmonadlog_applet_fill(PanelApplet *applet)
{
GtkWidget *label = gtk_label_new("Waiting for XMonad");
GtkWidget *label = gtk_label_new("Waiting for Xmonad...");

// Set up Gconf
GConfClient* client = gconf_client_get_default();
Expand Down Expand Up @@ -125,7 +131,7 @@ static gboolean xmonadlog_applet_factory(PanelApplet *applet,
{
gboolean retval = FALSE;

if(!strcmp(iid, "OAFIID:XMonadLogApplet"))
if(!strcmp(iid, "XmonadLogApplet"))
retval = xmonadlog_applet_fill(applet);

if(retval == FALSE) {
Expand All @@ -136,9 +142,8 @@ static gboolean xmonadlog_applet_factory(PanelApplet *applet,
return retval;
}

PANEL_APPLET_BONOBO_FACTORY("OAFIID:XMonadLogApplet_Factory",
PANEL_TYPE_APPLET,
"XMonadLogApplet",
"0.0.1",
xmonadlog_applet_factory,
NULL);
PANEL_APPLET_OUT_PROCESS_FACTORY("XmonadLogAppletFactory",
PANEL_TYPE_APPLET,
"XmonadLogApplet",
xmonadlog_applet_factory,
NULL);
11 changes: 11 additions & 0 deletions org.xmonad.Log.panel-applet.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Applet Factory]
Id=XmonadLogAppletFactory
Location=@LIBEXECDIR@/xmonad-log-applet
Name=Xmonad Log Factory
Description=Factory for the xmonad-log-applet

[XmonadLogApplet]
Name=Xmonad Log Applet
Description=Monitor your Xmonad log
Icon=xmonad48
BonoboId=OAFIID:XmonadLogApplet
3 changes: 3 additions & 0 deletions org.xmonad.XmonadLogAppletFactory.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.xmonad.XmonadLogAppletFactory
Exec=@LIBEXECDIR@/xmonad-log-applet
20 changes: 0 additions & 20 deletions xmonad-log-applet.server.in

This file was deleted.

0 comments on commit 9243d49

Please sign in to comment.