From dac65ee415245f1e492217dd3a3e1ea6d04a29ff Mon Sep 17 00:00:00 2001 From: Nicolás Reynolds Date: Sun, 16 Mar 2014 03:38:00 +0000 Subject: Sun Mar 16 03:32:40 UTC 2014 --- community/tint2/PKGBUILD | 54 ++++++++----- community/tint2/add-power-now-support.patch | 6 +- community/tint2/clock.patch | 78 +++++++++++++++++++ community/tint2/fix_defunct_processes.patch | 31 -------- community/tint2/launcher_apps_dir-v2.patch | 100 ++++++++++++++++++++++++ community/tint2/middle_click_on_clock.patch | 75 ------------------ community/tint2/src-task-align.patch | 115 ++++++++++++++++++++++++++++ community/tint2/zombie-fix.patch | 33 ++++++++ 8 files changed, 363 insertions(+), 129 deletions(-) create mode 100644 community/tint2/clock.patch delete mode 100644 community/tint2/fix_defunct_processes.patch create mode 100644 community/tint2/launcher_apps_dir-v2.patch delete mode 100644 community/tint2/middle_click_on_clock.patch create mode 100644 community/tint2/src-task-align.patch create mode 100644 community/tint2/zombie-fix.patch (limited to 'community/tint2') diff --git a/community/tint2/PKGBUILD b/community/tint2/PKGBUILD index 2571b8dee..899e9b240 100644 --- a/community/tint2/PKGBUILD +++ b/community/tint2/PKGBUILD @@ -1,14 +1,15 @@ -# $Id: PKGBUILD 97618 2013-09-25 18:19:34Z bpiotrowski $ -# Maintainer: Bartłomiej Piotrowski +# $Id: PKGBUILD 107237 2014-03-15 10:43:27Z arodseth $ +# Maintainer: Alexander Rødseth +# Contributor: Bartłomiej Piotrowski # Contributor: Blue Peppers # Contributor: Stefan Husmann< stefan-husmann@t-online.de> pkgname=tint2 pkgver=0.11 -pkgrel=6 +pkgrel=7 pkgdesc='Basic, good-looking task manager for WMs' -arch=('i686' 'x86_64') -url="http://code.google.com/p/tint2/" +arch=('x86_64' 'i686') +url='http://code.google.com/p/tint2/' license=('GPL2') conflicts=('ttm-svn' 'tint') replaces=('tint') @@ -16,21 +17,29 @@ depends=('gtk2' 'imlib2') optdepends=('pygtk: for tint2wizard') makedepends=('pygtk' 'cmake') provides=('tint') -source=(http://tint2.googlecode.com/files/tint2-$pkgver.tar.bz2 - add-power-now-support.patch - fix_defunct_processes.patch - middle_click_on_clock.patch) +source=("http://tint2.googlecode.com/files/tint2-$pkgver.tar.bz2" + 'add-power-now-support.patch' + 'clock.patch' + 'launcher_apps_dir-v2.patch' + 'src-task-align.patch' + 'zombie-fix.patch') md5sums=('6fc5731e7425125fa84a2add5cef4bff' - '6cfcad028f1bd2f69812167f5395f890' - 'b3d052ac5ada81c56e36133b1ecdee8c' - 'f7918d29a87422aab6fb9d922867d8f8') + '448beead6c9d44b864f99e08a027cb56' + 'bc0bab2979dacff551a97bdf2c2fdedc' + '13218765dd684ae825967d3ffb4f4a75' + 'f0d7f51ec8dbf2e7b6bcca942f0fd6c0' + 'cdb83cd911e005a3529e5d1cd952a956') prepare() { - cd $pkgname-$pkgver + cd "$pkgname-$pkgver" - patch -Np0 -i ../add-power-now-support.patch - patch -Np0 -i ../fix_defunct_processes.patch - patch -Np0 -i ../middle_click_on_clock.patch + # Applying all patches, even some that only applies partially. + # Tint2 works fine with these, but a new release from upstream would be nice. + for f in ../*.patch; do + echo -e "--- ${f##*/} ---\n" + patch -Np1 -i $f && echo "${f##*/} OK!" || echo "${f##*/} FAILED!" + echo + done # python2 fix sed -i 's_#!/usr/bin/env python_#!/usr/bin/env python2_' src/tint2conf/tintwizard.py @@ -38,13 +47,18 @@ prepare() { } build() { - cd $pkgname-$pkgver + cd "$pkgname-$pkgver" - cmake -DCMAKE_INSTALL_PREFIX=/usr . + mkdir -p build + cd build + cmake .. \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DENABLE_TINT2CONF=0 make } package() { - cd $pkgname-$pkgver - make DESTDIR="$pkgdir" install + make -C "$pkgname-$pkgver/build" DESTDIR="$pkgdir" install } + +# vim:set ts=2 sw=2 et: diff --git a/community/tint2/add-power-now-support.patch b/community/tint2/add-power-now-support.patch index 5057043df..6123f2786 100644 --- a/community/tint2/add-power-now-support.patch +++ b/community/tint2/add-power-now-support.patch @@ -1,6 +1,6 @@ -diff -rup ../tint2-0.11.orig/src/battery/battery.c ./src/battery/battery.c ---- ../tint2-0.11.orig/src/battery/battery.c 2010-12-02 23:56:11.313403140 +0100 -+++ ./src/battery/battery.c 2010-12-02 23:57:22.266956142 +0100 +diff -rup trunk/src/battery/battery.c ./src/battery/battery.c +--- trunk/src/battery/battery.c 2010-12-02 23:56:11.313403140 +0100 ++++ trunk/src/battery/battery.c 2010-12-02 23:57:22.266956142 +0100 @@ -184,8 +184,14 @@ void init_battery() } g_free(path2); diff --git a/community/tint2/clock.patch b/community/tint2/clock.patch new file mode 100644 index 000000000..2b3857315 --- /dev/null +++ b/community/tint2/clock.patch @@ -0,0 +1,78 @@ +http://code.google.com/p/tint2/issues/detail?id=430 +Submitted By: David B. Cortarello (Nomius) +Date: 18-05-2013 +Initial Package Version: subversion trunk (revision 652) +Description: Implemented middle click mouse button in the clock to execute tasks. +* Implemented middle click mouse button over the clock by accepting the button 2 in the +clock_action. +* A new configuration parameter was created called clock_mclick_command, which works in +the same way +* clock_lclick_command and clock_rclick_command does. + +Index: trunk/src/clock/clock.c +=================================================================== +--- trunk/src/clock/clock.c (revision 652) ++++ trunk/src/clock/clock.c (working copy) +@@ -39,6 +41,7 @@ + char *time_tooltip_format; + char *time_tooltip_timezone; + char *clock_lclick_command; ++char *clock_mclick_command; + char *clock_rclick_command; + struct timeval time_clock; + PangoFontDescription *time1_font_desc; +@@ -61,6 +64,7 @@ + time_tooltip_format = 0; + time_tooltip_timezone = 0; + clock_lclick_command = 0; ++ clock_mclick_command = 0; + clock_rclick_command = 0; + time1_font_desc = 0; + time2_font_desc = 0; +@@ -77,6 +81,7 @@ + if (time2_timezone) g_free(time2_timezone); + if (time_tooltip_timezone) g_free(time_tooltip_timezone); + if (clock_lclick_command) g_free(clock_lclick_command); ++ if (clock_mclick_command) g_free(clock_mclick_command); + if (clock_rclick_command) g_free(clock_rclick_command); + if (clock_timeout) stop_timeout(clock_timeout); + } +@@ -254,6 +263,9 @@ + case 1: + command = clock_lclick_command; + break; ++ case 2: ++ command = clock_mclick_command; ++ break; + case 3: + command = clock_rclick_command; + break; +Index: trunk/src/clock/clock.h +=================================================================== +--- trunk/src/clock/clock.h (revision 652) ++++ trunk/src/clock/clock.h (working copy) +@@ -33,6 +33,7 @@ + extern PangoFontDescription *time1_font_desc; + extern PangoFontDescription *time2_font_desc; + extern char *clock_lclick_command; ++extern char *clock_mclick_command; + extern char *clock_rclick_command; + extern int clock_enabled; + +Index: trunk/src/config.c +=================================================================== +--- trunk/src/config.c (revision 652) ++++ trunk/src/config.c (working copy) +@@ -396,6 +396,10 @@ + if (strlen(value) > 0) + clock_lclick_command = strdup(value); + } ++ else if (strcmp(key, "clock_mclick_command") == 0) { ++ if (strlen(value) > 0) ++ clock_mclick_command = strdup(value); ++ } + else if (strcmp(key, "clock_rclick_command") == 0) { + if (strlen(value) > 0) + clock_rclick_command = strdup(value); + + diff --git a/community/tint2/fix_defunct_processes.patch b/community/tint2/fix_defunct_processes.patch deleted file mode 100644 index 28ea6c27a..000000000 --- a/community/tint2/fix_defunct_processes.patch +++ /dev/null @@ -1,31 +0,0 @@ -http://code.google.com/p/tint2/issues/detail?id=430 -Submitted By: David B. Cortarello (Nomius) -Date: 18-05-2013 -Initial Package Version: subversion trunk (revision 652) -Description: Fix zombie (defunct) processes created in clock_action. -This patch provides the following bugfixes: - * This patch uses waitpid with WNOHANG to eliminate all zombie processes created by tint2 (in particular by the clock -right or left- click). This is done by a small hack in the update_clocks_min, called to "redraw" that area. - ---- src/clock/clock.c (revision 652) -+++ src/clock/clock.c (working copy) -@@ -23,6 +23,8 @@ - #include - #include - #include -+#include -+#include - - #include "window.h" - #include "server.h" -@@ -98,6 +103,10 @@ - // remember old_sec because after suspend/hibernate the clock should be updated directly, and not - // on next minute change - time_t old_sec = time_clock.tv_sec; -+ -+ // Little hack to wait executed commands in clock_action avoiding zombies -+ waitpid(-1, NULL, WNOHANG); -+ - gettimeofday(&time_clock, 0); - if (time_clock.tv_sec % 60 == 0 || time_clock.tv_sec - old_sec > 60) { - int i; - diff --git a/community/tint2/launcher_apps_dir-v2.patch b/community/tint2/launcher_apps_dir-v2.patch new file mode 100644 index 000000000..6dde4ed7e --- /dev/null +++ b/community/tint2/launcher_apps_dir-v2.patch @@ -0,0 +1,100 @@ +Index: trunk/src/config.c +=================================================================== +--- trunk/src/config.c (revision 646) ++++ trunk/src/config.c (working copy) +@@ -583,6 +583,18 @@ + char *app = strdup(value); + panel_config.launcher.list_apps = g_slist_append(panel_config.launcher.list_apps, app); + } ++ else if (strcmp(key, "launcher_apps_dir") == 0) { ++ ++ GList *list = dir_scan_alpha(value, "*.desktop"); ++ ++ for (list = g_list_first(list); list; list = g_list_next(list)) { ++ fprintf(stderr, "Add launcher app: %s\n", (const char *)list->data); ++ panel_config.launcher.list_apps = g_slist_append(panel_config.launcher.list_apps, (char *)strdup((const char *)list->data)); ++ } ++ ++ // Cleanup ++ g_list_free_full(list, g_free); ++ } + else if (strcmp(key, "launcher_icon_theme") == 0) { + // if XSETTINGS manager running, tint2 use it. + if (!icon_theme_name) +Index: trunk/src/util/common.c +=================================================================== +--- trunk/src/util/common.c (revision 646) ++++ trunk/src/util/common.c (working copy) +@@ -22,10 +22,13 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include + #include ++#include + + #include "common.h" + #include "../server.h" +@@ -342,3 +345,46 @@ + XRenderFreePicture(server.dsp, pict_image); + XRenderFreePicture(server.dsp, pict_drawable); + } ++ ++/** ++ * @brief ++ * Scan given directory for files which are meet the given mask and sort them alphabetically ++ * ++ * @param path - directory path ++ * @param mask - filename mask ++ * ++ * @return files list ++ */ ++GList *dir_scan_alpha(const char *path, const char *mask) ++{ ++ GError *err = NULL; ++ GList *list = NULL; ++ const char *n; ++ gchar *fn; ++ struct stat st; ++ ++ GDir *dir = g_dir_open(path, 0, &err); ++ ++ if (!dir) { ++ fprintf(stderr, "%s\n", err->message); ++ g_error_free(err); ++ } else { ++ // Enumerate files ++ while ((n = g_dir_read_name(dir))) { ++ if (!fnmatch(mask, n, FNM_PATHNAME)) { ++ fn = g_build_filename(path, n, NULL); ++ ++ if (stat((char *)fn, &st) < 0) ++ continue; ++ ++ // Only regular files ++ if (S_ISREG(st.st_mode)) ++ list = g_list_prepend(list, (gpointer)fn); ++ } ++ } ++ ++ list = g_list_sort (list, (GCompareFunc) &strcmp); ++ } ++ ++ return list; ++} +Index: trunk/src/util/common.h +=================================================================== +--- trunk/src/util/common.h (revision 646) ++++ trunk/src/util/common.h (working copy) +@@ -57,5 +57,7 @@ + void createHeuristicMask(DATA32* data, int w, int h); + + void render_image(Drawable d, int x, int y, int w, int h); ++ ++GList *dir_scan_alpha(const char *path, const char *mask); + #endif + diff --git a/community/tint2/middle_click_on_clock.patch b/community/tint2/middle_click_on_clock.patch deleted file mode 100644 index 800c15c44..000000000 --- a/community/tint2/middle_click_on_clock.patch +++ /dev/null @@ -1,75 +0,0 @@ -http://code.google.com/p/tint2/issues/detail?id=430 -Submitted By: David B. Cortarello (Nomius) -Date: 18-05-2013 -Initial Package Version: subversion trunk (revision 652) -Description: Implemented middle click mouse button in the clock to execute tasks. -* Implemented middle click mouse button over the clock by accepting the button 2 in the clock_action. -* A new configuration parameter was created called clock_mclick_command, which works in the same way -* clock_lclick_command and clock_rclick_command does. - -Index: src/clock/clock.c -=================================================================== ---- src/clock/clock.c (revision 652) -+++ src/clock/clock.c (working copy) -@@ -39,6 +41,7 @@ - char *time_tooltip_format; - char *time_tooltip_timezone; - char *clock_lclick_command; -+char *clock_mclick_command; - char *clock_rclick_command; - struct timeval time_clock; - PangoFontDescription *time1_font_desc; -@@ -61,6 +64,7 @@ - time_tooltip_format = 0; - time_tooltip_timezone = 0; - clock_lclick_command = 0; -+ clock_mclick_command = 0; - clock_rclick_command = 0; - time1_font_desc = 0; - time2_font_desc = 0; -@@ -77,6 +81,7 @@ - if (time2_timezone) g_free(time2_timezone); - if (time_tooltip_timezone) g_free(time_tooltip_timezone); - if (clock_lclick_command) g_free(clock_lclick_command); -+ if (clock_mclick_command) g_free(clock_mclick_command); - if (clock_rclick_command) g_free(clock_rclick_command); - if (clock_timeout) stop_timeout(clock_timeout); - } -@@ -254,6 +263,9 @@ - case 1: - command = clock_lclick_command; - break; -+ case 2: -+ command = clock_mclick_command; -+ break; - case 3: - command = clock_rclick_command; - break; -Index: src/clock/clock.h -=================================================================== ---- src/clock/clock.h (revision 652) -+++ src/clock/clock.h (working copy) -@@ -33,6 +33,7 @@ - extern PangoFontDescription *time1_font_desc; - extern PangoFontDescription *time2_font_desc; - extern char *clock_lclick_command; -+extern char *clock_mclick_command; - extern char *clock_rclick_command; - extern int clock_enabled; - -Index: src/config.c -=================================================================== ---- src/config.c (revision 652) -+++ src/config.c (working copy) -@@ -396,6 +396,10 @@ - if (strlen(value) > 0) - clock_lclick_command = strdup(value); - } -+ else if (strcmp(key, "clock_mclick_command") == 0) { -+ if (strlen(value) > 0) -+ clock_mclick_command = strdup(value); -+ } - else if (strcmp(key, "clock_rclick_command") == 0) { - if (strlen(value) > 0) - clock_rclick_command = strdup(value); - diff --git a/community/tint2/src-task-align.patch b/community/tint2/src-task-align.patch new file mode 100644 index 000000000..937725b67 --- /dev/null +++ b/community/tint2/src-task-align.patch @@ -0,0 +1,115 @@ +Index: trunk/src/panel.h +=================================================================== +--- trunk/src/panel.h (revision 639) ++++ trunk/src/panel.h (working copy) +@@ -61,6 +61,9 @@ + extern int panel_strut_policy; + extern char *panel_items_order; + ++// tasks alignment ++enum { ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT }; ++ + extern int max_tick_urgent; + + extern GArray* backgrounds; +Index: src/config.c +=================================================================== +--- trunk/src/config.c (revision 639) ++++ trunk/src/config.c (working copy) +@@ -484,6 +484,14 @@ + if (value2) panel_config.g_task.area.paddingy = atoi (value2); + if (value3) panel_config.g_task.area.paddingx = atoi (value3); + } ++ else if (strcmp (key, "task_align") == 0) { ++ extract_values(value, &value1, &value2, &value3); ++ printf("task_align: %s\n", value1); ++ if (strcmp (value1, "left") == 0) panel_config.g_task.align = ALIGN_LEFT; ++ else if (strcmp (value1, "center") == 0) panel_config.g_task.align = ALIGN_CENTER; ++ else if (strcmp (value1, "right") == 0) panel_config.g_task.align = ALIGN_RIGHT; ++ else fprintf(stderr, "Unknown value for task_align: %s\n", value1); ++ } + else if (strcmp (key, "task_font") == 0) { + panel_config.g_task.font_desc = pango_font_description_from_string (value); + } +Index: trunk/src/taskbar/task.h +=================================================================== +--- trunk/src/taskbar/task.h (revision 639) ++++ trunk/src/taskbar/task.h (working copy) +@@ -26,6 +26,7 @@ + int text; + int icon; + int centered; ++ int align; + + int icon_posy; + int icon_size1; +Index: trunk/src/util/area.c +=================================================================== +--- trunk/src/util/area.c (revision 639) ++++ trunk/src/util/area.c (working copy) +@@ -130,6 +130,54 @@ + } + + ++// calculate total size of all children including ++// parent's padding ++int children_size(Area *a, int horizontal) ++{ ++ int size = 0; ++ GSList *l; ++ ++ for (l = a->list; l; l = l->next) { ++ Area *child = ((Area*)l->data); ++ if (!child->on_screen) continue; ++ ++ if (horizontal) ++ size += child->width + a->paddingx; ++ else ++ size += child->height + a->paddingy; ++ } ++ ++ return size; ++} ++ ++ ++// calculate chilren's align offset depending on the align type ++int align_offset(Area *a, int align, int horizontal) ++{ ++ int size = 0; ++ int child_size = children_size(a, horizontal); ++ ++ if (horizontal) ++ size = a->width; ++ else ++ size = a->height; ++ ++ switch (align) { ++ case ALIGN_LEFT: ++ return 0; ++ ++ case ALIGN_CENTER: ++ return (size - child_size) / 2; ++ ++ case ALIGN_RIGHT: ++ return size - child_size; ++ ++ default: ++ return 0; ++ } ++} ++ ++ + void size_by_layout (Area *a, int pos, int level) + { + // don't resize hiden objects +@@ -179,7 +227,9 @@ + int k; + for (k=0 ; k < level ; k++) printf(" "); + printf("tree level %d, object %d, pos %d, %s\n", level, i, pos, (child->size_mode == SIZE_BY_LAYOUT) ? "SIZE_BY_LAYOUT" : "SIZE_BY_CONTENT");*/ +- size_by_layout(child, pos, level+1); ++ ++ int offset = align_offset(child, panel_config.g_task.align, panel_horizontal); ++ size_by_layout(child, pos + offset, level + 1); + + if (panel_horizontal) + pos += child->width + a->paddingx; diff --git a/community/tint2/zombie-fix.patch b/community/tint2/zombie-fix.patch new file mode 100644 index 000000000..48f767301 --- /dev/null +++ b/community/tint2/zombie-fix.patch @@ -0,0 +1,33 @@ +http://code.google.com/p/tint2/issues/detail?id=430 +Submitted By: David B. Cortarello (Nomius) +Date: 18-05-2013 +Initial Package Version: subversion trunk (revision 652) +Description: Fix zombie (defunct) processes created in clock_action. +This patch provides the following bugfixes: + * This patch uses waitpid with WNOHANG to eliminate all zombie processes created by +tint2 (in particular by the clock -right or left- click). This is done by a small hack +in the update_clocks_min, called to "redraw" that area. + +--- trunk/src/clock/clock.c (revision 652) ++++ trunk/src/clock/clock.c (working copy) +@@ -23,6 +23,8 @@ + #include + #include + #include ++#include ++#include + + #include "window.h" + #include "server.h" +@@ -98,6 +103,10 @@ + // remember old_sec because after suspend/hibernate the clock should be updated directly, and not + // on next minute change + time_t old_sec = time_clock.tv_sec; ++ ++ // Little hack to wait executed commands in clock_action avoiding zombies ++ waitpid(-1, NULL, WNOHANG); ++ + gettimeofday(&time_clock, 0); + if (time_clock.tv_sec % 60 == 0 || time_clock.tv_sec - old_sec > 60) { + int i; + -- cgit v1.2.3-54-g00ecf