Re: [dev] [surf] patch for SETPROP

From: Josh Rickmar <joshua_rickmar_AT_eumx.net>
Date: Thu, 14 Jan 2010 21:47:31 +0000

On Thu, Jan 14, 2010 at 04:38:57PM +0000, Josh Rickmar wrote:
> Here's a config.def.h patch to prevent SETPROP from setting a property
> to an empty value. This will prevent errors in surf when hitting escape
> and to close dmenu when setting some surf XProperties, like the url.

> --- surf.orig/config.def.h Thu Jan 14 16:31:24 2010
> +++ surf/config.def.h Thu Jan 14 16:30:46 2010
> @@ -10,7 +10,7 @@
>
> #define SETPROP(p) { .v = (char *[]){ "/bin/sh", "-c", \
> "prop=\"`xprop -id $1 $0 | cut -d '\"' -f 2 | dmenu`\" &&" \
> - "xprop -id $1 -f $0 8s -set $0 \"$prop\"", \
> + "[ -n \"$prop\" ] && xprop -id $1 -f $0 8s -set $0 \"$prop\"", \
> p, winid, NULL } }
> #define MODKEY GDK_CONTROL_MASK
> static Key keys[] = {

Oh, guess this isn't needed after all. Thought it was, since I was using
another pipe after the dmenu command, so $? was no longer the return
code from dmenu.
Received on Thu Jan 14 2010 - 21:47:31 UTC

This archive was generated by hypermail 2.2.0 : Fri Jan 15 2010 - 03:00:02 UTC