Re: [dev] [st] Back Color Erase
2013/1/26, Christoph Lohmann 2...@r-36.net: Here is the output using standard st ([0]) and using the config.h from your last message ([1]). The midnight commander is from the latest com‐ mit from [2]. Either it’s a problem with mc, because yours looks different in the win‐ dow layout or your didn’t install the newest st right. I have custom color and other setting in mc. With old terminfo (commented bce) I don't have this issue. But in any case this bug not related to mc only. As I mention I have same problem in other ncurses apps. For example linux-kernel make menuconfig. attachment: kernel.png
Re: [dev] xinerama and dbe mutual exclusion
I have issue with shift+insert (and same with middle mouse button). When I select something and press shit+insert I don't see any changes, but if I press any key I see key + pasted text. st-3ce96aea8af566c88ed1e076d270b4d1abcf6e96 don't have this issue.
Re: [dev] xinerama and dbe mutual exclusion
Greetings. On Sun, 27 Jan 2013 12:34:56 +0100 Mihail Zenkov mihail.zen...@gmail.com wrote: I have issue with shift+insert (and same with middle mouse button). When I select something and press shit+insert I don't see any changes, but if I press any key I see key + pasted text. st-3ce96aea8af566c88ed1e076d270b4d1abcf6e96 don't have this issue. This was fixed in 57f39defaf3f84b5d9efb3e7a8494cc7ff09e7af. I hope you are using the current st as of 384fabdb5b2ac6c700a974a7fac539c8c14107f6. Sincerely, Christoph Lohmann
[dev] FOSDEM
Hi, Is anyone planning to be at FOSDEM next weekend? It would be nice to meet some of the suckless hackers in person. I'll be there for the whole conference. Jan Christoph pgpqDaZeIBzi9.pgp Description: PGP signature
Re: [dev] xinerama and dbe mutual exclusion
Thanks! BCE issue stop me to update from git. But now I update to 384...f6 with old terminfo. 2013/1/27, Christoph Lohmann 2...@r-36.net: Greetings. On Sun, 27 Jan 2013 12:34:56 +0100 Mihail Zenkov mihail.zen...@gmail.com wrote: I have issue with shift+insert (and same with middle mouse button). When I select something and press shit+insert I don't see any changes, but if I press any key I see key + pasted text. st-3ce96aea8af566c88ed1e076d270b4d1abcf6e96 don't have this issue. This was fixed in 57f39defaf3f84b5d9efb3e7a8494cc7ff09e7af. I hope you are using the current st as of 384fabdb5b2ac6c700a974a7fac539c8c14107f6. Sincerely, Christoph Lohmann
Re: [dev] [st] Back Color Erase
Greetings. On Sun, 27 Jan 2013 10:52:49 +0100 Mihail Zenkov mihail.zen...@gmail.com wrote: 2013/1/26, Christoph Lohmann 2...@r-36.net: Here is the output using standard st ([0]) and using the config.h from your last message ([1]). The midnight commander is from the latest com‐ mit from [2]. Either it’s a problem with mc, because yours looks different in the win‐ dow layout or your didn’t install the newest st right. I have custom color and other setting in mc. With old terminfo (commented bce) I don't have this issue. But in any case this bug not related to mc only. As I mention I have same problem in other ncurses apps. For example linux-kernel make menuconfig. See the latest st. In mc it worked, but dialog(1) got me where the bug was. The sequence to delete n characters needs BCE activated too. Dialog is now working, except that dialog has some bugs on its own. Like when you do resizing in st it does resize but the content of the dialog is not redrawn and the shadow of the last line is drawn in the wrong way, while it works on the first try. In xterm dialog simply quits and in urxvt the white lines are drawn in grey. Thanks for the input. Please report back if mc and dialog work for you now. Sincerely, Christoph Lohmann
Re: [dev] [st] Back Color Erase
Good! But still have small issue in mc. 2013/1/27, Christoph Lohmann 2...@r-36.net: Greetings. On Sun, 27 Jan 2013 10:52:49 +0100 Mihail Zenkov mihail.zen...@gmail.com wrote: 2013/1/26, Christoph Lohmann 2...@r-36.net: Here is the output using standard st ([0]) and using the config.h from your last message ([1]). The midnight commander is from the latest com‐ mit from [2]. Either it’s a problem with mc, because yours looks different in the win‐ dow layout or your didn’t install the newest st right. I have custom color and other setting in mc. With old terminfo (commented bce) I don't have this issue. But in any case this bug not related to mc only. As I mention I have same problem in other ncurses apps. For example linux-kernel make menuconfig. See the latest st. In mc it worked, but dialog(1) got me where the bug was. The sequence to delete n characters needs BCE activated too. Dialog is now working, except that dialog has some bugs on its own. Like when you do resizing in st it does resize but the content of the dialog is not redrawn and the shadow of the last line is drawn in the wrong way, while it works on the first try. In xterm dialog simply quits and in urxvt the white lines are drawn in grey. Thanks for the input. Please report back if mc and dialog work for you now. Sincerely, Christoph Lohmann attachment: mc3.png
Re: [dev] FOSDEM
Quoth Jan Christoph Ebersbach: Is anyone planning to be at FOSDEM next weekend? It would be nice to meet some of the suckless hackers in person. I'll be there, and would be very happy to meet up with anyone from the suckless world. Nick
Re: [dev] [st] Back Color Erase
Greetings. On Sun, 27 Jan 2013 15:33:15 +0100 Mihail Zenkov mihail.zen...@gmail.com wrote: Good! But still have small issue in mc. Thanks for the answer. But now explain me how I should get any hint how to debug your issues by the information you gave me. In the last e‐mails I explained that I can’t reproduce your issues in mc. Sincerely, Christoph Lohmann
Re: [dev] [st] Back Color Erase
2013/1/27, Christoph Lohmann 2...@r-36.net: Thanks for the answer. But now explain me how I should get any hint how to debug your issues by the information you gave me. In the last e‐mails I explained that I can’t reproduce your issues in mc. Did you try compile mc with '--with-screen=ncurses' as I mention before? What info I should provide? 'st -o mc.txt -e mc' ?
Re: [dev] [st] Back Color Erase
Greetings. On Sun, 27 Jan 2013 16:29:27 +0100 Mihail Zenkov mihail.zen...@gmail.com wrote: 2013/1/27, Christoph Lohmann 2...@r-36.net: Thanks for the answer. But now explain me how I should get any hint how to debug your issues by the information you gave me. In the last e‐mails I explained that I can’t reproduce your issues in mc. Did you try compile mc with '--with-screen=ncurses' as I mention before? What info I should provide? 'st -o mc.txt -e mc' ? I need the mc.txt and a screenshot of what is shown. In your last exam‐ ple mc.txt did not have the text strings in it shown by mc. But both need to be the same, otherwise mc.txt does not include the escape se‐ quences mc uses to display the wrong‐drawn parts. Sincerely, Christoph Lohmann
Re: [dev] [st] Back Color Erase
2013/1/27, Christoph Lohmann 2...@r-36.net: I need the mc.txt and a screenshot of what is shown. In your last exam‐ ple mc.txt did not have the text strings in it shown by mc. But both need to be the same, otherwise mc.txt does not include the escape se‐ quences mc uses to display the wrong‐drawn parts. I check previous mc.txt by 'cat mc.txt': in st with broken bce I see issue, in last st I didn't see it. )0[?1049h[1;24r[0m[4l[?1h=[39;49m[39;49m[0m[H[2J[24dbash-4.2#[80G]0;/tmp/st-26c101b70671d1adbdd4e31af70502605fe3ebbf]0;/tmp/st-26c101b70671d1adbdd4e31af70502605fe3ebbf]0;/tmp/st-26c101b70671d1adbdd4e31af70502605fe3ebbf]0;/tmp/st-26c101b70671d1adbdd4e31af70502605fe3ebbf[H(0[0m[37m[40ml(B[0m[37m[40m(0[0m[37m[40mq(B[0m[30m[46m ...dbdd4e31af70502605fe3ebbf (0[0m[37m[40mq(B[0m[37m[40m.[^](0[0m[37m[40mkl(B[0m[37m[40m(0[0m[37m[40mq(B[0m[37m[40m / (0[0m[37m[40m(B[0m[37m[40m.[^](0[0m[37m[40mk[39;49m(B[0m[2;1H(0[0m[37m[40mx(B[0m[93m[40m'n Name (0[0m[37m[40mx(B[0m[93m[40m Size (0[0m[37m[40mx(B[0m[93m[40mModify time (0[0m[37m[40mxx(B[0m[93m[40m'n Name (0[0m[37m[40mx(B[0m[93m[40m Size (0[0m[37m[40mx(B[0m[93m[40mModify time (0[0m[37m[40mx[39;49m(B[0m[3;1H(0[0m[37m[40mx(B[0m[30m[46m/..[15X[3;20H(0[0m[30m[46mx(B[0m[30m[46mP--DIR(0[0m[30m[46mx(B[0m[30m[46mJan 27 18:19(0[0m[37m[40mxx(B[0m[97m[40m/:work (0[0m[37m[40mx(B[0m[97m[40m 4.0K(0[0m[37m[40mx(B[0m[97m[40mJan 23 20:44(0[0m[37m[40mx[39;49m(B[0m[4;1H(0[0m[37m[40mx(B[0m[36m[40m config.def.h (0[0m[37m[40mx(B[0m[36m[40m 15.5K(0[0m[37m[40mx(B[0m[36m[40mJan 27 12:26(0[0m[37m[40mxx(B[0m[97m[40m/bin[14X[4;60H(0[0m[37m[40mx(B[0m[97m[40m 1.0K(0[0m[37m[40mx(B[0m[97m[40mJan 24 00:37(0[0m[37m[40mx[39;49m(B[0m[5;1H(0[0m[37m[40mx(B[0m[36m[40m config.h (0[0m[37m[40mx(B[0m[36m[40m 10.6K(0[0m[37m[40mx(B[0m[36m[40mJan 17 17:13(0[0m[37m[40mxx(B[0m[97m[40m/dev[14X[5;60H(0[0m[37m[40mx(B[0m[97m[40m 2.4K(0[0m[37m[40mx(B[0m[97m[40mJan 27 15:39(0[0m[37m[40mx[39;49m(B[0m[6;1H(0[0m[37m[40mx(B[0m[37m[40m config.mk(0[0m[37m[40mx(B[0m[37m[40m 651(0[0m[37m[40mx(B[0m[37m[40mJan 27 12:26(0[0m[37m[40mxx(B[0m[97m[40m/etc[14X[6;60H(0[0m[37m[40mx(B[0m[97m[40m 1.0K(0[0m[37m[40mx(B[0m[97m[40mJan 27 12:06(0[0m[37m[40mx[39;49m(B[0m[7;1H(0[0m[37m[40mx(B[0m[37m[40m FAQ[14X[7;20H(0[0m[37m[40mx(B[0m[37m[40m 3.6K(0[0m[37m[40mx(B[0m[37m[40mJan 27 12:26(0[0m[37m[40mxx(B[0m[97m[40m/lfs[14X[7;60H(0[0m[37m[40mx(B[0m[97m[40m 1.0K(0[0m[37m[40mx(B[0m[97m[40mJan 25 20:32(0[0m[37m[40mx[39;49m(B[0m[8;1H(0[0m[37m[40mx(B[0m[37m[40m LEGACY (0[0m[37m[40mx(B[0m[37m[40m 732(0[0m[37m[40mx(B[0m[37m[40mJan 27 12:26(0[0m[37m[40mxx(B[0m[97m[40m/lib[14X[8;60H(0[0m[37m[40mx(B[0m[97m[40m 3.0K(0[0m[37m[40mx(B[0m[97m[40mJan 25 01:43(0[0m[37m[40mx[39;49m(B[0m[9;1H(0[0m[37m[40mx(B[0m[37m[40m LICENSE (0[0m[37m[40mx(B[0m[37m[40m 1.2K(0[0m[37m[40mx(B[0m[37m[40mJan 27 12:26(0[0m[37m[40mxx(B[0m[97m[40m/opt[14X[9;60H(0[0m[37m[40mx(B[0m[97m[40m 1.0K(0[0m[37m[40mx(B[0m[97m[40mJan 14 15:07(0[0m[37m[40mx[39;49m(B[0m[10;1H(0[0m[37m[40mx(B[0m[37m[40m Makefile (0[0m[37m[40mx(B[0m[37m[40m 1.5K(0[0m[37m[40mx(B[0m[37m[40mJan 27 12:26(0[0m[37m[40mxx(B[0m[97m[40m/proc (0[0m[37m[40mx(B[0m[97m[40m 0(0[0m[37m[40mx(B[0m[97m[40mJan 27 12:06(0[0m[37m[40mx[39;49m(B[0m[11;1H(0[0m[37m[40mx(B[0m[33m[40m mc4.txt (0[0m[37m[40mx(B[0m[33m[40m 33(0[0m[37m[40mx(B[0m[33m[40mJan 27 18:59(0[0m[37m[40mxx(B[0m[97m[40m/root (0[0m[37m[40mx(B[0m[97m[40m 1.0K(0[0m[37m[40mx(B[0m[97m[40mJan 27 18:12(0[0m[37m[40mx[39;49m(B[0m[12;1H(0[0m[37m[40mx(B[0m[37m[40m README (0[0m[37m[40mx(B[0m[37m[40m 730(0[0m[37m[40mx(B[0m[37m[40mJan 27 12:26(0[0m[37m[40mxx(B[0m[97m[40m/sbin (0[0m[37m[40mx(B[0m[97m[40m 1.0K(0[0m[37m[40mx(B[0m[97m[40mJan 24 00:37(0[0m[37m[40mx[39;49m(B[0m[13;1H(0[0m[37m[40mx(B[0m[92m[40m*st[15X[13;20H(0[0m[37m[40mx(B[0m[92m[40m165.9K(0[0m[37m[40mx(B[0m[92m[40mJan 27 15:52(0[0m[37m[40mxx(B[0m[97m[40m/sys[14X[13;60H(0[0m[37m[40mx(B[0m[97m[40m 0(0[0m[37m[40mx(B[0m[97m[40mJan 27 12:06(0[0m[37m[40mx[39;49m(B[0m[14;1H(0[0m[37m[40mx(B[0m[37m[40m st.1
[dev] [surf-5.0] internal download manager
Hey everyone, because I hit a nasty bug with https and the wget downloader(Not authorized) I ported the internal downloader patch to surf 0.5. I tried to improve the interface a bit and add a progress bar. Feel free to improve the code. Some ideas would include - cancel button (a bit tricky I suppose) - /one/ window for all downloads - when multiple downloads are open only some of them recieve callbacks for some reason - fix frontend for 1K files. The download is finished, before the window is rendered. The JS misses the finish signal. - reasonable default window sizes for non-tiling WM? - further improve layout v4hn diff --git a/config.def.h b/config.def.h index 1cba4d7..3065c73 100644 --- a/config.def.h +++ b/config.def.h @@ -11,6 +11,7 @@ static char *progress_proxy_untrust = #FF6600; static char *stylefile = ~/.surf/style.css; static char *scriptfile = ~/.surf/script.js; static char *cookiefile = ~/.surf/cookies.txt; +static char *downdir= /tmp; static time_t sessiontime = 3600; static char *cafile = /etc/ssl/certs/ca-certificates.crt; static char *strictssl = FALSE; /* Refuse untrusted SSL connections */ diff --git a/surf.c b/surf.c index c9fa08d..6c95f6e 100644 --- a/surf.c +++ b/surf.c @@ -114,6 +114,7 @@ static void destroyclient(Client *c); static void destroywin(GtkWidget* w, Client *c); static void die(const char *errstr, ...); static void drawindicator(Client *c); +static void download(WebKitDownload *o, GParamSpec *pspec, Client *c); static void eval(Client *c, const Arg *arg); static gboolean exposeindicator(GtkWidget *w, GdkEventExpose *e, Client *c); static void find(Client *c, const Arg *arg); @@ -290,6 +291,29 @@ cookiejar_set_property(GObject *self, guint prop_id, const GValue *value, } static void +download(WebKitDownload *o, GParamSpec *pspec, Client *c) { + WebKitDownloadStatus status; + char script[2048]; char* s= script; + + status = webkit_download_get_status(o); + if(status == WEBKIT_DOWNLOAD_STATUS_STARTED || status == WEBKIT_DOWNLOAD_STATUS_CREATED) { + snprintf(script, 2048, u(%d, %d, %d), +(gint)webkit_download_get_current_size(o), +(gint)webkit_download_get_total_size(o), +(gint)(webkit_download_get_progress(o) * 100)); + const Arg a= {.v = (void*) s}; + eval(c, a); + } + else if (status == WEBKIT_DOWNLOAD_STATUS_FINISHED){ + snprintf(script, 2048, c(%d, %d), +(gint)webkit_download_get_current_size(o), +(gint)webkit_download_get_total_size(o)); + const Arg a= {.v = (void*) s}; + eval(c, a); + } +} + +static void evalscript(JSContextRef js, char *script, char* scriptname) { JSStringRef jsscript, jsscriptname; JSValueRef exception = NULL; @@ -496,12 +520,104 @@ geturi(Client *c) { static gboolean initdownload(WebKitWebView *view, WebKitDownload *o, Client *c) { - Arg arg; + gchar *uri, *path; + const gchar *filename; + Client *n; + const char template[] = +html \ +head \ +titleDownload - %s/title \ +script \ +function formText(x){ \ + if(x = 1073741824) { return (Math.floor(x/10737418.24)/100) + \G\; } \ + else if(x = 1048576){ return (Math.floor(x/10485.76)/100) + \M\; } \ + else if(x = 1024) { return (Math.floor(x/10.24)/100) + \k\; } \ + else { return x+\b\; } \ +} \ +function updateText(c,t){ \ + txt= formText(c) + \/\ + formText(t); \ + DLTEXT.textContent= txt; \ + /* center text in bar */ \ + DLTEXT.setAttribute('x', 102-4.4*txt.length) \ +} \ +function c(c, t){ \ + DLGRAD.setAttribute('x2', 230); \ + DLGRAD.setAttribute('x1', 205); \ + updateText(c,t); \ + document.getElementById('stop1').setAttribute('style', \stop-color:#2020ff;\); \ +} \ +function u(c,t,p){ \ + DLGRAD.setAttribute('x2', Math.floor(p*205/100) + 25); \ + DLGRAD.setAttribute('x1', Math.floor(p*205/100)); \ + updateText(c,t); \ +} \ +/script \ +/head \ +body \ +center \ +h2Downloading/h2 \ +h3%s/h3 \ +to %sbr/ \ +svg \ + xmlns:cc=\http://creativecommons.org/ns#\; \ + xmlns:svg=\http://www.w3.org/2000/svg\; \ + xmlns=\http://www.w3.org/2000/svg\; \ + xmlns:xlink=\http://www.w3.org/1999/xlink\; \ + width=\210\ \ + height=\60\ \ + id=\download\ \ + defs \ +linearGradient \ + id=\dlgradient\ \ + x1=\0\ \ + y1=\0\ \ + x2=\25\ \ + y2=\0\ \ + gradientUnits=\userSpaceOnUse\ \ + stop style=\stop-color:#00ff00;\ offset=\0\ id=\stop1\ / \ + stop style=\stop-color:#00ff00;stop-opacity:0;\ offset=\1\ id=\stop2\ / \ +/linearGradient \ + /defs \ +rect \ + style=\fill:url(#dlgradient);stroke:#00;stroke-width:3\ \ + id=\rect2985\ \ + width=\200\ \ + height=\50\ \ + x=\5\ \ + y=\5\ \ + ry=\25\ / \ +text