Browse Source

Updated i3 iconsupport.patch, added xautolock, streamlink, libxdg-basedir and dunst

master
mid-kid 8 years ago
parent
commit
0e8e6f3746
  1. 11
      satellites/broadcom-wl.sat
  2. 19
      satellites/dunst.sat
  3. 325
      satellites/extrafiles/i3/iconsupport.patch
  4. 5
      satellites/i3.sat
  5. 2
      satellites/intel-ucode.sat
  6. 19
      satellites/libxdg-basedir.sat
  7. 14
      satellites/streamlink.sat
  8. 13
      satellites/xautolock.sat

11
satellites/broadcom-wl.sat

@ -6,14 +6,16 @@ define_option "kver=$(uname -r): The kernel version we're building for"
dlextract "http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-$version.tar.gz" \
'115903050c41d466161784d4c843f4f9'
dlfile "https://aur.archlinux.org/cgit/aur.git/plain/$name-dkms.conf?h=$name-dkms" \
dlfile "https://aur.archlinux.org/cgit/aur.git/plain/$name-dkms.conf?h=$name-dkms&id=cea4c9bc92dab37ed89d2c68e9ce0a3896f34d71" \
'b6e8ae4cf217bf68dcf08599bf43fce4'
dlfile "https://aur.archlinux.org/cgit/aur.git/plain/001-null-pointer-fix.patch?h=$name-dkms" \
dlfile "https://aur.archlinux.org/cgit/aur.git/plain/001-null-pointer-fix.patch?h=$name-dkms&id=cea4c9bc92dab37ed89d2c68e9ce0a3896f34d71" \
'fabbf528164f5e3a9dcf46f46a678f86'
dlfile "https://aur.archlinux.org/cgit/aur.git/plain/002-rdtscl.patch?h=$name-dkms" \
dlfile "https://aur.archlinux.org/cgit/aur.git/plain/002-rdtscl.patch?h=$name-dkms&id=cea4c9bc92dab37ed89d2c68e9ce0a3896f34d71" \
'76c168a0271cb57d2539a10877979fbd'
dlfile "https://aur.archlinux.org/cgit/aur.git/plain/003-linux47.patch?h=$name-dkms" \
dlfile "https://aur.archlinux.org/cgit/aur.git/plain/003-linux47.patch?h=$name-dkms&id=cea4c9bc92dab37ed89d2c68e9ce0a3896f34d71" \
'c5074307a37698b11780237beb8f52b2'
dlfile "https://aur.archlinux.org/cgit/aur.git/plain/004-linux48.patch?h=$name-dkms&id=cea4c9bc92dab37ed89d2c68e9ce0a3896f34d71" \
'6ba8d147afe6112112b03af593ae38a0'
header_end
kver="$(option =kver)"
@ -22,6 +24,7 @@ sed -i -e '/BRCM_WLAN_IFNAME/s:eth:wlan:' src/wl/sys/wl_linux.c
patch -p1 -i 001-null-pointer-fix.patch
patch -p1 -i 002-rdtscl.patch
patch -p1 -i 003-linux47.patch
patch -p1 -i 004-linux48.patch
make KBUILD_DIR="$dir_sysroot/lib/modules/$kver/build"
install -Dm644 -t "$dir_install/lib/modules/$kver/kernel/drivers/net/wireless" wl.ko
install -Dm644 "$name-dkms.conf" "$dir_install/$dir_sysconfdir/modprobe.d/$name.conf"

19
satellites/dunst.sat

@ -0,0 +1,19 @@
name=dunst
version=1.1.0
update_url="http://www.knopwob.org/$name/"
dlextract "http://www.knopwob.org/public/$name-release/$name-$version.tar.bz2" \
'7c37fb5306012fd658839908479dbbed'
header_end
cd "$name-$version"
sed -i -e "s/\${PREFIX}\/bin/\${PREFIX}\/$(safe_sed "$dir_bindir")/" \
-e "s/\${PREFIX}\/share/\${PREFIX}\/$(safe_sed "$dir_datadir")/" Makefile
make install \
DESTDIR="$dir_install" \
PREFIX="/$dir_prefix" \
MANPREFIX="/$dir_prefix/$dir_mandir"
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:

325
satellites/extrafiles/i3/iconsupport.patch

@ -0,0 +1,325 @@
diff -Nurp ../i3-4.12/include/atoms_rest.xmacro ./include/atoms_rest.xmacro
--- ../i3-4.12/include/atoms_rest.xmacro 2016-03-06 16:17:18.000000000 +0100
+++ ./include/atoms_rest.xmacro 2016-10-11 23:56:12.406428013 +0200
@@ -1,6 +1,7 @@
xmacro(_NET_WM_USER_TIME)
xmacro(_NET_STARTUP_ID)
xmacro(_NET_WORKAREA)
+xmacro(_NET_WM_ICON)
xmacro(WM_PROTOCOLS)
xmacro(WM_DELETE_WINDOW)
xmacro(UTF8_STRING)
diff -Nurp ../i3-4.12/include/data.h ./include/data.h
--- ../i3-4.12/include/data.h 2016-03-06 16:17:18.000000000 +0100
+++ ./include/data.h 2016-10-11 23:56:12.407428013 +0200
@@ -426,6 +426,9 @@ struct Window {
/* aspect ratio from WM_NORMAL_HINTS (MPlayer uses this for example) */
double aspect_ratio;
+
+ /** Window icon, array of size 16x16 containing the ARGB pixels */
+ uint32_t* icon;
};
/**
diff -Nurp ../i3-4.12/include/libi3.h ./include/libi3.h
--- ../i3-4.12/include/libi3.h 2016-03-06 16:17:18.000000000 +0100
+++ ./include/libi3.h 2016-10-11 23:56:12.407428013 +0200
@@ -587,6 +587,11 @@ color_t draw_util_hex_to_color(const cha
void draw_util_text(i3String *text, surface_t *surface, color_t fg_color, color_t bg_color, int x, int y, int max_width);
/**
+ * Draw the given image using libi3.
+ */
+void draw_util_image(unsigned char *pixels, surface_t *surface, int x, int y, int width, int height);
+
+/**
* Draws a filled rectangle.
* This function is a convenience wrapper and takes care of flushing the
* surface as well as restoring the cairo state.
diff -Nurp ../i3-4.12/include/window.h ./include/window.h
--- ../i3-4.12/include/window.h 2016-03-06 16:17:18.000000000 +0100
+++ ./include/window.h 2016-10-11 23:56:12.408428013 +0200
@@ -87,3 +87,9 @@ void window_update_hints(i3Window *win,
*
*/
void window_update_motif_hints(i3Window *win, xcb_get_property_reply_t *prop, border_style_t *motif_border_style);
+
+/**
+ * Updates the _NET_WM_ICON
+ *
+ */
+void window_update_icon(i3Window *win, xcb_get_property_reply_t *prop);
diff -Nurp ../i3-4.12/libi3/draw_util.c ./libi3/draw_util.c
--- ../i3-4.12/libi3/draw_util.c 2016-03-06 16:17:18.000000000 +0100
+++ ./libi3/draw_util.c 2016-10-11 23:56:12.408428013 +0200
@@ -153,6 +153,39 @@ void draw_util_text(i3String *text, surf
#endif
}
+
+/**
+ * Draw the given image using libi3.
+ * This function is a convenience wrapper and takes care of flushing the
+ * surface as well as restoring the cairo state.
+ *
+ */
+void draw_util_image(unsigned char *pixels, surface_t *surface, int x, int y, int width, int height) {
+ RETURN_UNLESS_SURFACE_INITIALIZED(surface);
+
+#if CAIRO_SUPPORT
+ cairo_save(surface->cr);
+
+ cairo_surface_t *image;
+
+ image = cairo_image_surface_create_for_data(
+ pixels,
+ CAIRO_FORMAT_ARGB32,
+ width,
+ height,
+ width * 4);
+
+ cairo_set_operator(surface->cr, CAIRO_OPERATOR_OVER);
+ cairo_set_source_surface(surface->cr, image, x, y);
+ cairo_rectangle(surface->cr, x, y, width, height);
+ cairo_fill(surface->cr);
+
+ cairo_surface_destroy(image);
+
+ cairo_restore(surface->cr);
+#endif
+}
+
/**
* Draws a filled rectangle.
* This function is a convenience wrapper and takes care of flushing the
diff -Nurp ../i3-4.12/src/handlers.c ./src/handlers.c
--- ../i3-4.12/src/handlers.c 2016-03-06 16:17:18.000000000 +0100
+++ ./src/handlers.c 2016-10-11 23:56:12.409428013 +0200
@@ -1295,6 +1295,20 @@ static bool handle_strut_partial_change(
return true;
}
+static bool handle_windowicon_change(void *data, xcb_connection_t *conn, uint8_t state,
+ xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *prop) {
+ Con *con;
+ if ((con = con_by_window_id(window)) == NULL || con->window == NULL)
+ return false;
+
+ window_update_icon(con->window, prop);
+
+ x_push_changes(croot);
+
+ return true;
+}
+
+
/* Returns false if the event could not be processed (e.g. the window could not
* be found), true otherwise */
typedef bool (*cb_property_handler_t)(void *data, xcb_connection_t *c, uint8_t state, xcb_window_t window, xcb_atom_t atom, xcb_get_property_reply_t *property);
@@ -1315,7 +1329,8 @@ static struct property_handler_t propert
{0, 128, handle_windowrole_change},
{0, 128, handle_class_change},
{0, UINT_MAX, handle_strut_partial_change},
- {0, UINT_MAX, handle_window_type}};
+ {0, UINT_MAX, handle_window_type},
+ {0, UINT_MAX, handle_windowicon_change}};
#define NUM_HANDLERS (sizeof(property_handlers) / sizeof(struct property_handler_t))
/*
@@ -1336,6 +1351,7 @@ void property_handlers_init(void) {
property_handlers[7].atom = XCB_ATOM_WM_CLASS;
property_handlers[8].atom = A__NET_WM_STRUT_PARTIAL;
property_handlers[9].atom = A__NET_WM_WINDOW_TYPE;
+ property_handlers[10].atom = A__NET_WM_ICON;
}
static void property_notify(uint8_t state, xcb_window_t window, xcb_atom_t atom) {
diff -Nurp ../i3-4.12/src/manage.c ./src/manage.c
--- ../i3-4.12/src/manage.c 2016-03-06 16:17:18.000000000 +0100
+++ ./src/manage.c 2016-10-11 23:56:12.410428013 +0200
@@ -92,6 +92,8 @@ void manage_window(xcb_window_t window,
role_cookie, startup_id_cookie, wm_hints_cookie,
wm_normal_hints_cookie, motif_wm_hints_cookie, wm_user_time_cookie, wm_desktop_cookie;
+ xcb_get_property_cookie_t wm_icon_cookie;
+
geomc = xcb_get_geometry(conn, d);
/* Check if the window is mapped (it could be not mapped when intializing and
@@ -163,6 +165,7 @@ void manage_window(xcb_window_t window,
motif_wm_hints_cookie = GET_PROPERTY(A__MOTIF_WM_HINTS, 5 * sizeof(uint64_t));
wm_user_time_cookie = GET_PROPERTY(A__NET_WM_USER_TIME, UINT32_MAX);
wm_desktop_cookie = GET_PROPERTY(A__NET_WM_DESKTOP, UINT32_MAX);
+ wm_icon_cookie = GET_PROPERTY(A__NET_WM_ICON, UINT32_MAX);
DLOG("Managing window 0x%08x\n", window);
@@ -176,6 +179,7 @@ void manage_window(xcb_window_t window,
window_update_class(cwindow, xcb_get_property_reply(conn, class_cookie, NULL), true);
window_update_name_legacy(cwindow, xcb_get_property_reply(conn, title_cookie, NULL), true);
window_update_name(cwindow, xcb_get_property_reply(conn, utf8_title_cookie, NULL), true);
+ window_update_icon(cwindow, xcb_get_property_reply(conn, wm_icon_cookie, NULL));
window_update_leader(cwindow, xcb_get_property_reply(conn, leader_cookie, NULL));
window_update_transient_for(cwindow, xcb_get_property_reply(conn, transient_cookie, NULL));
window_update_strut_partial(cwindow, xcb_get_property_reply(conn, strut_cookie, NULL));
@@ -184,6 +188,8 @@ void manage_window(xcb_window_t window,
window_update_hints(cwindow, xcb_get_property_reply(conn, wm_hints_cookie, NULL), &urgency_hint);
border_style_t motif_border_style = BS_NORMAL;
window_update_motif_hints(cwindow, xcb_get_property_reply(conn, motif_wm_hints_cookie, NULL), &motif_border_style);
+
+
xcb_size_hints_t wm_size_hints;
if (!xcb_icccm_get_wm_size_hints_reply(conn, wm_normal_hints_cookie, &wm_size_hints, NULL))
memset(&wm_size_hints, '\0', sizeof(xcb_size_hints_t));
diff -Nurp ../i3-4.12/src/render.c ./src/render.c
--- ../i3-4.12/src/render.c 2016-03-06 16:17:18.000000000 +0100
+++ ./src/render.c 2016-10-11 23:56:12.410428013 +0200
@@ -127,6 +127,10 @@ void render_con(Con *con, bool render_fu
/* find the height for the decorations */
params.deco_height = render_deco_height();
+ /* minimum decoration height to allow icon to fit
+ * not actuuly required, icon would be cropped otherwise */
+ params.deco_height = (params.deco_height < 16) ? 16 : params.deco_height;
+
/* precalculate the sizes to be able to correct rounding errors */
params.sizes = precalculate_sizes(con, &params);
diff -Nurp ../i3-4.12/src/window.c ./src/window.c
--- ../i3-4.12/src/window.c 2016-03-06 16:17:18.000000000 +0100
+++ ./src/window.c 2016-10-11 23:56:44.972426651 +0200
@@ -19,6 +19,7 @@ void window_free(i3Window *win) {
FREE(win->class_class);
FREE(win->class_instance);
i3string_free(win->name);
+ FREE(win->icon);
FREE(win->ran_assignments);
FREE(win);
}
@@ -367,3 +368,88 @@ void window_update_motif_hints(i3Window
#undef MWM_DECOR_BORDER
#undef MWM_DECOR_TITLE
}
+
+/*
+ * Copy and resize icon if needed
+ */
+void copy_icon_with_resize(uint32_t *dst, int width, int height, uint32_t* src, int s_width, int s_height)
+{
+ int i, j;
+
+ if (width == s_width && height == s_height) {
+ /* easy case, same dimensions, just copy data */
+ memcpy(dst, src, width*height*sizeof(uint32_t));
+ return;
+ }
+
+ uint32_t* row = src;
+ int xstep = s_width / width;
+ int ystep = s_height / height * s_width;
+
+ for (i=0; i < height; ++i) {
+ uint32_t* ptr = row;
+ for(j=0; j < width; ++j) {
+ *dst++ = *ptr;
+ ptr+=xstep;
+ }
+ row += ystep;
+ }
+}
+
+
+void window_update_icon(i3Window *win, xcb_get_property_reply_t *prop)
+{
+ uint32_t *data = NULL;
+ uint64_t len = 0;
+
+ if(!prop || prop->type != XCB_ATOM_CARDINAL || prop->format != 32) {
+ DLOG("_NET_WM_ICON is not set\n");
+ FREE(prop);
+ return;
+ }
+
+ uint32_t prop_value_len = xcb_get_property_value_length(prop);
+ uint32_t *prop_value = (uint32_t *) xcb_get_property_value(prop);
+
+ /* Find the number of icons in the reply. */
+ while (prop_value_len > (sizeof(uint32_t) * 2) && prop_value &&
+ prop_value[0] && prop_value[1])
+ {
+ /* Check that the property is as long as it should be (in bytes),
+ handling integer overflow. "+2" to handle the width and height
+ fields. */
+ const uint64_t crt_len = prop_value[0] * (uint64_t) prop_value[1];
+ const uint64_t expected_len = (crt_len + 2) * 4;
+
+ if (expected_len > prop_value_len) {
+ break;
+ }
+
+ if (len == 0 || (crt_len >= 16*16 && crt_len < len)) {
+ len = crt_len;
+ data = prop_value;
+ }
+ if (len == 16*16) {
+ break; // found 16 pixels icon
+ }
+
+ /* Find pointer to next icon in the reply. */
+ prop_value_len -= expected_len;
+ prop_value = (uint32_t *) (((uint8_t *) prop_value) + expected_len);
+ }
+
+ if (!data) {
+ DLOG("Could not get _NET_WM_ICON\n");
+ FREE(prop);
+ return;
+ }
+
+ LOG("Got _NET_WM_ICON of size: (%d,%d)\n", data[0], data[1]);
+ win->name_x_changed = true; // trigger a redraw
+
+ FREE(win->icon);
+ win->icon = malloc(16 * 16 * sizeof(uint32_t));
+ copy_icon_with_resize(win->icon, 16, 16, data + 2, data[0], data[1]);
+
+ FREE(prop);
+}
diff -Nurp ../i3-4.12/src/x.c ./src/x.c
--- ../i3-4.12/src/x.c 2016-03-06 16:17:18.000000000 +0100
+++ ./src/x.c 2016-10-11 23:56:12.412428013 +0200
@@ -571,6 +571,10 @@ void x_draw_decoration(Con *con) {
//DLOG("indent_level = %d, indent_mult = %d\n", indent_level, indent_mult);
int indent_px = (indent_level * 5) * indent_mult;
+ if (win->icon) {
+ indent_px += 18;
+ }
+
int mark_width = 0;
if (config.show_marks && !TAILQ_EMPTY(&(con->marks_head))) {
char *formatted_mark = sstrdup("");
@@ -611,6 +615,22 @@ void x_draw_decoration(Con *con) {
if (con->title_format != NULL)
I3STRING_FREE(title);
+ /* Draw the icon */
+ if (win->icon) {
+ uint16_t width = 16;
+ uint16_t height = 16;
+
+ int icon_offset_y = (con->deco_rect.height - height) / 2;
+
+ draw_util_image(
+ (unsigned char *)win->icon,
+ &(parent->frame_buffer),
+ con->deco_rect.x + indent_px - width,
+ con->deco_rect.y + icon_offset_y,
+ width,
+ height);
+ }
+
after_title:
x_draw_decoration_after_title(con, p);
copy_pixmaps:

5
satellites/i3.sat

@ -8,8 +8,9 @@ dlextract "http://i3wm.org/downloads/$name-$version.tar.bz2" \
'308fc79ed252e1f3c8a093598e13e326'
if option window-icons; then
dlfile 'https://aur.archlinux.org/cgit/aur.git/plain/iconsupport.patch?h=i3-wm-iconpatch' \
'3fe4dbd039bc0934d641ac9328e7ef92'
#dlfile 'https://aur.archlinux.org/cgit/aur.git/plain/iconsupport.patch?h=i3-wm-iconpatch&id=df5ce8271b714937088bc797b5724c1f2c591c74' \
# '3fe4dbd039bc0934d641ac9328e7ef92'
extrafile 'iconsupport.patch'
fi
header_end

2
satellites/intel-ucode.sat

@ -3,7 +3,7 @@ version=20160714
dlextract "https://downloadmirror.intel.com/26156/eng/microcode-$version.tgz" \
'84e4c0530dc38fd7b804daf894b1bdf9'
dlfile 'https://git.archlinux.org/svntogit/packages.git/plain/trunk/intel-microcode2ucode.c?h=packages/intel-ucode' \
dlfile 'https://git.archlinux.org/svntogit/packages.git/plain/trunk/intel-microcode2ucode.c?h=packages/intel-ucode&id=98b27b5f007b03d50146864efb078cba99b772ad' \
'580276790cfc62dfd82b76085bd1e743'
header_end

19
satellites/libxdg-basedir.sat

@ -0,0 +1,19 @@
import "compile/configure"
name=libxdg-basedir
version=1.2.0
update_url="https://github.com/devnev/$name/releases"
dlextract "https://github.com/devnev/$name/archive/$name-$version.tar.gz" \
'bd3bb815c9e27fda9c721b9c0b29ddda'
dlfile "https://git.archlinux.org/svntogit/community.git/plain/trunk/xdgGetRelativeHome-overflow.patch?h=packages/$name&id=0c117e8e0b8ad642872e29a6b1342e714375db05" \
'2a3670ec13357c4e3c8d55f07d1ec699'
header_end
cd "$name-$name-$version"
patch -p0 -i ../xdgGetRelativeHome-overflow.patch
autoreconf -i
compile_configure -- --disable-static
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:

14
satellites/streamlink.sat

@ -0,0 +1,14 @@
import 'compile/python'
name=streamlink
version=0.0.1
update_url="https://pypi.python.org/pypi/$name"
dlextract "https://pypi.python.org/packages/13/6c/4229db78905aecc0f606b6a8ac9f1fa374a6a53de4f5b529035c5083b1c1/$name-$version.tar.gz" \
'898cc1113592ee30d8a4533a26261045'
header_end
cd "$name-$version"
compile_python 3
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:

13
satellites/xautolock.sat

@ -0,0 +1,13 @@
name=xautolock
version=2.2
update_url='https://www.ibiblio.org/pub/Linux/X11/screensavers/'
dlextract "https://www.ibiblio.org/pub/Linux/X11/screensavers/$name-$version.tgz" \
'9526347a202694ad235d731d9d3de91f'
header_end
cd "$name-$version"
xmkmf
make DESTDIR="$dir_install" install install.man
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
Loading…
Cancel
Save