diff options
author | Nicolás Reynolds <fauno@endefensadelsl.org> | 2014-03-16 03:38:00 +0000 |
---|---|---|
committer | Nicolás Reynolds <fauno@endefensadelsl.org> | 2014-03-16 03:38:00 +0000 |
commit | dac65ee415245f1e492217dd3a3e1ea6d04a29ff (patch) | |
tree | f5469f18d5a88c99f659ebbeb87e24d160e5b599 /community/tint2 | |
parent | 8cd8534c45f14c6dfea3f1f2228451d192c33b3e (diff) |
Sun Mar 16 03:32:40 UTC 2014
Diffstat (limited to 'community/tint2')
-rw-r--r-- | community/tint2/PKGBUILD | 54 | ||||
-rw-r--r-- | community/tint2/add-power-now-support.patch | 6 | ||||
-rw-r--r-- | community/tint2/clock.patch (renamed from community/tint2/middle_click_on_clock.patch) | 25 | ||||
-rw-r--r-- | community/tint2/launcher_apps_dir-v2.patch | 100 | ||||
-rw-r--r-- | community/tint2/src-task-align.patch | 115 | ||||
-rw-r--r-- | community/tint2/zombie-fix.patch (renamed from community/tint2/fix_defunct_processes.patch) | 8 |
6 files changed, 271 insertions, 37 deletions
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 <nospam@bpiotrowski.pl> +# $Id: PKGBUILD 107237 2014-03-15 10:43:27Z arodseth $ +# Maintainer: Alexander Rødseth <rodseth@gmail.com> +# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org> # Contributor: Blue Peppers <bluepeppers@archlinux.us> # 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/middle_click_on_clock.patch b/community/tint2/clock.patch index 800c15c44..2b3857315 100644 --- a/community/tint2/middle_click_on_clock.patch +++ b/community/tint2/clock.patch @@ -3,14 +3,16 @@ Submitted By: David B. Cortarello (Nomius) <dcortarello at gmail dot com> 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 +* 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 +Index: trunk/src/clock/clock.c =================================================================== ---- src/clock/clock.c (revision 652) -+++ src/clock/clock.c (working copy) +--- 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; @@ -45,10 +47,10 @@ Index: src/clock/clock.c case 3: command = clock_rclick_command; break; -Index: src/clock/clock.h +Index: trunk/src/clock/clock.h =================================================================== ---- src/clock/clock.h (revision 652) -+++ src/clock/clock.h (working copy) +--- 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; @@ -57,10 +59,10 @@ Index: src/clock/clock.h extern char *clock_rclick_command; extern int clock_enabled; -Index: src/config.c +Index: trunk/src/config.c =================================================================== ---- src/config.c (revision 652) -+++ src/config.c (working copy) +--- 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); @@ -73,3 +75,4 @@ Index: src/config.c if (strlen(value) > 0) clock_rclick_command = strdup(value); + 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 <X11/Xutil.h> + #include <X11/Xatom.h> + #include <X11/extensions/Xrender.h> ++#include <sys/types.h> ++#include <sys/stat.h> + #include <stdio.h> + #include <stdlib.h> + #include <string.h> + #include <unistd.h> ++#include <fnmatch.h> + + #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/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/fix_defunct_processes.patch b/community/tint2/zombie-fix.patch index 28ea6c27a..48f767301 100644 --- a/community/tint2/fix_defunct_processes.patch +++ b/community/tint2/zombie-fix.patch @@ -4,10 +4,12 @@ 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. + * 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) +--- trunk/src/clock/clock.c (revision 652) ++++ trunk/src/clock/clock.c (working copy) @@ -23,6 +23,8 @@ #include <cairo-xlib.h> #include <pango/pangocairo.h> |