Re: [dev] [sic] null pointer in printf

2010-05-25 Thread Anselm R Garbe
On 24 May 2010 16:44, Kris Maglione  wrote:
> On Mon, 24 May 2010 19:16:52 +0400
> anonymous  wrote:
>
>> On Mon, May 24, 2010 at 07:51:48AM -0400, Kris Maglione wrote:
>> > On Mon, 24 May 2010 10:02:47 +0200
>> > Premysl Hruby  wrote:
>> > What version of sic are you using? The current version doesn't have
>> > that code anymore.
>>
>> Looks like 1.0.
>
> Anyone object to a 1.1 release?

No, just go ahead, still a bit busy at my end ;(

Cheers,
Anselm



Re: [dev] [surf] User-Agent string.

2010-05-25 Thread Enno Boland (Gottox)
Will fix this before releasing.

Thanks! :D

2010/5/18 Marvin Vek :
> Hey all,
>
> thought i'd throw up something i've been twisting my head around.
>
> The following resources describe what the User-Agent string should be:
>        - RFC2616, sections 14.43, 3.8
>        - https://developer.mozilla.org/en/User_Agent_Strings_Reference
>        - http://www.useragentstring.com/
>        - http://webaim.org/blog/user-agent-string-history/
>
> As shown in the last URL (and the one before that), way to many browsers
> abuse/violate the User-Agent string. Sure, every browser creator wants
> people to be able to view every site, but this can be done in a better
> way in my honest opinion.
>
> The User-Agent string, as far as i understand, should be created out of
> the following:
>
>        Browser/Version (Platform; Security; OS-or-CPU; Locale)
>
> Attached to that, additional components can be added:
>
>        Engine/Version [( .. )]
>
> As you can see on useragentstring.com Uzbl entry
> (http://useragentstring.com/pages/uzbl/) they use the Browser name
> correctly -most of the time-. Their Webkit version is wrong though,
> and Surf has it correctly here. Same _could_ be said for Midori, but
> they went for full compatability too.
>
> What the entry for Surf should look like (again, if i understand the
> RFC correctly), for example (OS/CPU derived from uname -sm):
>
>        Surf/0.3 (X11; U; Linux x86_64; en-US) AppleWebKit/531.2+
>
> Now, this will probably give problems with for example Google. But
> since we're using the GTK version of Apple's webkit, we could add a
> 'Safari' compatibility component, and still have the User-Agent string
> compatible with RFC2616:
>
>        Surf/0.3 (X11; U; Linux x86_64; en-US) AppleWebKit/531.2+ Compatible 
> (Safari)
>
> With this User-Agent string, http://useragentstring.com/ detects it
> correctly, even though it doesn't know Surf yet as it's not in their
> database yet, but Gmail which looks for Mozilla, MSIE or Safari will
> function properly.
>
> Would love to hear what you think about it, and especially if this
> would be subject for implementation in the surf sources directly.
>
> Love!
>
> --
> Marvin Vek
> -
> printk ("Kicking board.
> ");
>        linux-2.6.6/drivers/net/lp486e.c
>
>



Re: [dev] [surf] please recheck tip

2010-05-25 Thread Claudio M. Alessi
On Mon, May 24, 2010 at 04:06:00PM -0400, Josh Rickmar wrote:
> Also, is there a better way of doing cookies then wget?  As an (Open)BSD
> user, I'd like to use something in base (I did install wget though to
> test to make sure that wasn't the download problem above).
IIRC you can use ftp(1) for HTTP requests.

Regards,
Claudio M. Alessi

-- 
JID: smoppy AT gmail.com
WWW: http://cma.teroristi.org



Re: [dev] dmenu_path rewrite in C

2010-05-25 Thread Antoni Grzymala
pancake dixit (2010-05-19, 16:15):

> On Wed, 19 May 2010 16:11:15 +0300
> Elmo Todurov  wrote:
> 
> > > So you can define a single buffer of this size to strcpy/memcpy/strcat the
> > > paths you need to construct the executable paths you need.
> > >
> > > this will reduce the heap usage a lot.
> > 
> > This approach would also add complexity. I would guess that disk IO is 
> > the limiting factor to the speed, not malloc.
> 
> and filesystem. in reiser there's some lag on first acceses.

I've noticed that reiserfs has an extremely annoying lag on directory
reads (on cold cache, of course) which was the reason I dumped the
filesystem years ago. Annoyed just that little bit too much in
interactive work.

(FYI I later moved to JFS which I found to be the best allrounder until
I discovered some unpleasant bugs and only a single semi-active
developer, which luckily coincided with works on ext4 getting finished
and now I'm generally happy with that.)

-- 
[a]



Re: [dev] [surf]

2010-05-25 Thread pancake

On 05/24/10 12:26, sta...@cs.tu-berlin.de wrote:

body {width:300pt !important;}
* {max-width:300pt !important;}
   
when zooming this restriction is ignored. so it is not a solution.. any 
other idea?






Re: [dev] [surf]

2010-05-25 Thread stanio
* pancake  [2010-05-25 12:25]:
> On 05/24/10 12:26, sta...@cs.tu-berlin.de wrote:
> > body {width:300pt !important;}
> > * {max-width:300pt !important;}
> when zooming this restriction is ignored. so it is not a solution..
> any other idea?

Only sucking ones, e.g. in addition to the above, 

- preprocess the page by putting some IDs to aragraphs (and other
  elements) 
- generating a JS which cares to show the paragraph alone, if you have
  clicked it.

:o)

-- 
 stanio_



Re: [dev] [surf] please recheck tip

2010-05-25 Thread Josh Rickmar
On Tue, May 25, 2010 at 11:36:28AM +0200, Claudio M. Alessi wrote:
> On Mon, May 24, 2010 at 04:06:00PM -0400, Josh Rickmar wrote:
> > Also, is there a better way of doing cookies then wget?  As an (Open)BSD
> > user, I'd like to use something in base (I did install wget though to
> > test to make sure that wasn't the download problem above).
> IIRC you can use ftp(1) for HTTP requests.

Thanks, I knew about (and use) ftp(1), but didn't think it would work
with cookies.  However, after checking the manpage, I see that it does
support them with the -c flag.



Re: [dev] [surf] please recheck tip

2010-05-25 Thread pancake

On 05/25/10 15:24, Josh Rickmar wrote:

On Tue, May 25, 2010 at 11:36:28AM +0200, Claudio M. Alessi wrote:
   

On Mon, May 24, 2010 at 04:06:00PM -0400, Josh Rickmar wrote:
 

Also, is there a better way of doing cookies then wget?  As an (Open)BSD
user, I'd like to use something in base (I did install wget though to
test to make sure that wasn't the download problem above).
   

IIRC you can use ftp(1) for HTTP requests.
 

Thanks, I knew about (and use) ftp(1), but didn't think it would work
with cookies.  However, after checking the manpage, I see that it does
support them with the -c flag.

   

Why dont distribute a shellscript that gets URL+cookie as arguments,
and let the users implement their own methods like using wget, ftp,
curl, firefox* or whatever

* = yeah, using surf for browsing and firefox for download is the most
retarded idea i can think of xD.. but surely..opening xterm or having
a way to display all wgets in a single xterm would be good (dvtm?)

Having a suckless download manager can be good. just few locs in sh.

--pancake



[dev] [dwm] can't toggle tags with mouse

2010-05-25 Thread orschiro
Hello guys,

I can't toggle the tags with my mouse after I changed from one keyboard
layout to another.

The change is done via an alt_shift_toggle which I set in 10-keymap.fdi.

[orsch...@thinkpad ~]$ cat /etc/hal/fdi/policy/10-keymap.fdi
 

  

  hal-setup-keymap



  base
  
  keyboard
  
evdev
  
  de,pl
  grp:alt_shift_toggle

  


Whenever I use the polish layout this effect appears. The german layout on
the other side still works fine.

What could that be?

Regards


Re: [dev] [surf] please recheck tip

2010-05-25 Thread Josh Rickmar
On Mon, May 24, 2010 at 09:33:10PM +0200, Enno Boland (Gottox) wrote:
> Hi!
> 
> Please recheck current tip of surf. If there are no big stoppers, I
> will release it next week.
> 
> There are still some bugs regarding cookies, They are delayed to 0.5.
> 
> kind regards,
> 
> Enno
> 

I just updated to tip again, and cookies are much worse than before.
Now I can't seem to log into any website at all.  I thought it was the
new useragent so I changed it back, but it didn't solve the problem.



Re: [dev] [surf] please recheck tip

2010-05-25 Thread Marvin Vek
On Tue, May 25, 2010 at 11:04:07AM -0400, Josh Rickmar wrote:
> On Mon, May 24, 2010 at 09:33:10PM +0200, Enno Boland (Gottox) wrote:
> > Hi!
> > 
> > Please recheck current tip of surf. If there are no big stoppers, I
> > will release it next week.
> > 
> > There are still some bugs regarding cookies, They are delayed to 0.5.
> > 
> > kind regards,
> > 
> > Enno
> > 
> 
> I just updated to tip again, and cookies are much worse than before.
> Now I can't seem to log into any website at all.  I thought it was the
> new useragent so I changed it back, but it didn't solve the problem.

Has nothing to do with the User-Agent. Remove your cookies file, start
fresh, that helps a lot mostly.

-- 
Marvin Vek
-
printk("Cool stuff's happening!
")
linux-2.4.3/fs/jffs/intrep.c



Re: [dev] [surf] please recheck tip

2010-05-25 Thread Josh Rickmar
On Tue, May 25, 2010 at 05:05:57PM +0200, Marvin Vek wrote:
> On Tue, May 25, 2010 at 11:04:07AM -0400, Josh Rickmar wrote:
> > On Mon, May 24, 2010 at 09:33:10PM +0200, Enno Boland (Gottox) wrote:
> > > Hi!
> > > 
> > > Please recheck current tip of surf. If there are no big stoppers, I
> > > will release it next week.
> > > 
> > > There are still some bugs regarding cookies, They are delayed to 0.5.
> > > 
> > > kind regards,
> > > 
> > > Enno
> > > 
> > 
> > I just updated to tip again, and cookies are much worse than before.
> > Now I can't seem to log into any website at all.  I thought it was the
> > new useragent so I changed it back, but it didn't solve the problem.
> 
> Has nothing to do with the User-Agent. Remove your cookies file, start
> fresh, that helps a lot mostly.

I did this already.  I can see that cookies are being saved to the new
file, but it seems like surf is not reading them at all.



Re: [dev] [surf] please recheck tip

2010-05-25 Thread Jeremiah Dow
Yes - you probably don't want to default the sessiontime to 0 again yet -
Google/Gmail still won't recognize cookies with that set, I don' t know
about others.

Jeremiah

On Tue, May 25, 2010 at 11:08 AM, Josh Rickmar wrote:

> On Tue, May 25, 2010 at 05:05:57PM +0200, Marvin Vek wrote:
> > On Tue, May 25, 2010 at 11:04:07AM -0400, Josh Rickmar wrote:
> > > On Mon, May 24, 2010 at 09:33:10PM +0200, Enno Boland (Gottox) wrote:
> > > > Hi!
> > > >
> > > > Please recheck current tip of surf. If there are no big stoppers, I
> > > > will release it next week.
> > > >
> > > > There are still some bugs regarding cookies, They are delayed to 0.5.
> > > >
> > > > kind regards,
> > > >
> > > > Enno
> > > >
> > >
> > > I just updated to tip again, and cookies are much worse than before.
> > > Now I can't seem to log into any website at all.  I thought it was the
> > > new useragent so I changed it back, but it didn't solve the problem.
> >
> > Has nothing to do with the User-Agent. Remove your cookies file, start
> > fresh, that helps a lot mostly.
>
> I did this already.  I can see that cookies are being saved to the new
> file, but it seems like surf is not reading them at all.
>
>


Re: [dev] [surf] please recheck tip

2010-05-25 Thread Josh Rickmar
On Tue, May 25, 2010 at 11:09:27AM -0400, Jeremiah Dow wrote:
> Yes - you probably don't want to default the sessiontime to 0 again yet -
> Google/Gmail still won't recognize cookies with that set, I don' t know
> about others.
> 
> Jeremiah

Thanks, this fixed it.



Re: [dev] [surf] please recheck tip

2010-05-25 Thread pancake
the thing is that my patch was NOT setting any session time to the 
cookie (so, using the one specified by the host)

this way it should work fine.

On 05/25/10 17:09, Jeremiah Dow wrote:
Yes - you probably don't want to default the sessiontime to 0 again 
yet - Google/Gmail still won't recognize cookies with that set, I don' 
t know about others.


Jeremiah

On Tue, May 25, 2010 at 11:08 AM, Josh Rickmar 
mailto:joshua_rick...@eumx.net>> wrote:


On Tue, May 25, 2010 at 05:05:57PM +0200, Marvin Vek wrote:
> On Tue, May 25, 2010 at 11:04:07AM -0400, Josh Rickmar wrote:
> > On Mon, May 24, 2010 at 09:33:10PM +0200, Enno Boland (Gottox)
wrote:
> > > Hi!
> > >
> > > Please recheck current tip of surf. If there are no big
stoppers, I
> > > will release it next week.
> > >
> > > There are still some bugs regarding cookies, They are
delayed to 0.5.
> > >
> > > kind regards,
> > >
> > > Enno
> > >
> >
> > I just updated to tip again, and cookies are much worse than
before.
> > Now I can't seem to log into any website at all.  I thought it
was the
> > new useragent so I changed it back, but it didn't solve the
problem.
>
> Has nothing to do with the User-Agent. Remove your cookies file,
start
> fresh, that helps a lot mostly.

I did this already.  I can see that cookies are being saved to the new
file, but it seems like surf is not reading them at all.






Re: [dev] [surf] please recheck tip

2010-05-25 Thread Nibble
For the moment I've done a little patch (against tip) that fixes the
recently removed "wget download" feature, and also allows to download
files using the "Download linked file" entry in the popup menu. It
would be easy change the DOWNLOAD(p) macro to use another download
manager.

Kind regards,
-- nibble

On Tue, 25 May 2010 15:41:24 +0200
pancake  wrote:

> On 05/25/10 15:24, Josh Rickmar wrote:
> > On Tue, May 25, 2010 at 11:36:28AM +0200, Claudio M. Alessi wrote:
> >
> >> On Mon, May 24, 2010 at 04:06:00PM -0400, Josh Rickmar wrote:
> >>  
> >>> Also, is there a better way of doing cookies then wget?  As an
> >>> (Open)BSD user, I'd like to use something in base (I did install
> >>> wget though to test to make sure that wasn't the download problem
> >>> above). 
> >> IIRC you can use ftp(1) for HTTP requests.
> >>  
> > Thanks, I knew about (and use) ftp(1), but didn't think it would
> > work with cookies.  However, after checking the manpage, I see that
> > it does support them with the -c flag.
> >
> >
> Why dont distribute a shellscript that gets URL+cookie as arguments,
> and let the users implement their own methods like using wget, ftp,
> curl, firefox* or whatever
> 
> * = yeah, using surf for browsing and firefox for download is the most
> retarded idea i can think of xD.. but surely..opening xterm or having
> a way to display all wgets in a single xterm would be good (dvtm?)
> 
> Having a suckless download manager can be good. just few locs in sh.
> 
> --pancake
> 

diff -r 4fe78ffcd81e config.def.h
--- a/config.def.h	Tue May 25 10:38:23 2010 +0200
+++ b/config.def.h	Tue May 25 15:48:41 2010 +0200
@@ -12,9 +12,15 @@
 	"prop=\"`xprop -id $2 $0 | cut -d '\"' -f 2 | dmenu`\" &&" \
 	"xprop -id $2 -f $1 8s -set $1 \"$prop\"", \
 	p, q, winid, NULL } }
+#define DOWNLOAD(p)   { \
+	.v = (char *[]){ "/bin/sh", "-c", \
+	"prop=\"`xprop -id $1 $0 | cut -d '\"' -f 2`\";" \
+	"xterm -e \"wget --load-cookies ~/.surf/cookies.txt $prop;\"", \
+	p, winid, NULL } }
 #define MODKEY GDK_CONTROL_MASK
 static Key keys[] = {
 /* modifier	keyval  functionarg Focus */
+{ MODKEY,   GDK_s,  spawn,  DOWNLOAD("_SURF_HILIGHT") },
 { MODKEY|GDK_SHIFT_MASK,GDK_r,  reload, { .b = TRUE } },
 { MODKEY,   GDK_r,  reload, { .b = FALSE } },
 { MODKEY|GDK_SHIFT_MASK,GDK_p,  print,  { 0 } },
diff -r 4fe78ffcd81e surf.c
--- a/surf.c	Tue May 25 10:38:23 2010 +0200
+++ b/surf.c	Tue May 25 15:48:41 2010 +0200
@@ -81,6 +81,7 @@
 static const char *getcookies(SoupURI *uri);
 static char *geturi(Client *c);
 void gotheaders(SoupMessage *msg, gpointer user_data);
+static gboolean initdownload(WebKitWebView *v, WebKitDownload *o, Client *c);
 static gboolean keypress(GtkWidget *w, GdkEventKey *ev, Client *c);
 static void linkhover(WebKitWebView *v, const char* t, const char* l, Client *c);
 static void loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c);
@@ -329,6 +330,16 @@
 }
 
 gboolean
+initdownload(WebKitWebView *view, WebKitDownload *o, Client *c) {
+	Arg cmd;
+
+	updatewinid(c);
+	cmd = (Arg)DOWNLOAD("_SURF_HILIGHT");
+	spawn(c, &cmd);
+	return FALSE;
+}
+
+gboolean
 keypress(GtkWidget* w, GdkEventKey *ev, Client *c) {
 	guint i;
 	gboolean processed = FALSE;
@@ -454,6 +465,7 @@
 	g_signal_connect(G_OBJECT(c->view), "window-object-cleared", G_CALLBACK(windowobjectcleared), c);
 	g_signal_connect(G_OBJECT(c->view), "notify::load-status", G_CALLBACK(loadstatuschange), c);
 	g_signal_connect(G_OBJECT(c->view), "notify::progress", G_CALLBACK(progresschange), c);
+	g_signal_connect(G_OBJECT(c->view), "download-requested", G_CALLBACK(initdownload), c);
 
 	/* Indicator */
 	c->indicator = gtk_drawing_area_new();
@@ -495,6 +507,7 @@
 
 	setatom(c, AtomFind, "");
 	setatom(c, AtomUri, "about:blank");
+	setatom(c, AtomHiLight, "about:blank");
 	if(NOBACKGROUND)
 		webkit_web_view_set_transparent(c->view, TRUE);
 
@@ -750,6 +763,7 @@
 		t = g_strdup(c->linkhover);
 	else
 		t = g_strdup(c->title);
+	setatom(c, AtomHiLight, c->linkhover ? c->linkhover : geturi(c));
 	drawindicator(c);
 	gtk_window_set_title(GTK_WINDOW(c->win), t);
 	g_free(t);


Re: [dev] problem: make deb

2010-05-25 Thread Davide Anchisi
Hi Kris,

debian: some other problem...

First of all, I successfully  compiled (through apt-get -b source
wmii) the debian package pointing sources.list to the Ubuntu archive
you told me. Thanks for the suggestion.

I also tried to modify the Makefile in 3.9 according to the fix you
made in changeset 2633, but now another error occurred. Below the
relevant part of the output of the make deb building process:

[...]
parsechangelog/debian: warning: debian/changelog(l6): found eof
where expected first heading
parsechangelog/debian: error: fatal error occured while parsing input
dpkg-buildpackage: error: changelog parser
/usr/lib/dpkg/parsechangelog/debian gave error exit status 255
make: *** [deb] Error 255


   Davide


2010/5/24 Kris Maglione :
> On Mon, 24 May 2010 15:08:49 +0200
> Davide Anchisi  wrote:
>
>> Hi,
>>
>> I am trying to build wmii 3.9 using "make deb", but it does not work.
>> It just report: make: *** [deb] Error 1
>>
>> While "make deb"  DO work in building hg2631.
>
> Sorry. All of my debian builds happen on the Ubuntu build farm. I don't
> run debian myself, so it's a bit hard to test these things. I'll fix
> the Makefile, but have you tried the Ubuntu PPA? It should work fine on
> debian.
>
>    https://launchpad.net/~maglione-k/+archive/ppa
>    http://ppa.launchpad.net/maglione-k/ppa/ubuntu/pool/main/w/wmii/
>
> --
> Kris Maglione
>
> The wireless telegraph is not difficult to understand.  The ordinary
> telegraph is like a very long cat.  You pull the tail in New York, and
> it meows in Los Angeles.  The wireless is the same, only without the
> cat.
>        --Albert Einstein
>
>
>



[dev] Announcing rc-http 1.0

2010-05-25 Thread Ethan Grammatikidis
rc-httpd is a web server designed to run anywhere werc will, requiring  
only rc, awk, sed, and ls from the Plan 9 toolset. At 388 lines of  
code it's not tiny, but it is rather feature-complete. It will serve  
CGI scripts (including werc), its own modules (rather more efficient  
than CGI), static files, and automatically index directories across  
multiple separately-configured virtual hosts. Configuration requires  
writing rc script, but I think many people will still find it easier  
than configuring Apache or many other servers.


Find it at http://eekee.is-a-geek.org/rc-httpd/

I hope this message isn't too much like spam. I wanted to get the news  
of rc-httpd's existence 'out there', but won't be announcing future  
releases on these lists unless encouraged otherwise. Mail me off-list  
if you would like news of future updates.


--
Simplicity does not precede complexity, but follows it. -- Alan Perlis




Re: [dev] problem: make deb

2010-05-25 Thread Kris Maglione
On Tue, 25 May 2010 18:10:19 +0200
Davide Anchisi  wrote:

> Hi Kris,
> 
> debian: some other problem...
> 
> First of all, I successfully  compiled (through apt-get -b source
> wmii) the debian package pointing sources.list to the Ubuntu archive
> you told me. Thanks for the suggestion.
> 
> I also tried to modify the Makefile in 3.9 according to the fix you
> made in changeset 2633, but now another error occurred. Below the
> relevant part of the output of the make deb building process:
> 
> [...]
> parsechangelog/debian: warning: debian/changelog(l6): found eof
> where expected first heading
> parsechangelog/debian: error: fatal error occured while parsing input
> dpkg-buildpackage: error: changelog parser
> /usr/lib/dpkg/parsechangelog/debian gave error exit status 255
> make: *** [deb] Error 255

I mangled my release script (not the one that uploads to the
Ubuntu PPA, fortunately) after I posted 3.9, and all kinds of things
went wrong when I tried to post a 3.9-1 tarball. There are some extra
3.9 release changelog entries and the date format is wrong. I'm posting
an updated tarball later today, so it should be fixed then.

-- 
Kris Maglione

We shall do a much better programming job, provided we approach the
task with a full appreciation of its tremendous difficulty, provided
that we respect the intrinsic limitations of the human mind and
approach the task as very humble programmers.
--Alan Turing




Re: [dev] [surf] please recheck tip

2010-05-25 Thread pancake

+1

Gottox. Can u review it?

On May 25, 2010, at 5:35 PM, Nibble  wrote:


For the moment I've done a little patch (against tip) that fixes the
recently removed "wget download" feature, and also allows to download
files using the "Download linked file" entry in the popup menu. It
would be easy change the DOWNLOAD(p) macro to use another download
manager.

Kind regards,
-- nibble

On Tue, 25 May 2010 15:41:24 +0200
pancake  wrote:


On 05/25/10 15:24, Josh Rickmar wrote:

On Tue, May 25, 2010 at 11:36:28AM +0200, Claudio M. Alessi wrote:


On Mon, May 24, 2010 at 04:06:00PM -0400, Josh Rickmar wrote:


Also, is there a better way of doing cookies then wget?  As an
(Open)BSD user, I'd like to use something in base (I did install
wget though to test to make sure that wasn't the download problem
above).

IIRC you can use ftp(1) for HTTP requests.


Thanks, I knew about (and use) ftp(1), but didn't think it would
work with cookies.  However, after checking the manpage, I see that
it does support them with the -c flag.



Why dont distribute a shellscript that gets URL+cookie as arguments,
and let the users implement their own methods like using wget, ftp,
curl, firefox* or whatever

* = yeah, using surf for browsing and firefox for download is the  
most

retarded idea i can think of xD.. but surely..opening xterm or having
a way to display all wgets in a single xterm would be good (dvtm?)

Having a suckless download manager can be good. just few locs in sh.

--pancake








Re: [dev] [dwm] can't toggle tags with mouse

2010-05-25 Thread Andreas Amann
> Whenever I use the polish layout this effect appears. The german layout on
> the other side still works fine.
> 
> What could that be?
> 


I had a similar problem when switching between uk <-> de layout. The reason
was that when the alternate second keyboard is active,
the bit 13 of XEvent->xbutton->state is switched on.

The following hack fixed it for me, but might not be very portable:


diff --git a/dwm.c b/dwm.c
--- a/dwm.c
+++ b/dwm.c
@@ -43,7 +43,7 @@
 /* macros */
 #define D   if(1)
 #define BUTTONMASK  (ButtonPressMask|ButtonReleaseMask)
-#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask))
+#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask|1L<<13))
 #define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y) >=
 # (RY) && (Y) < (RY) + (RH))
 #define ISVISIBLE(C)((C->tags &
 # C->mon->tagset[C->mon->seltags]))
 #define LENGTH(X)   (sizeof X / sizeof X[0])






Alternatively you can also add buttons in config.h with bit 13 set in the
event mask. The real fix fight be to rewrite CLEANMASK so that it only lets
through desirable modifiers. 

Andreas



Re: [dev] [dwm] can't toggle tags with mouse

2010-05-25 Thread orschiro
Hello Andres,

thank you for your patch. I had to adjust it a little bit but it's working
flawlessly now. :)

Best regards

Robert

2010/5/25 Andreas Amann 

> > Whenever I use the polish layout this effect appears. The german layout
> on
> > the other side still works fine.
> >
> > What could that be?
> >
>
>
> I had a similar problem when switching between uk <-> de layout. The reason
> was that when the alternate second keyboard is active,
> the bit 13 of XEvent->xbutton->state is switched on.
>
> The following hack fixed it for me, but might not be very portable:
>
>
> diff --git a/dwm.c b/dwm.c
> --- a/dwm.c
> +++ b/dwm.c
> @@ -43,7 +43,7 @@
>  /* macros */
>  #define D   if(1)
>  #define BUTTONMASK  (ButtonPressMask|ButtonReleaseMask)
> -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask))
> +#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask|1L<<13))
>  #define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y)
> >=
>  # (RY) && (Y) < (RY) + (RH))
>  #define ISVISIBLE(C)((C->tags &
>  # C->mon->tagset[C->mon->seltags]))
>  #define LENGTH(X)   (sizeof X / sizeof X[0])
>
>
>
>
>
>
> Alternatively you can also add buttons in config.h with bit 13 set in the
> event mask. The real fix fight be to rewrite CLEANMASK so that it only lets
> through desirable modifiers.
>
> Andreas
>
>


[dev] [surf] Patch: horizontal scroll

2010-05-25 Thread Ivy Foster
Howdy, folks,

I'm a new subscriber, and thought I'd start with a patch.
The attached patch adds horizontal scrolling to surf, mainly
so that it can be bound to a key aside from the arrow keys.

The function `scroll()' has been renamed to `vscroll()', and
a new function called `hscroll()' has been added.

As a warning, to keep the scrolling keybinds consistent
(left on l, right on h), navigate() keybinds have been moved
to MODKEY+b for backwards navigation & MODKEY+f for forwards
navigation.

Thanks a lot, and I hope this is useful.

Ivy Foster

diff -r 4fe78ffcd81e config.def.h
--- a/config.def.h	Tue May 25 10:38:23 2010 +0200
+++ b/config.def.h	Tue May 25 16:35:38 2010 -0500
@@ -23,10 +23,12 @@
 { MODKEY|GDK_SHIFT_MASK,GDK_j,  zoom,   { .i = -1 } },
 { MODKEY|GDK_SHIFT_MASK,GDK_k,  zoom,   { .i = +1 } },
 { MODKEY|GDK_SHIFT_MASK,GDK_i,  zoom,   { .i = 0  } },
-{ MODKEY,   GDK_l,  navigate,   { .i = +1 } },
-{ MODKEY,   GDK_h,  navigate,   { .i = -1 } },
-{ MODKEY,   GDK_j,  scroll, { .i = +1 } },
-{ MODKEY,   GDK_k,  scroll, { .i = -1 } },
+{ MODKEY,   GDK_f,  navigate,   { .i = +1 } },
+{ MODKEY,   GDK_b,  navigate,   { .i = -1 } },
+{ MODKEY,   GDK_j,  vscroll,{ .i = +1 } },
+{ MODKEY,   GDK_k,  vscroll,{ .i = -1 } },
+{ MODKEY,   GDK_l,  hscroll,{ .i = +1 } },
+{ MODKEY,   GDK_h,  hscroll,{ .i = -1 } },
 { 0,GDK_Escape, stop,   { 0 } },
 { MODKEY,   GDK_o,  source, { 0 } },
 { MODKEY,   GDK_g,  spawn,  SETPROP("_SURF_URI", "_SURF_GO") },
diff -r 4fe78ffcd81e surf.1
--- a/surf.1	Tue May 25 10:38:23 2010 +0200
+++ b/surf.1	Tue May 25 16:35:38 2010 -0500
@@ -39,10 +39,10 @@
 .B Escape
 Stops loading current page or stops download.
 .TP
-.B Ctrl\-h
+.B Ctrl\-b
 Walks back the history.
 .TP
-.B Ctrl\-l
+.B Ctrl\-f
 Walks forward the history.
 .TP
 .B Ctrl\-k
@@ -51,6 +51,12 @@
 .B Ctrl\-j
 Scrolls page downwards.
 .TP
+.B Ctrl\-h
+Scrolls page left.
+.TP
+.B Ctrl\-l
+Scrolls page right.
+.TP
 .B Ctrl\-Shift\-k
 Zooms page in.
 .TP
diff -r 4fe78ffcd81e surf.c
--- a/surf.c	Tue May 25 10:38:23 2010 +0200
+++ b/surf.c	Tue May 25 16:35:38 2010 -0500
@@ -82,6 +82,7 @@
 static char *geturi(Client *c);
 void gotheaders(SoupMessage *msg, gpointer user_data);
 static gboolean keypress(GtkWidget *w, GdkEventKey *ev, Client *c);
+static void hscroll(Client *c, const Arg *arg);
 static void linkhover(WebKitWebView *v, const char* t, const char* l, Client *c);
 static void loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c);
 static void loaduri(Client *c, const Arg *arg);
@@ -95,7 +96,6 @@
 static void progresschange(WebKitWebView *view, GParamSpec *pspec, Client *c);
 static void reload(Client *c, const Arg *arg);
 static void resize(GtkWidget *w, GtkAllocation *a, Client *c);
-static void scroll(Client *c, const Arg *arg);
 static void setatom(Client *c, int a, const char *v);
 static void setcookie(SoupCookie *c);
 static void setup(void);
@@ -107,6 +107,7 @@
 static void update(Client *c);
 static void updatewinid(Client *c);
 static void usage(void);
+static void vscroll(Client *c, const Arg *arg);
 static void windowobjectcleared(GtkWidget *w, WebKitWebFrame *frame, JSContextRef js, JSObjectRef win, Client *c);
 static void zoom(Client *c, const Arg *arg);
 
@@ -328,6 +329,19 @@
 	soup_cookies_free(l);
 }
 
+void
+hscroll(Client *c, const Arg *arg) {
+	gdouble h;
+	GtkAdjustment *a;
+
+	a = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(c->scroll));
+	h = gtk_adjustment_get_value(a);
+	h += gtk_adjustment_get_step_increment(a) * arg->i;
+	h = MAX(h, 0.0);
+	h = MIN(h, gtk_adjustment_get_upper(a) - gtk_adjustment_get_page_size(a));
+	gtk_adjustment_set_value(a, h);
+}
+
 gboolean
 keypress(GtkWidget* w, GdkEventKey *ev, Client *c) {
 	guint i;
@@ -616,19 +630,6 @@
 }
 
 void
-scroll(Client *c, const Arg *arg) {
-	gdouble v;
-	GtkAdjustment *a;
-
-	a = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(c->scroll));
-	v = gtk_adjustment_get_value(a);
-	v += gtk_adjustment_get_step_increment(a) * arg->i;
-	v = MAX(v, 0.0);
-	v = MIN(v, gtk_adjustment_get_upper(a) - gtk_adjustment_get_page_size(a));
-	gtk_adjustment_set_value(a, v);
-}
-
-void
 setcookie(SoupCookie *c) {
 	int lock;
 
@@ -768,6 +769,19 @@
 }
 
 void
+vscroll(Client *c, const Arg *arg) {
+	gdouble v;
+	GtkAdjustment *a;
+
+	a = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(c->scroll));
+	v = gtk_adjustment_get_value(a);
+	v += gtk_adjustment_get_step_increment(a) * arg->i;
+	v = MAX(v, 0.0);
+	v = MIN(v, gtk_adjustment_get_upper(a) - gtk_adjustment_get_page_size(a));
+	gtk_adjustment_set_value(a, v);
+}
+
+void
 windowobjectcleared(GtkWidget *w, WebKitWebFrame *frame, JSContextRef js

Re: [dev] [dwm] can't toggle tags with mouse

2010-05-25 Thread orschiro
Sorry forgot to add a small request when we're already talking about this issue.

Is there any way to display the currently used layout via xsetroot in statusbar?

Regards

Robert

> 2010/5/25 
>>
>> Hello Andres,
>>
>> thank you for your patch. I had to adjust it a little bit but it's working 
>> flawlessly now. :)
>>
>> Best regards
>>
>> Robert
>>
>> 2010/5/25 Andreas Amann 
>>>
>>> > Whenever I use the polish layout this effect appears. The german layout on
>>> > the other side still works fine.
>>> >
>>> > What could that be?
>>> >
>>>
>>>
>>> I had a similar problem when switching between uk <-> de layout. The reason
>>> was that when the alternate second keyboard is active,
>>> the bit 13 of XEvent->xbutton->state is switched on.
>>>
>>> The following hack fixed it for me, but might not be very portable:
>>>
>>>
>>> diff --git a/dwm.c b/dwm.c
>>> --- a/dwm.c
>>> +++ b/dwm.c
>>> @@ -43,7 +43,7 @@
>>>  /* macros */
>>>  #define D                       if(1)
>>>  #define BUTTONMASK              (ButtonPressMask|ButtonReleaseMask)
>>> -#define CLEANMASK(mask)         (mask & ~(numlockmask|LockMask))
>>> +#define CLEANMASK(mask)         (mask & ~(numlockmask|LockMask|1L<<13))
>>>  #define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y) >=
>>>  # (RY) && (Y) < (RY) + (RH))
>>>  #define ISVISIBLE(C)            ((C->tags &
>>>  # C->mon->tagset[C->mon->seltags]))
>>>  #define LENGTH(X)               (sizeof X / sizeof X[0])
>>>
>>>
>>>
>>>
>>>
>>>
>>> Alternatively you can also add buttons in config.h with bit 13 set in the
>>> event mask. The real fix fight be to rewrite CLEANMASK so that it only lets
>>> through desirable modifiers.
>>>
>>> Andreas
>>>
>>
>



Re: [dev] [surf] Patch: horizontal scroll

2010-05-25 Thread Marvin Vek
On Tue, May 25, 2010 at 04:47:02PM -0500, Ivy Foster wrote:
> The attached patch adds horizontal scrolling to surf, mainly
> so that it can be bound to a key aside from the arrow keys.
> 
> The function `scroll()' has been renamed to `vscroll()', and
> a new function called `hscroll()' has been added.
> 
> As a warning, to keep the scrolling keybinds consistent
> (left on l, right on h), navigate() keybinds have been moved
> to MODKEY+b for backwards navigation & MODKEY+f for forwards
> navigation.
> 
> Thanks a lot, and I hope this is useful.

Oooo i love it, and the keybind changes too.

-- 
Marvin Vek
-
printk(KERN_WARNING "Hey who turned the DMA off?
");
linux-2.6.6/drivers/net/wan/z85230.c