Re: [dev] [st] Back Color Erase

2013-01-27 Thread Mihail Zenkov
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

2013-01-27 Thread Mihail Zenkov
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

2013-01-27 Thread Christoph Lohmann
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

2013-01-27 Thread Jan Christoph Ebersbach
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

2013-01-27 Thread Mihail Zenkov
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

2013-01-27 Thread Christoph Lohmann
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

2013-01-27 Thread Mihail Zenkov
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

2013-01-27 Thread Nick
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

2013-01-27 Thread Christoph Lohmann
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-01-27 Thread Mihail Zenkov
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

2013-01-27 Thread Christoph Lohmann
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-01-27 Thread Mihail Zenkov
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[?1h=bash-4.2#]0;/tmp/st-26c101b70671d1adbdd4e31af70502605fe3ebbf]0;/tmp/st-26c101b70671d1adbdd4e31af70502605fe3ebbf]0;/tmp/st-26c101b70671d1adbdd4e31af70502605fe3ebbf]0;/tmp/st-26c101b70671d1adbdd4e31af70502605fe3ebbf(0l(B(0q(B
 ...dbdd4e31af70502605fe3ebbf 
(0q(B.[^](0kl(B(0q(B
 / 
(0(B.[^](0k(B(0x(B'n
 Name   (0x(B Size 
(0x(BModify time 
(0xx(B'n Name   
(0x(B Size 
(0x(BModify time 
(0x(B(0x(B/..(0x(BP--DIR(0x(BJan
 27 18:19(0xx(B/:work
(0x(B  4.0K(0x(BJan 
23 
20:44(0x(B(0x(B 
config.def.h (0x(B 
15.5K(0x(BJan 27 
12:26(0xx(B/bin(0x(B
  1.0K(0x(BJan 24 
00:37(0x(B(0x(B 
config.h (0x(B 
10.6K(0x(BJan 17 
17:13(0xx(B/dev(0x(B
  2.4K(0x(BJan 27 
15:39(0x(B(0x(B 
config.mk(0x(B   
651(0x(BJan 27 
12:26(0xx(B/etc(0x(B
  1.0K(0x(BJan 27 
12:06(0x(B(0x(B 
FAQ(0x(B  
3.6K(0x(BJan 27 
12:26(0xx(B/lfs(0x(B
  1.0K(0x(BJan 25 
20:32(0x(B(0x(B 
LEGACY   (0x(B   
732(0x(BJan 27 
12:26(0xx(B/lib(0x(B
  3.0K(0x(BJan 25 
01:43(0x(B(0x(B 
LICENSE  (0x(B  
1.2K(0x(BJan 27 
12:26(0xx(B/opt(0x(B
  1.0K(0x(BJan 14 
15:07(0x(B(0x(B
 Makefile (0x(B  
1.5K(0x(BJan 27 
12:26(0xx(B/proc 
(0x(B 0(0x(BJan 
27 
12:06(0x(B(0x(B
 mc4.txt  (0x(B
33(0x(BJan 27 
18:59(0xx(B/root 
(0x(B  1.0K(0x(BJan 
27 
18:12(0x(B(0x(B
 README   (0x(B   
730(0x(BJan 27 
12:26(0xx(B/sbin 
(0x(B  1.0K(0x(BJan 
24 
00:37(0x(B(0x(B*st(0x(B165.9K(0x(BJan
 27 
15:52(0xx(B/sys(0x(B
 0(0x(BJan 27 
12:06(0x(B(0x(B
 st.1 

[dev] [surf-5.0] internal download manager

2013-01-27 Thread v4hn
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