[dev] [surf] Man fix patch and feature inquiry

2009-12-02 Thread Jonathan Slark

Hi all,

I just made a small fix to the surf man page which adds a few missing 
keys.  The go to next/previous search result is quite important, I 
didn't release it existed till I noticed in the config.h some while 
after first using surf, I was thinking about writing the functions 
myself :o.


There's two things I miss having in surf:

1) Middle mouse button auto scroll à la Firefox.  I could possibly 
simulate this in surf.c but I was wondering if there is a feature like 
this already in GTK windows or WebKitGTK+?


2) Being able to set a proxy.  I would appreciate if surf honored 
http_proxy and https_proxy environment variables but I have no idea how 
easy this would be to implement.


Thanks,
Jon

PS I am loving the suckless.org website and software!  I really like 
your philosophy and am planning to try out Plan 9 from User Space.
diff -rup src/surf-0.3/surf.1 src.work/surf-0.3/surf.1
--- src/surf-0.3/surf.1 2009-10-30 12:41:02.0 +
+++ src.work/surf-0.3/surf.12009-12-03 06:33:28.940400761 +
@@ -27,6 +27,9 @@ Prints xid to standard output. This can 
 .BR xprop(1).
 .SH USAGE
 .TP
+.B Escape
+Stops loading current page or stops download.
+.TP
 .B Ctrl\-h
 Walks back the history.
 .TP
@@ -51,6 +54,12 @@ Resets Zoom
 .B Ctrl\-/
 Opens the search-bar.
 .TP
+.B Ctrl\-n
+Go to next search result.
+.TP
+.B Ctrl\-Shift\-n
+Go to previous search result.
+.TP
 .B Ctrl\-g
 Opens the URL-bar.
 .TP


Re: [dev] Binding mouse events in surf

2009-12-02 Thread Jonathan Slark

Josh Rickmar wrote:

Is there any way to currently bind mouse buttons to functions in surf's
config.h? I'm trying to figure out a way to make the forward/backward
buttons on my mouse (buttons 8 and 9) call the navigate function. Are
there any GDK_* values for the mouse which will work?

If something like this isn't currently possible, is there an external
application to bind these buttons to the back/forward keyboard shortcuts
when a surf window has focus?


That is kinda weird, I was looking into this myself today!

First I tried to write a small piece of JavaScript to do it but it 
didn't seem to support anything more than three buttons.  I gave up and 
was browsing the archive of this mailing list when I came across Michael 
Roth's patch to do this for 0.2, it also supported mouse chords.


I downloaded the patch but it failed against the 0.3 source.  I remade 
the patch but I it didn't work too well.  When I pressed the buttons it 
would go back or forward on both the press and the release, ie it would 
go back or forward twice instead of just the once.  Also GTK was 
spitting out a critical error about the rewritten context menu in the patch.


I've removed the rewritten context menu so it just uses the normal surf 
code.  I've further simplified the patch by removing mouse chording 
support, in doing this I also solved the press/release bug.


In short, the patch is very simple and does the job.  The patch updates 
config.def.h so refer to this for how to bind the mouse buttons.


Jon.

diff -rupN src.orig/surf-0.3/config.def.h src/surf-0.3/config.def.h
--- src.orig/surf-0.3/config.def.h  2009-10-30 12:41:02.0 +
+++ src/surf-0.3/config.def.h   2009-12-03 03:12:40.533573651 +
@@ -35,6 +35,12 @@ static Key keys[] = {
 { MODKEY|GDK_SHIFT_MASK,GDK_n,  find,   { .b = FALSE } },
 };
 
+static Button buttons[] = {
+/* modifier button  functionarg */
+{ 0,8,  navigate,   { .i = -1 } },
+{ 0,9,  navigate,   { .i = +1 } },
+};
+
 static Item items[] = {
 { "Back",   navigate,  { .i = -1 } },
 { "Forward",navigate,  { .i = +1 } },
diff -rupN src.orig/surf-0.3/surf.c src/surf-0.3/surf.c
--- src.orig/surf-0.3/surf.c2009-10-30 12:41:02.0 +
+++ src/surf-0.3/surf.c 2009-12-03 03:07:54.654550576 +
@@ -54,6 +54,13 @@ typedef struct {
const Arg arg;
 } Key;
 
+typedef struct {
+   guint mod;
+   guint button;
+   void (*func)(Client *c, const Arg *arg);
+   const Arg arg;
+} Button;
+
 static Display *dpy;
 static Atom uriprop, findprop;
 static SoupCookieJar *cookies;
@@ -87,6 +94,7 @@ static char *geturi(Client *c);
 static gboolean initdownload(WebKitWebView *v, WebKitDownload *o, Client *c);
 static void itemclick(GtkMenuItem *mi, Client *c);
 static gboolean keypress(GtkWidget *w, GdkEventKey *ev, Client *c);
+static gboolean buttonevent(WebKitWebView *v, GdkEventButton *ev, Client *c);
 static void linkhover(WebKitWebView *v, const char* t, const char* l, Client 
*c);
 static void loadcommit(WebKitWebView *v, WebKitWebFrame *f, Client *c);
 static void loadstart(WebKitWebView *v, WebKitWebFrame *f, Client *c);
@@ -408,6 +416,25 @@ keypress(GtkWidget* w, GdkEventKey *ev, 
return processed;
 }
 
+gboolean
+buttonevent(WebKitWebView *v, GdkEventButton *ev, Client *c) {
+   guint i;
+   gboolean processed = FALSE;
+
+   updatewinid(c);
+   if(ev->type == GDK_BUTTON_PRESS) {
+   for(i = 0; i < LENGTH(buttons); i++) {
+   if(ev->button == buttons[i].button
+   && CLEANMASK(ev->state) == 
buttons[i].mod
+   && buttons[i].func) {
+   buttons[i].func(c, &(buttons[i].arg));
+   processed = TRUE;
+   }
+   }
+   }
+return processed;
+}
+
 void
 linkhover(WebKitWebView *v, const char* t, const char* l, Client *c) {
if(l)
@@ -505,6 +532,7 @@ newclient(void) {
g_signal_connect(G_OBJECT(c->view), "download-requested", 
G_CALLBACK(initdownload), c);
g_signal_connect(G_OBJECT(c->view), "window-object-cleared", 
G_CALLBACK(windowobjectcleared), c);
g_signal_connect(G_OBJECT(c->view), "populate-popup", 
G_CALLBACK(context), c);
+   g_signal_connect(G_OBJECT(c->view), "button-press-event", 
G_CALLBACK(buttonevent), c);
 
/* Indicator */
c->indicator = gtk_drawing_area_new();


Re: [dev] dmc 0.1

2009-12-02 Thread Daniel Cordero
On Wed, Dec 02, 2009 20:09:58 +0100, pancake wrote:
> Let me know what do you think about it. And feel free to hack it,
> test it, blame it or so :)
> 
> Have fun!
> 

I'm really impressed. This looks like a great mail client.
Once I figure how why I can't send or recieve messages, you could expect
patches coming your way.



Re: [dev] Suckless VOIP client?

2009-12-02 Thread hiro
I use an AVM fritz!box, a nice little mipsel box running a small 2.4
linux kernel on 16mb ram.
Had a lot of fun with this thing, and it also brings voip to my old
analog phone.
It's a pity their lightweight client is closed source :(
There is probably comparable hardware outside of Germany.

You can try linphone and freeswitch, but I think both are pushing the
"linux-style" a little too far. Can't remember anything else worth
mentioning.

On Tue, Dec 1, 2009 at 4:16 PM, Peter John Hartman
 wrote:
> pjsua is a bit of a hack; i'd also like to see a project started up.
>
> peter
>
>
> On Wed, 2 Dec 2009, Doki Pen wrote:
>
>> What do ppl use?  I'd love to find a way to make calls from the shell,
>> sans-gui.
>>
>>
>
>



[dev] [dmenu] Vertical bug

2009-12-02 Thread Tadeusz Sośnierz
Hello,
Looks like dmenu (in tip) ignores the -l argument, assuming 10 anyway.
Regards,
Ted



[dev] dmc 0.1

2009-12-02 Thread pancake

It's quite some long time I don't give any news about dmc.

Nibble and me did some work on it, so it's partially usable, but 
actually we're out of
time to continue it. For this reason I have decided to publish the first 
release of dmc.


DMC stands for Dynamic Mail Client. The project started as a toy 
replacement for client-side
mail applications to support mbox, mdir, imap4, pop3. It also supports 
tagging, some minor
syncronization with local repositories and a daemon mode which allows to 
send commands to

a dmc daemon to the server. It also supports SSH and SSL transport layers.

Many mail accounts can be configured and used from a single interface.

For sending there's just an msmtp frontend and a minimal MX resolver, 
but the idea would be

to fully implement SMTP in a clean way as for pop3/imap4 is done.

The current implementation it is about 814 LOC in C and 438 in 
shellscript. I would like to
have all this stuff in C, but I'm out of time and at the moment of 
writing this I got a bit

bored to type such a program.

The second reason of this email is to query all you to continue the 
development because I
got a bit bored with it and Im really out of time for following it. So, 
if any of you

want to send me patches I will review them and commit to it.

The source code of the project is hosted here:

 $ hg clone http://lolcathost.org/hg/dmc

But for the 0.1 release I have pushed a tarball:

 http://lolcathost.org/b/dmc-0.1.tar.gz

Let me know what do you think about it. And feel free to hack it, test 
it, blame it or so :)


Have fun!

--pancake





[dev] Binding mouse events in surf

2009-12-02 Thread Josh Rickmar
Is there any way to currently bind mouse buttons to functions in surf's
config.h? I'm trying to figure out a way to make the forward/backward
buttons on my mouse (buttons 8 and 9) call the navigate function. Are
there any GDK_* values for the mouse which will work?

If something like this isn't currently possible, is there an external
application to bind these buttons to the back/forward keyboard shortcuts
when a surf window has focus?



Re: [dev] Suckless VOIP client?

2009-12-02 Thread Peter John Hartman

pjsua is a bit of a hack; i'd also like to see a project started up.

peter


On Wed, 2 Dec 2009, Doki Pen wrote:


What do ppl use?  I'd love to find a way to make calls from the shell,
sans-gui.






Re: [dev] [dwm] [patch] ALTRU switching tags with LRU

2009-12-02 Thread markus schnalke
[2009-12-02 13:02] =?ISO-8859-1?Q?M=2E_Huil=E9n_Abed_Moure?= 
 
> 
> This is a patch [...]

Please use

diff -u ...

next time.


meillo



Re: [dev] MoveStack patch

2009-12-02 Thread Niki Yoshiuchi
While I would certainly like to see this functionality in dwm (hence why I
wrote movestack) and would especially like to see my patch make it into the
source (in which case, I might be more committed to updating it regularly),
it doesn't add anything you can't already do in dwm.  It just makes it
easier.

On Tue, Dec 1, 2009 at 7:24 PM, Alex Matviychuk  wrote:

> Does anyone know why this is not in the main source branch? I think I
> remember this functionality being a regular part of DWM.
>
> On Tue, Dec 1, 2009 at 11:31 PM, Niki Yoshiuchi  wrote:
> > Perhaps this is a fools errand as push.c does the same thing, but I'll
> > update movestack in a couple of days.
> >
> > On Tue, Dec 1, 2009 at 1:36 AM, Alex Matviychuk 
> wrote:
> >>
> >> Ah great. That works, thanks!
> >>
> >> On Tue, Dec 1, 2009 at 3:30 PM, Josh Rickmar 
> >> wrote:
> >> > On Tue, Dec 01, 2009 at 02:25:16PM +0900, Alex Matviychuk wrote:
> >> >> Is the movestack patch still being maintained? It does not work
> >> >> against the latest dwm.
> >> >>
> >> >> Is there a reason why this functionality is not mainlined?
> >> >>
> >> >> Ref: http://dwm.suckless.org/patches/movestack
> >> >>
> >> >> Cheers!
> >> >>
> >> >
> >> > I haven't tried movestack, but push.c seems to do the exact same
> thing.
> >> > I'm using it on the latest dwm release with no problems.
> >> >
> >> >
> >>
> >
> >
>
>


[dev] Suckless VOIP client?

2009-12-02 Thread Doki Pen
What do ppl use?  I'd love to find a way to make calls from the shell,
sans-gui.




[dev] [dwm] [patch] ALTRU switching tags with LRU

2009-12-02 Thread M . Huilén Abed Moure
Hi there,

This is a patch for dwm 5.7.2 to switch tags with the algorithm LRU
(Least Recently Used). Just like the known alt+tab from other systems.
It also allows to switch the focused client tag with alt+shift+tab.

Authors: (*) Sherekan and (*) Bardamu.

Hope it will be useful.
214a215
> static void switchtag(const Arg *arg);
233a235
> static void refreshtagcache(int tagmask);
1522c1524,1525
<   |PropertyChangeMask;
---
>   |PropertyChangeMask
>   |KeyReleaseMask;
1565a1569,1592
> switchtag(const Arg *arg) {
>   Client *c;
>   unsigned int i = 0;
>   Client *selclient = selmon->sel;
>   const XEvent ev = {.type = 0};
> 
>   if (selmon->clients == NULL) return;
>   XGrabKeyboard(dpy, root, False, GrabModeAsync, GrabModeAsync, 
> CurrentTime);
>   do {
>   if (ev.type == KeyRelease) continue;
>   do {
>   if (++i >= LENGTH(tagcache) || tagcache[i] == -1) i = 0;
>   for (c = selmon->clients; c != NULL && !(c->tags & 
> tagcache[i]); c = c->next);
>   } while (c == NULL);
>   if ((arg->ui == 1)) selclient->tags = tagcache[i];
>   selmon->tagset[selmon->seltags] = tagcache[i];
>   arrange(selmon);
>   } while (!XMaskEvent(dpy, KeyReleaseMask|KeyPressMask, (XEvent*)&ev) &&
>   ((XKeycodeToKeysym(dpy, (KeyCode)ev.xkey.keycode, 0) == 
> SWITCHTAGKEY)));
>   XUngrabKeyboard(dpy, CurrentTime);
>   refreshtagcache(selmon->tagset[selmon->seltags]);
> }
> 
> void
1569a1597,1598
>   refreshtagcache(arg->ui & TAGMASK);
>   refreshtagcache(selmon->tagset[selmon->seltags]);
1659a1689
>   refreshtagcache(selmon->tagset[selmon->seltags]);
1913a1944,1953
> refreshtagcache(int tagmask) {
>   unsigned int i;
>   if((tagcache[0] == tagmask)) return;
>   for (i = 1; i <= LENGTH(tagcache)-1 && tagcache[i] != tagmask; i++);
>   if (i == LENGTH(tagcache)) i = LENGTH(tagcache) - 1;
>   for (; i > 0; i--) tagcache[i] = tagcache[i-1];
>   tagcache[0] = tagmask;
> }
> 
> void
1920a1961
>   refreshtagcache(selmon->tagset[selmon->seltags]);
17a18
> static int tagcache[] = {1, -1, -1, -1, -1, -1, -1, -1, -1};
37a39
> #define SWITCHTAGKEY XK_Tab
61c63,64
<   { MODKEY,   XK_Tab,view,   {0} },
---
>   { MODKEY,   SWITCHTAGKEY,switchtag,  {.ui = 
> 0} },
>   { MODKEY|ShiftMask, SWITCHTAGKEY,switchtag,  {.ui = 
> 1} },