Re: [dev] [OFFTOPIC] How to know the size of a process?
> On (24/01/10 18:35), pmarin wrote: > > Hi all. > > Anyone know how to know the size (kb) of a process in Linux? > > using the proc filesystem I can know the number of pages that it uses > > (/proc/pid/statm). How I can convert > > it to kb? Any posix way? Here's some funny script [1] I'm aware of, provides a nice lookup table if you really care about these things. Not really sure if you can rely on it, every program I run gives different values when talking about ram (htop, free, this ps_mem). Regards, Ted [1] http://www.pixelbeat.org/scripts/ps_mem.py
Re: [dev] Distribution
On 18-01-2010 22:41:01, Jonathan Slark wrote: > I was wondering what distros people use on this mailing list? I've > tried a lot and I'm not happy with any of them. All I need is a > toolchain/dev utils with minimal X install. I would then compile > all the apps/dwm myself and install using the package manager. > > Crux is even simpler than Arch but it's setup for compiling as root, ugh. You can easily setup fakerooting when building ports, just lookup the wiki. Regards, Ted
Re: [dev] slock - cannot log in
On 17-12-2009 12:26:26, daspostl...@googlemail.com wrote: > Hi guys, > > I've been stably using slock on arch linux for > months (last system update ca. 3 weeks ago) > with awesome. > Right now I am at work, went to the bathroom > 10 mins. ago, locked via slock right before, > came back and couldn't log back in. > I've tried everything: keyboard layout > switches, thinkpad Fn keys, etc. - > anyone have any more ideas other than > power button? Have there ever been similar > reports? > > Any help is most warmly appreciated! I'm sometimes witnessing probably some dpms crap, sometimes I have to enter password a few times, sometimes pressing enter a few times before and after is doing the job, but slock works pretty well for most of the time for me. Regards, Ted
Re: [dev] [wmii][surf] environment variables
What if you'll run `xmessage "$http_proxy"`? Regards On 7-12-2009 21:39:08, pascal wrote: > Hi > > When lauching 'surf' from wimenu, the http_proxy variable is not respected, > while starting it from a X-terminal works as expected. Is there a way to make > wimenu aware of the environment vars (I export the http_proxy from my > ~/.bashrc)? > > pascal >
[dev] [dmenu] Vertical bug
Hello, Looks like dmenu (in tip) ignores the -l argument, assuming 10 anyway. Regards, Ted
Re: [dev] [dmenu] pasting bug
Also, is it a bug or a feature, the missing cursor in vertical patch? Regards, Ted On 1-12-2009 10:17:31, Evan Gates wrote: > Yep, definitely bugs. When I wrote the paste patch cursor wasn't a > part of dmenu, so as of right now paste assumes a cursorless dmenu. > I'll take a look at it tonight and see if I can rewrite paste to work > with cursor. Also what do people think about the sselp dependency? I > can always copy and paste the sselp code directly in instead, let me > know. > > -emg
Re: [dev] [dmenu] pasting bug
└─[%]─> dmenu -v dmenu-4.1, © 2006-2009 dmenu engineers, see LICENSE for details Few-days-ago commit. Regards, Ted On 1-12-2009 12:40:36, Alexander Surma wrote: > Which version are you talking about? I myself don't even have a cursor > or the ability to paste in stable. > > Surma > > 2009/12/1 Tadeusz Sośnierz : > > Hello, > > I think there's a bug in pasting functionality. Steps to reproduce: > > 1. run dmenu > > 2. open some quotation (e.g. ") > > 3. paste some text > > 4. notice that the cursor has not moved > > 5. typing anything, e.g. closing qoutations makes dmenu delete the > > pasted text > > > > Also, when you type two quotations ("") then move the cursor between > > them, and then paste, the paste goes at the end of the text instead of > > being put between quotes. > > > > Kind regards, > > Ted > > > >
[dev] [dmenu] pasting bug
Hello, I think there's a bug in pasting functionality. Steps to reproduce: 1. run dmenu 2. open some quotation (e.g. ") 3. paste some text 4. notice that the cursor has not moved 5. typing anything, e.g. closing qoutations makes dmenu delete the pasted text Also, when you type two quotations ("") then move the cursor between them, and then paste, the paste goes at the end of the text instead of being put between quotes. Kind regards, Ted
Re: [dev] [surf] editing textboxes with external command
Methinks editing such a small thing like url with vim is a bit too much. However, idea of editing postdata and cookies sounds really good to me. Regards On 20-11-2009 13:23:00, c...@wzff.de wrote: > That's a *great* idea. > I don't really like to edit my url with dmenu anyway... liked the GTK > box better and I think editing it with vim would be a lot better than > GTK boxes. > > Moritz > > On Fri, Nov 20, 2009 at 01:10:41PM +0100, pancake wrote: > > We can also use $EDITOR to edit the URL address. > > > > 12:16 < pancake> (get uri, write in file, launch $EDITOR, set contents > > of file in clipboard, set uri) > > > > A cool thing would be to extrapolate this functionality to also edit > > cookies and post data.
[dev] [tabbed] Opening new tab as the last one
Hello, I'm always thinking about this while using tabbed with surf: would it be possible for tabbed to open the new instances in the background, not as the new main tab? I think it would be especially nice when using surf, so one can open a few tabs from links from one page, without moving around to go back to this main one, if you know what I mean. Would it be hard to make some patch for it or something? Regards, Ted
[dev] [surf] bug in url changing
Hello, There is this small bug, not sure if it isn't some dmenu limitation. E.g. when we are on suckless.org/manifest, and then we try to change the uri to suckless.org, surf still puts us to manifest site. No idea how to fix this though. Regards, Ted
Re: [dev] [surf] trouble on last tip
On 9-11-2009 23:12:29, Julien Steinhauser wrote: > Hello, > on a fresh last tip surf build, i experience trouble with suckless.org home > page > when i launch for example : > surf http://suckless.org > the page doesn't load and in dwm status bar it blinks alternatively > [0%] http://suckless.org and suckless.org Dedicated to software that suck less > With other pages I don't have any problem. > Confirming. Sometimes it hands for a couple of seconds and then loads. Random cases I'd say. Regards, Ted
Re: [dev] [tabbed] Autostarting apps
Better than patching. Kind thanks. Regards, Ted On 4-11-2009 15:12:33, Enno Boland (Gottox) wrote: > cat > $HOME/bin/browser > #!/bin/sh > tabbed=`tabbed -d` > surf -e $tabbed "$@" & > ^D > browser > > regards > > 2009/11/4 Tadeusz Sośnierz : > > Hello, > > Any idea how to achieve this? I'd really like to make it start an > > instance of surf on startup, I believe this will need some nice patch. > > Any idea anyone? > > > > Regards, > > Ted
[dev] [tabbed] Autostarting apps
Hello, Any idea how to achieve this? I'd really like to make it start an instance of surf on startup, I believe this will need some nice patch. Any idea anyone? Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] Bookmarks patch for 0.2
On 2-11-2009 02:15:25, Nico Golde wrote: > Hi, > * Tadeusz So??nierz [2009-10-20 16:36]: > [...] > > +showbmarks(Client *c, const Arg *arg) { > > + /* I wonder if 4 kB is too much or not enough */ > > + char html[4096] = ""; > > + /* same here. time will tell */ > > + char uri[128]; > > + FILE *f; > > + stop(c, NULL); > > + f = fopen(bmarksfile, "r"); > > + while(fscanf(f, "%127s\n", uri) != EOF) { > > + snprintf(&html[strlen(html)], sizeof(html) - strlen(html), > > + "%s", uri, uri); > > You may want to html escape the uri, not? Well, there are some security reasons, if that's what you mean. But my tiny investigation (I mean, entering query string to google containing html tags) showed that they become urlencoded by the app itself, so it seems safe to me. If there's anything I don't know, please let me know. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] Bookmarks patch for 0.2
On 2-11-2009 01:04:32, Moritz Wilhelmy wrote: > Would you please add it to the surf page in the suckless wiki? Sure. I'll make a fresh diff today, if there are no protests I'll be glad to submit. Regards, Ted > On Fri, Oct 23, 2009 at 08:52:33PM +0200, Tadeusz Sośnierz wrote: > > On 23-10-2009 19:26:50, Julien Pecqueur wrote: > > > Le mardi 20 octobre 2009 à 02:44:53, Tadeusz Sośnierz a écrit : > > > > Hello, > > > > I wrote some patch for bookmark handling, attached. Everything is driven > > > > by the right-click menu. Sadly, I had no idea how to include some labels > > > > for the urls. Also, I'm rather beggining with C, so I'm sorry for any > > > > eye-stabbing stupidities you may encounter, and please report > > > > them to me. > > > > > > > > Hope You'll like it. > > > > > > I'd have the same idea few weeks ago and i wrote a very-simple bookmarks > > > management implementation for surf (using dmenu). However, your idea of > > > displaying bookmarks list in a about:bookmarks page is smartest :) > > > > > > > +void > > > > +addbookmark(Client *c, const Arg *arg) { > > > > + char *bmark_uri; > > > > + FILE *f; > > > > + bmark_uri = geturi(c); > > > > + f = fopen(bmarksfile, "a+"); > > > > + fprintf(f, "%s\n", geturi(c)); > > > > + fclose(f); > > > > +} > > > > > > The pointer *bmark_uri is not used in the function. > > > > Right, my bad. Thanks for noticing! > > > > > Good job, i'll be apply your patch this evening! > > > > I'm glad you like it. > > > > Regards > > > > -- > > === > > () ascii ribbon campaign - against html e-mail > > /\ www.asciiribbon.org - against proprietary attachments > > > > -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] xprop (was: few bugs)
On 29-10-2009 19:59:17, markus schnalke wrote: > The quoted mail makes me share my thoughts on surf's xprop interface: > > > At first, it seems pretty nice how surf communicates with the outside. > But on closer looks, I dislike the xprop stuff more and more. > > What is shown above does surely not look nice; it's pretty obscure when > you compare it to most of the suckless software we know. > > You may say that this does not matter much, as you only once need to > find out how it has to be done. > > > But -- and this my main point -- the xprop interface is a break on > unleashing the leverage of surf! > > Uzbl may not be as small as surf, it's ``command language'' on the > interface may be a bit too big, but it does one thing right where surf > fails: It *encourages* to combine it with other programs! > > > Surf is able to interface all kinds of programs through xprop, but not > in an easy/flexible enough way. The large number of user scripts that > extend uzbl is not the result of the larger community, but the result of > the interface that makes you want to write ``handler'' scripts. > > Instead of staying hooked to xprop, surf should create a fifo for input > and write stuff to stdout in order to make it easier/more flexible to > combine it with helper scripts. This would improve surf much. > > Here (possibly) more code leads to less complexity combined with more > flexibility. > > > It's not enough to just offer possibilities; important is to encourage > to use them ... by design. In this point surf fails, whereas uzbl does > it right. > > > meillo Agreed. As now the looks like the only place in which surf uses xprop is actually this uri and find handling. It's not really useful for setting the address remotely, as we have better or worse patches for bookmarks, we can open new surf instances in tabbed, etc. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] few bugs
On 29-10-2009 10:42:52, Evan Gates wrote: > >2) When you choose your URI (C-g by default) and then abort it > >pressing [esc] or something, the document is trying to be loaded anyway, > >with empty address. It's a bit too much for the setprop() macro (or is > >it?), but I think some function may check the input from dmenu and set > >it only if it's not empty. > > Change the > "xprop -id $1 -f $0 8s -set $0 \"`echo -n | dmenu || exit 0`\"" > to > "uri=\"`echo -n | dmenu`\" && "xprop -id $1 -f $0 8s -set $0 \"$uri\"" > > This way if the user hits escape, dmenu returns 1, and xprop isn't executed. > > -emg There is a typo in your string, it should go like: "uri=\"`echo -n | dmenu`\" && xprop -id $1 -f $0 8s -set $0 \"$uri\"" Thanks for your help though, works like a charm. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] few bugs
On 29-10-2009 15:05:30, Moritz Wilhelmy wrote: > What about full urls with commas at the end? > example: http://foo.com/bla/bar/asdf, > or even http://bleh.com/?foo=a,s, > Same behaviour? > > Regards, > Moritz Nah, Some of the adresses look ok, some are making silly reactions. Anyway, as long as it does not affect the usual browsing it's not a tragedy. The url entering issue is far more annoying I must say. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] few bugs
On 29-10-2009 09:26:00, Jacob Todd wrote: > On Thu, Oct 29, 2009 at 01:27:53PM +0100, Tadeusz Sośnierz wrote: > > Hello, > > Few reports from me: > > 1) Don't know what's the reason, but typing address like > > 'www.google.com,' (with the comma at the end) is causing surf to act > > weird. > What would you expect it todo, you added a comma to a url. And saying 'is > causing surf to act weird' is very vague. What did it cause surf to do? Well, as far as I can see, looks like surf is trying to display an error and load the page at the same time, which goes in a loop. I believe the error itself would be nice, still it isn't very urgent thing, as no one sane types , at the end of an url on purpose. And full urls with commas in the middle work well, so it's not really annoying. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
[dev] [surf] few bugs
Hello, Few reports from me: 1) Don't know what's the reason, but typing address like 'www.google.com,' (with the comma at the end) is causing surf to act weird. 2) When you choose your URI (C-g by default) and then abort it pressing [esc] or something, the document is trying to be loaded anyway, with empty address. It's a bit too much for the setprop() macro (or is it?), but I think some function may check the input from dmenu and set it only if it's not empty. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
[dev] [surf] searchengines for 0.3
Hello, Fixed the patch for 0.3 this time. Tested, works, hope you'll have fun. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments diff -r 2998ef786732 config.def.h --- a/config.def.h Wed Oct 28 22:22:20 2009 +0100 +++ b/config.def.h Wed Oct 28 23:26:09 2009 +0100 @@ -44,3 +44,7 @@ { "Copy URI", clipboard, { .b = FALSE } }, { "Download", download, { 0 } }, }; + +static SearchEngine searchengines[] = { + { NULL, NULL }, +}; diff -r 2998ef786732 surf.c --- a/surf.cWed Oct 28 22:22:20 2009 +0100 +++ b/surf.cWed Oct 28 23:26:09 2009 +0100 @@ -54,6 +54,11 @@ const Arg arg; } Key; +typedef struct { + char *token; + char *uri; +} SearchEngine; + static Display *dpy; static Atom uriprop, findprop; static SoupCookieJar *cookies; @@ -94,6 +99,7 @@ static void navigate(Client *c, const Arg *arg); static Client *newclient(void); static void newwindow(Client *c, const Arg *arg); +static char *parseuri(const char *uri); static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d); static void print(Client *c, const Arg *arg); static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event, gpointer d); @@ -436,8 +442,7 @@ char *u; const char *uri = (char *)arg->v; - u = g_strrstr(uri, "://") ? g_strdup(uri) - : g_strdup_printf("http://%s";, uri); + u = parseuri(uri); webkit_web_view_load_uri(c->view, u); c->progress = 0; c->title = copystr(&c->title, u); @@ -574,6 +579,24 @@ spawn(NULL, &a); } +char * +parseuri(const char *uri) { + guint i; + for (i = 0; i < LENGTH(searchengines); i++) { + if (searchengines[i].token == NULL || searchengines[i].uri == NULL + || *(uri + strlen(searchengines[i].token)) != ' ') { + continue; + } + if(g_str_has_prefix(uri, searchengines[i].token)) { + return g_strdup_printf(searchengines[i].uri, + uri + strlen(searchengines[i].token) + 1); + } + } + return g_strrstr(uri, "://") ? g_strdup(uri) : + g_strdup_printf("http://%s";, uri); +} + + void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d) { Arg arg = {.v = text };
Re: [dev] [tabbed] first release: tabbed-0.1
On 27-10-2009 14:14:25, Enno Boland (Gottox) wrote: > Hi! > > Here's a shiny new little piece of software for those of you who like > surf (and/or uzbl) but always missed tabs. > > tabbed is a containerapplication which is able to hold xembed-aware > applications. It is written for surf, but tabbed is able to manage > apps like xterm, uzbl, urxvt, etc too. > > Tarball: > http://dl.suckless.org/tools/tabbed-0.1.tar.gz > Mercurial: > http://hg.suckless.org/tabbed/ > > have fun! > > regards, > Enno Well, I was pulling it from your repo from time to time, but no changes. Now I see the time wasn't wasted. Good job, please proceed :) Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] Bookmarks patch for 0.2
On 23-10-2009 19:26:50, Julien Pecqueur wrote: > Le mardi 20 octobre 2009 à 02:44:53, Tadeusz Sośnierz a écrit : > > Hello, > > I wrote some patch for bookmark handling, attached. Everything is driven > > by the right-click menu. Sadly, I had no idea how to include some labels > > for the urls. Also, I'm rather beggining with C, so I'm sorry for any > > eye-stabbing stupidities you may encounter, and please report > > them to me. > > > > Hope You'll like it. > > I'd have the same idea few weeks ago and i wrote a very-simple bookmarks > management implementation for surf (using dmenu). However, your idea of > displaying bookmarks list in a about:bookmarks page is smartest :) > > > +void > > +addbookmark(Client *c, const Arg *arg) { > > + char *bmark_uri; > > + FILE *f; > > + bmark_uri = geturi(c); > > + f = fopen(bmarksfile, "a+"); > > + fprintf(f, "%s\n", geturi(c)); > > + fclose(f); > > +} > > The pointer *bmark_uri is not used in the function. Right, my bad. Thanks for noticing! > Good job, i'll be apply your patch this evening! I'm glad you like it. Regards -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] next release
On 22-10-2009 19:14:10, sta...@cs.tu-berlin.de wrote: > * Tadeusz Sośnierz [2009-10-22 18:17]: > > Then we will end up with some shit like uzbl - the browser which cannot > > browse the web. > > What web do you have there? It must be a strange one. I haven't used any > other X browser at home for months (except for testing surf). Please > consider to try to localise the problem in the system consisting of you, > the browser, and the web. And then report again. > Well, looks like I have to apologize. For some unknown reason I was thinking that uzbl is handling link-clicking through some external scripts, but I just cloned the git version and looks like I was wrong. Sorry for my trolling, mea culpa. Regards -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] next release
On 22-10-2009 09:09:25, Charlie Kester wrote: > On Thu 22 Oct 2009 at 05:20:44 PDT Dieter Plaetinck wrote: > > > >what consitutes a "session" ? it's something that is maintained > >serverside and the only way to "stay in it" is usually one or more of: > >- keeping and sending cookie data > >- keeping the same ip (and maybe user agent) > >- requesting the urls they tell you to > > > >afaik both curl and wget can use existing cookie storages on your hard > >disk (and can use the useragent you tell them to), so don't really see > >the problem. > > It seems to me that the problems being discussed in this subthread arise > because the "browser" combines two very distinct concerns: > > - managing the http traffic to and from the website, which includes the > administrative details pertaining to the session > > - rendering the documents obtained from the website > > Perhaps we should be thinking about separating them? > Then we will end up with some shit like uzbl - the browser which cannot browse the web. Regards -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] ReadItLater for surf
On 21-10-2009 21:08:24, Richard Pöttler wrote: > Hi, > > I am using surf, and like it very much. One thing I am missing over > Firefix is the something similar to the ReadItLater plugin in > Firefox, where i can rightclick on a link and bookmark it for later > use. > > I am pretty new to c programming, so please don't be too hard. It > would also help, if you could point me to the right direction. > > Until now I found out, that I got to to add a item to the item[], > write a function to write the url to a file. What I am missing is, > how do I determine, that I rightclicked on a link and get the url. > > Thanks for your answers in advance. > > bye > richi Hi, How about this bookmark patch I posted yesterday or around? Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] next release
On 21-10-2009 11:19:42, Anselm R Garbe wrote: > 2009/10/21 pancake : > > I dunno, but dmenu lacks edition/pasting, the only reason i can imagine > > to use dmenu is to autocomplete from bookmarked or visited urls. I didn't > > tried it yet, but I'm curious about if its better or worse way to enter > > urls. > > I think it's a good decision to use dmenu. This allows automatically > caching the url entered and present it the next time. > If this decision remains stable in surf, I'm willing to accept the > vertical menu patch in vanilla dmenu. > Well, in 0.2, using GtkEntry it was alredy working like this: while visiting surf.suckless.org, pressing C-g you had 'http://surf.suckless.org' in the entry field, ready to copy/paste/edit/whatever. Of course you can use dmenu to keep the cache of more than one url, but I'm sure it can be also done via GtkEntryCompletion or how is it called. Also, I doubt if piping this urls from surf to dmenu and vice versa will be even faster and lighter than GtkEntry. Atm I don't see one reason to use dmenu this way. What is more, the searchbar. In 0.2, you opened it, typed 'surf', pressed enter, but the 'surf' remained there, so you just pressed enter once again, no need to open a search bar and type it once again. Still if there are really some good reasons for using dmenu instead of GtkEntry, I'd likely hear them. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] next release
On 21-10-2009 10:14:45, Enno Boland (Gottox) wrote: > Hi! > > I'm going to release 0.3 this or next week, depending on how much time > I can investigate. Please recheck tip and give feedback, as there are > some bigger changes. > > * persistant/concurrent cookies are working (hopefully) > * removing urlbar/searchbar and using dmenu instead > * if the window is shrinked below a defined size, the zoom factor is > automaticly decreased. This is usefull on small screens and tiling > window manager. > * searching works from an XProperty now. > > ToDo for 0.3 release: > * get downloads working again. > > regards > Enno Hello, Sounds fine, but what was the reason to include dmenu instead of just GtkEntries? Are there some plans to put bookmarks inside dmenu choices, or you just don't like GtkStuff? What made you make this decision? Just curious. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] Downloading files in 0.2
On 20-10-2009 20:40:45, Julien Steinhauser wrote: > On Tue, Oct 20, 2009 at 07:59:00PM +0200, Tadeusz Sośnierz wrote: > > > > Strange, mine doesn't download anything at all. Is the latest pull? > > Regards, > > Ted > > > Sorry, mine wasn't the latest pull, I've just built one from the newest > I have and the download feature isn't even proposed on right click, > but it's still in the code in surf.c > Context menu has moved to config.h, maybe something to add there. Well, I checked the code and the download-requested signal (from webkit) is the same in both version. So I'll still wait for Gottox's words of wisdom ;) Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [surf] Downloading files in 0.2
On 20-10-2009 17:46:55, Julien Steinhauser wrote: > On Tue, Oct 20, 2009 at 01:46:53PM +0200, Tadeusz Sośnierz wrote: > > > > Hello, > > Someone alredy posted this, but I've seen no reaction. So, is the > > downloading files feature removed, forgotten, or bugged? What's going on > > with it? > > Regards, > > Ted > > > > -- > Hello, the downloading feature isn't removed but I also experience trouble > with it. The desired file is properly downloaded to ~/.surf/dl but surf > stays blocked on the > html = g_strdup_printf("Download %s...", filename); > step. I have to manually go one page back to continue surfing. Strange, mine doesn't download anything at all. Is the latest pull? Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
[dev] [surf] Bookmarks patch for 0.2
Hello, I wrote some patch for bookmark handling, attached. Everything is driven by the right-click menu. Sadly, I had no idea how to include some labels for the urls. Also, I'm rather beggining with C, so I'm sorry for any eye-stabbing stupidities you may encounter, and please report them to me. Hope You'll like it. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments diff -r 18dd74d2564d config.def.h --- a/config.def.h Sat Oct 17 13:19:21 2009 +0200 +++ b/config.def.h Tue Oct 20 14:39:33 2009 +0200 @@ -5,6 +5,7 @@ static char *stylefile = ".surf/style.css"; static char *scriptfile = ".surf/script.js"; static char *cookiefile = ".surf/cookies.txt"; +static char *bmarksfile = ".surf/bmarks.txt"; static char *dldir = ".surf/dl"; static time_t sessiontime = 3600; @@ -41,6 +42,8 @@ { "New Window", newwindow, { .v = NULL } }, { "Reload", reload,{ .b = FALSE } }, { "Stop", stop, { 0 } }, +{ "Bookmark it", addbookmark, { 0 } }, +{ "Show bookmarks", showbmarks,{ 0 } }, { "<===", navigate, { .i = -1 } }, { "===>", navigate, { .i = +1 } }, }; diff -r 18dd74d2564d surf.c --- a/surf.cSat Oct 17 13:19:21 2009 +0200 +++ b/surf.cTue Oct 20 14:39:33 2009 +0200 @@ -71,6 +71,7 @@ static char winid[64]; static char *progname; +static void addbookmark(Client *c, const Arg *arg); static const char *autouri(Client *c); static char *buildpath(const char *path); static void changecookie(SoupCookieJar *jar, SoupCookie *o, SoupCookie *n, gpointer p); @@ -112,6 +113,7 @@ static void scroll(Client *c, const Arg *arg); static void searchtext(Client *c, const Arg *arg); static void source(Client *c, const Arg *arg); +static void showbmarks(Client *c, const Arg *arg); static void showsearch(Client *c, const Arg *arg); static void showuri(Client *c, const Arg *arg); static void stop(Client *c, const Arg *arg); @@ -126,6 +128,16 @@ /* configuration, allows nested code to access above variables */ #include "config.h" +void +addbookmark(Client *c, const Arg *arg) { + char *bmark_uri; + FILE *f; + bmark_uri = geturi(c); + f = fopen(bmarksfile, "a+"); + fprintf(f, "%s\n", geturi(c)); + fclose(f); +} + const char * autouri(Client *c) { if(GTK_WIDGET_HAS_FOCUS(c->uribar)) @@ -172,6 +184,7 @@ cleanup(void) { while(clients) destroyclient(clients); + g_free(bmarksfile); g_free(cookiefile); g_free(dldir); g_free(scriptfile); @@ -686,6 +699,7 @@ uriprop = XInternAtom(dpy, "_SURF_URI", False); /* create dirs and files */ + bmarksfile = buildpath(bmarksfile); cookiefile = buildpath(cookiefile); dldir = buildpath(dldir); scriptfile = buildpath(scriptfile); @@ -699,6 +713,23 @@ } void +showbmarks(Client *c, const Arg *arg) { + /* I wonder if 4 kB is too much or not enough */ + char html[4096] = ""; + /* same here. time will tell */ + char uri[128]; + FILE *f; + stop(c, NULL); + f = fopen(bmarksfile, "r"); + while(fscanf(f, "%127s\n", uri) != EOF) { + snprintf(&html[strlen(html)], sizeof(html) - strlen(html), + "%s", uri, uri); + } + fclose(f); + webkit_web_view_load_html_string(c->view, html, "about:bookmarks"); +} + +void showsearch(Client *c, const Arg *arg) { hideuri(c, NULL); gtk_widget_show(c->searchbar);
[dev] [surf] Downloading files in 0.2
Hello, Someone alredy posted this, but I've seen no reaction. So, is the downloading files feature removed, forgotten, or bugged? What's going on with it? Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
[dev] [surf] searchengines and toggleflash for 0.2
Hello, Here is a searchengine patch for surf 0.2 (changed pasteuri() to geturi() as pasteuri() was alredy taken), and new toggleflash, saving another 1 LOC. Hope that will help someone. Constructive critisism welcome. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments diff -r ba69af3ca2c3 config.def.h --- a/config.def.h Sat Oct 17 09:23:28 2009 +0200 +++ b/config.def.h Mon Oct 19 12:23:10 2009 +0200 @@ -35,6 +35,10 @@ { 0,GDK_Return, hideuri,{ 0 }, UriBar }, }; +static SearchEngine searchengines[] = { +{ NULL, NULL }, +}; + static Item items[] = { { "New Window", newwindow, { .v = NULL } }, { "Reload", reload,{ .b = FALSE } }, diff -r ba69af3ca2c3 surf.c --- a/surf.cSat Oct 17 09:23:28 2009 +0200 +++ b/surf.cMon Oct 19 12:23:10 2009 +0200 @@ -60,6 +60,11 @@ KeyFocus focus; } Key; +typedef struct { + char *token; + char *uri; +} SearchEngine; + static Display *dpy; static Atom uriprop; static SoupCookieJar *cookiejar; @@ -100,6 +105,7 @@ static void newwindow(Client *c, const Arg *arg); static WebKitWebView *createwindow(WebKitWebView *v, WebKitWebFrame *f, Client *c); static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d); +static gchar *geturl(const gchar *uri); static GdkFilterReturn processx(GdkXEvent *xevent, GdkEvent *event, gpointer d); static void print(Client *c, const Arg *arg); static void progresschange(WebKitWebView *v, gint p, Client *c); @@ -408,6 +414,19 @@ update(c); } +gchar * +geturl(const gchar *uri) { + guint i; + for (i = 0; i < LENGTH(searchengines); i++) { +if (searchengines[i].token == NULL || searchengines[i].uri == NULL || *(uri + strlen(searchengines[i].token)) != ' ') + continue; +if(g_str_has_prefix(uri, searchengines[i].token)) + return g_strdup_printf(searchengines[i].uri, uri + strlen(searchengines[i].token) + 1); + } + return g_strrstr(uri, "://") ? g_strdup(uri) : g_strdup_printf("http://%s";, uri); +} + + void loaduri(Client *c, const Arg *arg) { char *u; @@ -417,8 +436,7 @@ uri = autouri(c); if(!uri) return; - u = g_strrstr(uri, "://") ? g_strdup(uri) - : g_strdup_printf("http://%s";, uri); + u = geturl(uri); webkit_web_view_load_uri(c->view, u); c->progress = 0; c->title = copystr(&c->title, u); diff -r 18dd74d2564d config.def.h --- a/config.def.h Sat Oct 17 13:19:21 2009 +0200 +++ b/config.def.h Mon Oct 19 12:33:23 2009 +0200 @@ -18,6 +18,7 @@ { 0,GDK_Escape, hidesearch, { 0 }, Any }, { 0,GDK_Escape, hideuri,{ 0 }, Any }, { MODKEY|GDK_SHIFT_MASK,GDK_p, print, { 0 }, Any }, +{ MODKEY, GDK_f, toggleflash,{ 0 }, Any }, { MODKEY, GDK_p, clipboard, { .b = TRUE }, Browser }, { MODKEY, GDK_y, clipboard, { .b = FALSE }, Browser }, { MODKEY|GDK_SHIFT_MASK,GDK_j, zoom, { .i = -1 },Browser }, diff -r 18dd74d2564d surf.c --- a/surf.cSat Oct 17 13:19:21 2009 +0200 +++ b/surf.cMon Oct 19 12:33:23 2009 +0200 @@ -116,6 +116,7 @@ static void showuri(Client *c, const Arg *arg); static void stop(Client *c, const Arg *arg); static void titlechange(WebKitWebView *v, WebKitWebFrame* frame, const char* title, Client *c); +static void toggleflash(Client *c, const Arg *arg); static gboolean focusview(GtkWidget *w, GdkEventFocus *e, Client *c); static void usage(void); static void update(Client *c); @@ -539,6 +540,7 @@ gdk_window_add_filter(GTK_WIDGET(c->win)->window, processx, c); webkit_web_view_set_full_content_zoom(c->view, TRUE); settings = webkit_web_view_get_settings(c->view); + g_object_set(G_OBJECT(settings), "enable-plugins", FALSE, NULL); g_object_set(G_OBJECT(settings), "user-agent", useragent, NULL); uri = g_strconcat("file://", stylefile, NULL); g_object_set(G_OBJECT(settings), "user-stylesheet-uri", uri, NULL); @@ -763,6 +765,14 @@ update(c); } +void +toggleflash(Client *c, const Arg *arg) { + static bool flash = 0; + WebKitWebSettings *settings; + settings = webkit_web_view_get_settings(c->view); + g_object_set(G_OBJECT(settings), "enable-plugins", (flash = !flash), NULL); +} + gboolean focusview(GtkWidget *w, GdkEventFocus *e, Client *c) { hidesearch(c, NULL);
Re: [dev] surf - add missing keybinding
On 17-10-2009 19:56:40, Kris Maglione wrote: > On Sat, Oct 17, 2009 at 01:39:00PM +0200, Tadeusz Sośnierz wrote: > >>> Btw, does surf support the standard Unix text editing keybindings[1]? > >> > >>Its not about surf, this is a task for gtk textentry and so on. So unless > >>you write a ld.so modifying the signal handlers it will not be supported. > >> > >>It can be also be implemented in javascript, but it will be pretty slow. > > > >Add the following to your .gtkrc-2.0: > >gtk-key-theme-name = "Emacs" > >Should work well. > > It works. It doesn't work well. I have to admit, it's gotten better: > at least ^W finally deletes to the last non-word character rather > than to the last space. ^U still clears the whole line, and as far > as I can find, there's no way to configure it to do otherwise. > Well, It probably isn't ideal, but this is the best thing I know of, that's why I posted it. I don't care whether it's called emacs, vi or acme, as long as it works and does what I want. And it's not emacs, for ^W and ^U works as Kris said, not this emacs region stuff. Regards, Ted
Re: [dev] surf - add missing keybinding
> > Btw, does surf support the standard Unix text editing keybindings[1]? > > Its not about surf, this is a task for gtk textentry and so on. So unless you > write a ld.so modifying the signal handlers it will not be supported. > > It can be also be implemented in javascript, but it will be pretty slow. Add the following to your .gtkrc-2.0: gtk-key-theme-name = "Emacs" Should work well. Regards, Ted -- === () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Re: [dev] [st] goals / non-goals for st?
On Wed, Oct 07, 2009 at 12:43:51PM +0200, Antoni Grzymala wrote: > Richard Pöttler dixit (2009-10-07, 12:15): > > > What do you think about transparency? I think it might collide with > > the suckless-goal and decrease speed. > > When you read a newspaper or a book do you like it to be > semi-transparent as well? I never understood the urge for translucent > terminals... > I'd actually like it, so I can walk the street with a newspaper in front of my eyes. Anyway, I think it's a matter of taste. Wouldn't it be a better idea to leave transparency to some composition manager, like xcompmgr? I don't whether it works or not, but afair it can make windows transparent. Regards Ted
Re: [dev] Suckless word processing solution?
On Sun, Oct 04, 2009 at 08:28:10PM +0200, Mate Nagy wrote: > On Sun, Oct 04, 2009 at 08:26:08PM +0200, Antoni Grzymala wrote: > > Doesn't terrify me. I sleep quite well in fact. > > > > I do observe some obsession-terrification-related symptoms on this list. > > :) > in short: everyone who hates vi was molested as a kid. > makes sense Does it? Seems like fanatic-related trolling to me. No offence. Regards
[dev] [dwm] pertag and struct Monitor issues
Hello, I've stumbled upon this while trying to add gaplessgrid layout to my dwm. In pertag patch, the struct Monitor is moved after the '#include "config.h"' line, so it will know about 'tags' variable I guess. But the nasty thing is, layout patches like gaplessgrid need to know Monitor when compiled. I've solved this by moving the whole Monitor struct to config.h, but that looks kind of stupid to me, but so far I don't know any other solution. We can't predecleare tags in dwm.c, for we don't know it's size yet. And so I run out of ideas. Is there any other way than moving this struct to config.h? Regards, Ted
Re: [dev] dwm nmaster_bstack-5.7
Sun, 27 Sep 2009 20:46:41 +0200, Moritz Wilhelmy : > what about putting layouts (in patches) to seperate files where > possible and then #include "patches/bstack.c" in config.h and just > use the layout in keys/mouse configuration? It alredy works like this. Regards
[dev] [surf] New flash-preventing patch
Hello there, I've seen a flash-toggling patch some time ago here, though it wasn't compatibile with the latest hg pull, I've simplified it a bit, and it now works like a charm. How about adding it to werc? Some javascript solution will probably be more elegant, but I don't know anything about it and for me, in today's web, ability to get rid of this silly plugins is more than obligatory. Hope You'll like it. Regards, Teddiff -r ca6a33025ebd config.def.h --- a/config.def.h Mon Sep 21 19:28:39 2009 +0200 +++ b/config.def.h Sun Sep 27 13:37:38 2009 +0200 @@ -11,6 +11,7 @@ { 0,GDK_Escape, hidesearch, { 0 }, Any }, { 0,GDK_Escape, hideurl,{ 0 }, Any }, { MODKEY|GDK_SHIFT_MASK,GDK_p, print, { 0 }, Any }, +{ MODKEY, GDK_f, toggleflash,{ 0 }, Any }, { MODKEY, GDK_p, clipboard, { .b = TRUE }, Browser }, { MODKEY, GDK_y, clipboard, { .b = FALSE }, Browser }, { MODKEY|GDK_SHIFT_MASK,GDK_j, zoom, { .i = -1 },Browser }, diff -r ca6a33025ebd surf.c --- a/surf.c Mon Sep 21 19:28:39 2009 +0200 +++ b/surf.c Sun Sep 27 13:37:38 2009 +0200 @@ -109,6 +109,7 @@ static void showurl(Client *c, const Arg *arg); static void stop(Client *c, const Arg *arg); static void titlechange(WebKitWebView* view, WebKitWebFrame* frame, const gchar* title, Client *c); +static void toggleflash(Client *c, const Arg *arg); static gboolean unfocusbar(GtkWidget *w, GdkEventFocus *e, Client *c); static void usage(void); static void update(Client *c); @@ -451,6 +452,7 @@ gdk_window_add_filter(GTK_WIDGET(c->win)->window, processx, c); webkit_web_view_set_full_content_zoom(c->view, TRUE); settings = webkit_web_view_get_settings(c->view); + g_object_set(G_OBJECT(settings), "enable-plugins", FALSE, NULL); g_object_set(G_OBJECT(settings), "user-agent", "surf", NULL); filename = g_build_filename(workdir, "style.css", NULL); filename = g_strdup_printf("file://%s", filename); @@ -663,6 +665,15 @@ update(c); } +void +toggleflash(Client *c, const Arg *arg) { + static int flash = 0; + WebKitWebSettings *settings; + settings = webkit_web_view_get_settings(c->view); + g_object_set(G_OBJECT(settings), "enable-plugins", !flash, NULL); + (flash) ? (flash = 0) : (flash = 1); +} + gboolean unfocusbar(GtkWidget *w, GdkEventFocus *e, Client *c) { hidesearch(c, NULL);
Re: [dev] unsubscribe
Dnia 2009-08-17, o godz. 10:57:03 Marius Pana napisał(a): > Shouldn't emails like this be blocked by mailing list app? Regards
Re: [dev] dmenu : auto confirm when only one item remains
Dnia 2009-08-12, o godz. 14:45:47 Colin Shea napisał(a): > On Wed, Aug 12, 2009 at 08:39:41PM +0200, Julien Steinhauser wrote: > > Hello, > > Sorry, I don't write to bring a patch. > > I wander if someone has already patched dwm > > to make it auto confirm when, (as said in the subject) > > only one item remains. > > > > I've found something on the mailing list which is almost > > what I wish but not exactly, it auto confirms on exact match. > > > > It could be something like : > > > > if number of Item == 1 or if firstItem == lastItem > > > > fprintf(stdout, "%s", text); > > fflush(stdout); > > running = False; > > > > As I'm not a developper, I miss the knowledge > > to write the if condition in real code. > > > > This feature would be handy for a few scripts in which I use dmenu. > > If someone has already done it or have ideas on how to do it, > > please let me know :) . > > > > Why not check if the number of items you are passing into dmenu is one > and use that instead of making dmenu do the check? It seems to me > pointless to call dmenu with only one value in stdin. > I think he means that if only one item remains on the bar, then it is automagically returned by dmenu. Anyway, I don't think this is so good, especially when you make some typo and launch something random. Regards Ted
Re: [dev] dwm-5.6
Dnia 2009-07-14, o godz. 18:24:06 Anselm R Garbe napisał(a): > Hi there, > > I'm glad to announce the new dwm-5.6 release which can be fetched from > > http://code.suckless.org/dl/dwm/dwm-5.6.tar.gz > > This release contains the new Xinerama support that creates a view per > Xinerama screen. Hi, and thank you for the new release. But are there any other significant changes, for someone who does not have more than one monitor? I've been observing hackers@ for some time but I don't see anything besides Xinerama support and some stylistic changes. Regards, Ted