Re: New color management API
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Julien Danjou wrote: Hi Uli, At 1239996846 time_t, Uli Schlachter wrote: First, thanks for your work. +/** Send a request to initialize a color. + * \param color color_t struct to store color into. + * \param colstr Color specification. + * \return request informations. + */ +color_init_cookie_t color_init_unchecked(color_t *color, const char *colstr) +{ +xcb_screen_t *s = xutil_screen_get(globalconf.connection, globalconf.default_screen); +color_init_cookie_t req; +ssize_t len = strlen(colstr); Na na na: - Never call str*() function, use the ones redefined in common/util.h (a_strlen() in this case) - Don't simplify the function proto because you are lazy. You should let the ssize_t for coltr length, because most of the time we can get the string _and_ its length in a single call (luaL_checklstring) which saves us from a useless call to a_strlen(). Uhm... ok, will do that. +if(req.color == NULL) +return true; + +xcb_alloc_named_color_reply_t *named_color; + +if((named_color = xcb_alloc_named_color_reply(globalconf.connection, + req.cookie, NULL))) +{ +req.color-red = named_color-visual_red; +req.color-green = named_color-visual_green; +req.color-blue = named_color-visual_blue; +req.color-alpha = 0xff; +req.color-initialized = true; +p_delete(named_color); +return true; +} Hum. So actually, you mean that even for your color_t you need to send an X request. I did miss that when arguing that your solution was nice, since I can't see the benefits right now. Or do I miss something else? Yeah, you miss something ;) Colors like #aa77ee are parsed without asking the X server. Colors like green, white and black are parsed via the named_color xcb API. I'd honestly like to drop support for these named colors, but that *might* break some lua apps which use them. However, most people use the html color notation (#123456) and that one is parsed without a query to the X server. In this case color_init_unchecked() does all the work itself and sets req.color and so color_reply() just returns true: +if(req.color == NULL) +return true; So this patch should eliminate the need to query the X server in 90% of cases and if you allow me to not parse named colors, I can avoid it in all cases this API is used. Uli - -- Do you know that books smell like nutmeg or some spice from a foreign land? -- Faber in Fahrenheit 451 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknpc4MACgkQABixOSrV9988AACg2BsSohoe4JYp9UxD0bSCxhE2 PhgAn1z9FlkmsQvM5/2lXYlbfB3LURyP =AUPz -END PGP SIGNATURE- -- To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.
[PATCH] Fix typo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This was introduced in 21978546ebaa53200540c624e6d277f36edf63eb. Looking at the diff, it seems obvious that this should have been util.table.join instead of the non-existent util.join. This bug was triggered by every notification with an icon. Signed-off-by: Uli Schlachter psyc...@znc.in - --- Since thunderbird seems to wrap my patches again and I'm too lazy to attach it: This patch is also available at: git://git.znc.in/psychon/awesome.git naughty-fix lib/naughty.lua.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in index e17b68a..ee06e7d 100644 - --- a/lib/naughty.lua.in +++ b/lib/naughty.lua.in @@ -345,7 +345,7 @@ function notify(args) -- if we have an icon, use it if icon then iconbox = widget({ type = imagebox, align = left }) - -iconbox:buttons(util.join(button({ }, 1, run), button({ }, 3, die))) +iconbox:buttons(util.table.join(button({ }, 1, run), button({ }, 3, die))) local img if type(icon) == string then img = image(icon) - -- 1.6.2.1 - -- Do you know that books smell like nutmeg or some spice from a foreign land? -- Faber in Fahrenheit 451 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknpf9gACgkQABixOSrV99/PeQCgvxWfw3Z4iYQGVTAuCfMUTnLQ OdkAnjO9ubgcG5cT5GpnS1i8ZBrffiim =uc8d -END PGP SIGNATURE- -- To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.
Re: New color management API
At 1240036228 time_t, Uli Schlachter wrote: Yeah, you miss something ;) You're right I missed something; in fact I though we were going more optimized so if I sum up we had: - xcolor_t: * hexa color: xcb_alloc_color_unchecked() * named color: xcb_alloc_named_color_unchecked() Now we have - xcolor_t: * hexa color: xcb_alloc_color_unchecked() * named color: xcb_alloc_named_color_unchecked() - color_t * hexa color: no X request, direct convertion * named color: xcb_alloc_named_color_unchecked() Colors like #aa77ee are parsed without asking the X server. Colors like green, white and black are parsed via the named_color xcb API. I'd honestly like to drop support for these named colors, but that *might* break some lua apps which use them. Removing them does not worth it. Performance over functionnalities does not work. :-) Ping -- Julien Danjou // ᐰ jul...@danjou.info http://julien.danjou.info // 9A0D 5FD9 EB42 22F6 8974 C95C A462 B51E C2FE E5CD // My root password is signature.asc Description: Digital signature
Using rlwrap in awesome-client
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, the old C version of awesome-client used readline which provided nice line editing and history. With the switch to a shell script as awesome-client, this was lost. Julien showed me rlwrap and I made a small patch to make awesome-client use rlwrap, if it is available. This works fine here with both bash and dash. Opinions? Is this merge worthy? (Is the color stuff merge worthy? ;) Should it be documented somewhere that awesome-client can take advantage of rlwrap? If yes, where? Uli P.S.: git://git.znc.in/psychon/awesome.git rlwrap and http://git.znc.in/?p=psychon/awesome.git;a=commitdiff;h=60595c55c - -- Do you know that books smell like nutmeg or some spice from a foreign land? -- Faber in Fahrenheit 451 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknprPgACgkQABixOSrV99/wjwCfQUPXYm8ekmNl32n19w3w5tqS bAYAni9zKFfqNaIhzcjdvcFxJPBr5AWB =KZiS -END PGP SIGNATURE- From 60595c55cbe64de8f34f5084b3517c85a1d7d1af Mon Sep 17 00:00:00 2001 From: Uli Schlachter psyc...@znc.in Date: Sat, 18 Apr 2009 12:26:31 +0200 Subject: [PATCH] awesome-client: Use rlwrap if it is available This should make this more usable again. The old C version used readline, if possible and now the new bash version does too. :) The idea to use rlwrap is from jd and it's a good one. Signed-off-by: Uli Schlachter psyc...@znc.in --- utils/awesome-client |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/utils/awesome-client b/utils/awesome-client index 4b027cb..ea3971c 100755 --- a/utils/awesome-client +++ b/utils/awesome-client @@ -1,5 +1,13 @@ #!/bin/sh +# rlwrap provides readline to stuff which doesn't know readline by itself +RLWRAP=`which rlwrap 2/dev/null` + +if [ $RLWRAP != ] [ $A_RERUN = ] +then + A_RERUN=no exec $RLWRAP $0 +fi + DBUS_SEND=dbus-send if ! which ${DBUS_SEND} /dev/null 21 -- 1.6.2.1
Re: Using rlwrap in awesome-client
At 1240050938 time_t, Uli Schlachter wrote: Opinions? Is this merge worthy? (Is the color stuff merge worthy? ;) Should it be documented somewhere that awesome-client can take advantage of rlwrap? If yes, where? Merged! Cheers, -- Julien Danjou // ᐰ jul...@danjou.info http://julien.danjou.info // 9A0D 5FD9 EB42 22F6 8974 C95C A462 B51E C2FE E5CD // In the Sixth Sense, Bruce Willis is dead. signature.asc Description: Digital signature
Re: [PATCH] beautiful: '~' now refers to user's home directory
At 1240063597 time_t, Damien Leone wrote: My bad... use this one. Pushed. Cheers, -- Julien Danjou // ᐰ jul...@danjou.info http://julien.danjou.info // 9A0D 5FD9 EB42 22F6 8974 C95C A462 B51E C2FE E5CD // And thinking so much differently. signature.asc Description: Digital signature
Do you really trust him?
Keep a spy eye on your Girlfriend's mobile http://chinamobilesms.com -- To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.
[PATCH] awful.util-table.join-ignore-nil-arguments.patch
Once again, the title reveals it all. I thought it doesn't really need to bail out on something that's supposed to return a table but doesnt. koniu -- To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.