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] [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] [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
[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] [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 tadzi...@gmail.com: 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] [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
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] 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] 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] [surf] next release
On 22-10-2009 19:14:10, sta...@cs.tu-berlin.de wrote: * Tadeusz Sośnierz tadzi...@gmail.com [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 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] next release
On 21-10-2009 11:19:42, Anselm R Garbe wrote: 2009/10/21 pancake panc...@youterm.com: 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] 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
[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] 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), + a href='%s'%s/abr /, 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);
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
[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
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] 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] [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] [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] dwm nmaster_bstack-5.7
Sun, 27 Sep 2009 20:46:41 +0200, Moritz Wilhelmy n0nse...@n0nsense.xinutec.org: 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
Re: [dev] dmenu : auto confirm when only one item remains
Dnia 2009-08-12, o godz. 14:45:47 Colin Shea co...@evaryont.me 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 : pseudocode if number of Item == 1 or if firstItem == lastItem /pseudocode 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