Hi, Have a play, but be aware of: http://code.google.com/p/tint2/issues/list?can=2&q=reporter:vext01
tint2conf and low_battery_cmd is flakey. -- Best Regards Edd Barrett http://www.theunixzoo.co.uk
? LOG ? patches.new ? tint2conf.core Index: Makefile =================================================================== RCS file: /cvs/ports/x11/tint/Makefile,v retrieving revision 1.6 diff -u -p -u -r1.6 Makefile --- Makefile 11 May 2010 21:36:18 -0000 1.6 +++ Makefile 11 Jun 2010 16:19:01 -0000 @@ -2,8 +2,8 @@ COMMENT= lightweight freedesktop-compliant panel/taskbar/clock -DISTNAME= tint2-0.9 -PKGNAME= ${DISTNAME:S/tint2/tint/}p2 +DISTNAME= tint2-0.10 +PKGNAME= ${DISTNAME:S/tint2/tint/} CATEGORIES= x11 HOMEPAGE= http://code.google.com/p/tint2/ @@ -16,21 +16,32 @@ PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes -WANTLIB= X11 Xinerama Xrender c cairo glib-2.0 gobject-2.0 \ - pixman-1 pthread Xcomposite Xdamage +WANTLIB= X11 Xinerama Xrender c cairo gio-2.0 glib-2.0 gobject-2.0 \ + gthread-2.0 intl pthread Xcomposite Xdamage Xrandr MASTER_SITES= http://tint2.googlecode.com/files/ LIB_DEPENDS= Imlib2.>=2::graphics/imlib2 \ - pango-1.0,pangocairo-1.0::devel/pango + pango-1.0,pangocairo-1.0::devel/pango \ + gdk-x11-2.0,gdk_pixbuf-2.0,gtk-x11-2.0::x11/gtk+2 +RUN_DEPENDS= ::x11/py-gtk2 + + +# tintwizard is python +MODULES= lang/python +SUBST_VARS+= MODPY_VERSION USE_X11= Yes USE_GMAKE= Yes NO_REGRESS= Yes CONFIGURE_STYLE=gnu -CONFIGURE_ENV+= "LDFLAGS=-L${LOCALBASE}/lib -L${X11BASE}/lib" +CONFIGURE_ENV+= "LDFLAGS=-L${LOCALBASE}/lib -L${X11BASE}/lib -thread" FAKE_FLAGS= rcdir=${PREFIX}/share/examples/tint2 + +pre-configure: + ${SUBST_CMD} ${WRKSRC}/src/tint2conf/main.c \ + ${WRKSRC}/src/tint2conf/tintwizard.py .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/x11/tint/distinfo,v retrieving revision 1.2 diff -u -p -u -r1.2 distinfo --- distinfo 19 Apr 2010 13:55:56 -0000 1.2 +++ distinfo 11 Jun 2010 16:19:01 -0000 @@ -1,5 +1,5 @@ -MD5 (tint2-0.9.tar.gz) = QR3mzLi4IImFLYyFSxLduQ== -RMD160 (tint2-0.9.tar.gz) = lYpIUIV+K5D+pyxI0yyj1ofWvHQ= -SHA1 (tint2-0.9.tar.gz) = +mmqqSS7WoXPp1OUbIpuvtedc9g= -SHA256 (tint2-0.9.tar.gz) = X4sUlpx713WPY2H6rieeHQZZyb40ehKgcvjPk4VPRwM= -SIZE (tint2-0.9.tar.gz) = 206491 +MD5 (tint2-0.10.tar.gz) = geROAsqywxOqQ2/yWy4kmQ== +RMD160 (tint2-0.10.tar.gz) = rhNwLuDLNlV1A3nsg3odg/EBSJI= +SHA1 (tint2-0.10.tar.gz) = oiux5f6IEpH2toCrOnXYX2ihDZ8= +SHA256 (tint2-0.10.tar.gz) = kq9eGxninqHHv8pVwCuOuzaMgeM+qXk2jZGagJlrnKI= +SIZE (tint2-0.10.tar.gz) = 202040 Index: patches/patch-configure =================================================================== RCS file: patches/patch-configure diff -N patches/patch-configure --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-configure 11 Jun 2010 16:19:01 -0000 @@ -0,0 +1,12 @@ +$OpenBSD$ +--- configure.orig Fri Jun 11 16:08:23 2010 ++++ configure Fri Jun 11 16:08:34 2010 +@@ -8073,7 +8073,7 @@ fi + + # + AM_CFLAGS="-Wall" +-AM_LDFLAGS="-Wl,--as-needed" ++AM_LDFLAGS="-Wl" + + + Index: patches/patch-sample_tint2rc =================================================================== RCS file: patches/patch-sample_tint2rc diff -N patches/patch-sample_tint2rc --- patches/patch-sample_tint2rc 19 Apr 2010 13:55:56 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,114 +0,0 @@ -$OpenBSD: patch-sample_tint2rc,v 1.1 2010/04/19 13:55:56 edd Exp $ ---- sample/tint2rc.orig Thu Jan 28 11:16:34 2010 -+++ sample/tint2rc Fri Apr 16 02:22:44 2010 -@@ -1,31 +1,33 @@ - #--------------------------------------------- - # TINT2 CONFIG FILE -+# Hacked for sensible OpenBSD defaults. - #--------------------------------------------- - - #--------------------------------------------- - # BACKGROUND AND BORDER - #--------------------------------------------- --rounded = 7 --border_width = 2 --background_color = #000000 60 --border_color = #ffffff 18 - --rounded = 5 --border_width = 0 --background_color = #ffffff 40 --border_color = #ffffff 50 -+# id = 0 -+# transparent - --rounded = 5 -+# id = 1 -+rounded = 0 - border_width = 0 --background_color = #ffffff 18 --border_color = #ffffff 70 -+background_color = #ffffff 5 -+border_color = #333333 - -+# id = 2 -+rounded = 0 -+border_width = 1 -+background_color = #424343 -+border_color = #333333 -+ - #--------------------------------------------- - # PANEL - #--------------------------------------------- - panel_monitor = all - panel_position = bottom center --panel_size = 94% 30 -+panel_size = 100% 30 - panel_margin = 0 0 - panel_padding = 7 0 - font_shadow = 0 -@@ -40,8 +42,8 @@ panel_layer = bottom - #taskbar_mode = multi_desktop - taskbar_mode = single_desktop - taskbar_padding = 2 3 2 --taskbar_background_id = 0 --#taskbar_active_background_id = 0 -+taskbar_background_id = 1 -+taskbar_active_background_id = 0 - - #--------------------------------------------- - # TASKS -@@ -51,9 +53,9 @@ task_text = 1 - task_maximum_size = 140 35 - task_centered = 1 - task_padding = 6 3 --task_font = sans 7 -+task_font = sans 10 - task_font_color = #ffffff 70 --task_background_id = 3 -+task_background_id = 0 - task_icon_asb = 100 0 0 - # replace STATUS by 'urgent', 'active' or 'iconfied' - #task_STATUS_background_id = 2 -@@ -61,7 +63,7 @@ task_icon_asb = 100 0 0 - #task_STATUS_icon_asb = 100 0 0 - # example: - task_active_background_id = 2 --task_active_font_color = #ffffff 85 -+task_active_font_color = #ffffff - task_active_icon_asb = 100 0 0 - urgent_nb_of_blink = 8 - -@@ -95,8 +97,8 @@ clock_rclick_command = orage - #--------------------------------------------- - # BATTERY - #--------------------------------------------- --battery = 0 --battery_hide = 98 -+battery = 1 -+battery_hide = never - battery_low_status = 10 - battery_low_cmd = notify-send "battery low" - bat1_font = sans 8 -@@ -105,16 +107,17 @@ battery_font_color = #ffffff 76 - battery_padding = 1 0 - battery_background_id = 0 - -+ - #--------------------------------------------- - # TOOLTIP - #--------------------------------------------- --tooltip = 0 -+tooltip = 1 - tooltip_padding = 2 2 - tooltip_show_timeout = 0.7 - tooltip_hide_timeout = 0.3 --tooltip_background_id = 1 --tooltip_font_color = #OOOOOO 80 --tooltip_font = sans 10 -+tooltip_background_id = 2 -+tooltip_font_color = #ffffff 80 -+tooltip_font = sans 10 - - #--------------------------------------------- - # MOUSE ACTION ON TASK Index: patches/patch-src_Makefile_in =================================================================== RCS file: /cvs/ports/x11/tint/patches/patch-src_Makefile_in,v retrieving revision 1.1 diff -u -p -u -r1.1 patch-src_Makefile_in --- patches/patch-src_Makefile_in 19 Apr 2010 13:55:56 -0000 1.1 +++ patches/patch-src_Makefile_in 11 Jun 2010 16:19:01 -0000 @@ -1,12 +1,12 @@ -$OpenBSD: patch-src_Makefile_in,v 1.1 2010/04/19 13:55:56 edd Exp $ ---- src/Makefile.in.orig Tue Apr 13 23:00:33 2010 -+++ src/Makefile.in Tue Apr 13 23:00:45 2010 -@@ -158,7 +158,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ +$OpenBSD$ +--- src/Makefile.in.orig Fri Jun 11 15:45:59 2010 ++++ src/Makefile.in Fri Jun 11 15:46:05 2010 +@@ -127,7 +127,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ --LIBS = @PANGOCAIRO_LIBS@ @PANGO_LIBS@ @CAIRO_LIBS@ @GLIB2_LIBS@ @GOBJECT2_LIBS@ @X11_LIBS@ @XINERAMA_LIBS@ @IMLIB2_LIBS@ -lrt -+LIBS = @PANGOCAIRO_LIBS@ @PANGO_LIBS@ @CAIRO_LIBS@ @GLIB2_LIBS@ @GOBJECT2_LIBS@ @X11_LIBS@ @XINERAMA_LIBS@ @IMLIB2_LIBS@ +-LIBS = @PANGOCAIRO_LIBS@ @PANGO_LIBS@ @CAIRO_LIBS@ @GLIB2_LIBS@ @GOBJECT2_LIBS@ @X11_LIBS@ @IMLIB2_LIBS@ -lrt ++LIBS = @PANGOCAIRO_LIBS@ @PANGO_LIBS@ @CAIRO_LIBS@ @GLIB2_LIBS@ @GOBJECT2_LIBS@ @X11_LIBS@ @IMLIB2_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ Index: patches/patch-src_battery_battery_c =================================================================== RCS file: patches/patch-src_battery_battery_c diff -N patches/patch-src_battery_battery_c --- patches/patch-src_battery_battery_c 11 May 2010 21:36:18 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,127 +0,0 @@ -$OpenBSD: patch-src_battery_battery_c,v 1.4 2010/05/11 21:36:18 kili Exp $ ---- src/battery/battery.c.orig Tue Jan 19 20:29:28 2010 -+++ src/battery/battery.c Tue May 11 23:29:23 2010 -@@ -24,6 +24,13 @@ - #include <cairo-xlib.h> - #include <pango/pangocairo.h> - -+#if defined(__OpenBSD__) -+#include <machine/apmvar.h> -+#include <err.h> -+#include <sys/ioctl.h> -+#include <unistd.h> -+#endif -+ - #include "window.h" - #include "server.h" - #include "area.h" -@@ -51,6 +58,10 @@ char *path_energy_full=0; - char *path_current_now=0; - char *path_status=0; - -+#if defined(__OpenBSD__) -+int apm_fd = -1; -+#endif -+ - void update_batterys(void* arg) - { - int i; -@@ -80,6 +91,18 @@ void update_batterys(void* arg) - - void init_battery() - { -+ -+#if defined(__OpenBSD__) -+ -+ apm_fd = open("/dev/apm", O_RDONLY); -+ if (apm_fd < 0) { -+ warn("init_battery: failed to open /dev/apm."); -+ battery_enabled = 0; -+ return; -+ } -+ -+#else -+ - // check battery - GDir *directory = 0; - GError *error = NULL; -@@ -150,6 +173,7 @@ void init_battery() - - g_free(path1); - g_free(battery_dir); -+#endif - - if (battery_enabled && battery_timeout==0) - battery_timeout = add_timeout(10, 10000, update_batterys, 0); -@@ -176,6 +200,12 @@ void cleanup_battery() - - battery_low_cmd = path_energy_now = path_energy_full = path_current_now = path_status = 0; - bat1_font_desc = bat2_font_desc = 0; -+ -+#if defined(__OpenBSD__) -+ if ((apm_fd != -1) && (close(apm_fd) == -1)) -+ warn("cannot close /dev/apm"); -+#endif -+ - } - - -@@ -223,12 +253,49 @@ void init_battery_panel(void *p) - - - void update_battery() { -+ -+#if !defined(__OpenBSD__) -+ /* unused on OpenBSD, silence compiler warnings */ - FILE *fp; - char tmp[25]; -- int64_t energy_now = 0, energy_full = 0, current_now = 0; -+ int64_t current_now = 0; -+#endif -+ int64_t energy_now = 0, energy_full = 0; - int seconds = 0; - int8_t new_percentage = 0; - -+#if defined(__OpenBSD__) -+ -+ struct apm_power_info info; -+ if (ioctl(apm_fd, APM_IOC_GETPOWER, &(info)) < 0) -+ warn("power update: APM_IOC_GETPOWER"); -+ -+ /* best attempt at mapping to linux battery states */ -+ battery_state.state = BATTERY_UNKNOWN; -+ switch (info.battery_state) { -+ case APM_BATT_CHARGING: -+ battery_state.state = BATTERY_CHARGING; -+ break; -+ default: -+ battery_state.state = BATTERY_DISCHARGING; -+ break; -+ } -+ -+ if (info.battery_life == 100) -+ battery_state.state = BATTERY_FULL; -+ -+ /* no mapping for openbsd really */ -+ energy_full = 0; -+ energy_now = 0; -+ -+ if (info.minutes_left != -1) -+ seconds = info.minutes_left * 60; -+ else -+ seconds = -1; -+ -+ new_percentage = info.battery_life; -+ -+#else - fp = fopen(path_status, "r"); - if(fp != NULL) { - if (fgets(tmp, sizeof tmp, fp)) { -@@ -271,6 +338,7 @@ void update_battery() { - break; - } - } else seconds = 0; -+#endif - - battery_state.time.hours = seconds / 3600; - seconds -= 3600 * battery_state.time.hours; Index: patches/patch-src_tint2conf_main_c =================================================================== RCS file: patches/patch-src_tint2conf_main_c diff -N patches/patch-src_tint2conf_main_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_tint2conf_main_c 11 Jun 2010 16:19:01 -0000 @@ -0,0 +1,12 @@ +$OpenBSD$ +--- src/tint2conf/main.c.orig Fri Jun 11 16:11:14 2010 ++++ src/tint2conf/main.c Fri Jun 11 16:12:23 2010 +@@ -577,7 +577,7 @@ void read_config() + } + g_width = 500; + g_height = 350; +- g_cmd_property = g_strdup("python /usr/bin/tintwizard.py"); ++ g_cmd_property = g_strdup("python${MODPY_VERSION} ${LOCALBASE}/bin/tintwizard.py"); + + // load config + path = g_build_filename (g_get_user_config_dir(), "tint2", "tint2confrc", NULL); Index: patches/patch-src_tint2conf_tintwizard_py =================================================================== RCS file: patches/patch-src_tint2conf_tintwizard_py diff -N patches/patch-src_tint2conf_tintwizard_py --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_tint2conf_tintwizard_py 11 Jun 2010 16:19:01 -0000 @@ -0,0 +1,18 @@ +$OpenBSD$ +--- src/tint2conf/tintwizard.py.orig Sat May 15 15:35:20 2010 ++++ src/tint2conf/tintwizard.py Fri Jun 11 16:31:25 2010 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python${MODPY_VERSION} + + #************************************************************************** + # Tintwizard +@@ -1112,7 +1112,7 @@ class TintWizardGUI(gtk.Window): + def apply(self, widget, event=None, confirmChange=True): + """Applies the current config to tint2.""" + # Check if tint2 is running +- procs = os.popen('pidof "tint2"') # Check list of active processes for tint2 ++ procs = os.popen('pgrep "tint2"') # Check list of active processes for tint2 + pids = [] # List of process ids for tint2 + + for proc in procs.readlines(): Index: patches/patch-src_tint2conf_tintwizard_py.orig =================================================================== RCS file: patches/patch-src_tint2conf_tintwizard_py.orig diff -N patches/patch-src_tint2conf_tintwizard_py.orig --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-src_tint2conf_tintwizard_py.orig 11 Jun 2010 16:19:01 -0000 @@ -0,0 +1,9 @@ +$OpenBSD$ +--- src/tint2conf/tintwizard.py.orig Fri Jun 11 16:14:27 2010 ++++ src/tint2conf/tintwizard.py Fri Jun 11 16:14:50 2010 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python${MODPY_VERSION} + + #************************************************************************** + # Tintwizard Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/x11/tint/pkg/PLIST,v retrieving revision 1.2 diff -u -p -u -r1.2 PLIST --- pkg/PLIST 19 Apr 2010 13:55:56 -0000 1.2 +++ pkg/PLIST 11 Jun 2010 16:19:01 -0000 @@ -1,5 +1,7 @@ @comment $OpenBSD: PLIST,v 1.2 2010/04/19 13:55:56 edd Exp $ @bin bin/tint2 +...@bin bin/tint2conf +bin/tintwizard.py @man man/man1/tint2.1 share/doc/tint2/ @sample ${SYSCONFDIR}/xdg/