Re: [SOLVED] [dwm] Gvim size problem

2009-04-17 Thread Amit Uttamchandani
On Thu, 16 Apr 2009 11:23:35 -0700
Amit Uttamchandani atu13...@csun.edu wrote:

 On Thu, 16 Apr 2009 13:54:45 +0200 (CEST)
 Preben Randhol rand...@pvv.org wrote:
 
 [snip]
 
  
  But by adding:
  
  set ghr=0
  
 
 Thank you! Finally this issue is solved. Using gvim 7.2.130 here.
 
 Amit
 

When opening a new tab the command input disappears, setting ghr=5
fixes it in my set up.



[dwm] Tag events

2009-04-17 Thread Bartosz Nitkiewicz
I'm wondering how to set up tag events. I had this feature before, but 
suddenly disappeared.





Re: [dwm] Tag events

2009-04-17 Thread Enno Boland (Gottox)
What are tag events? Never heard of it.

2009/4/17, Bartosz Nitkiewicz bartosz.nitkiew...@dziq.pl:
 I'm wondering how to set up tag events. I had this feature before, but
 suddenly disappeared.





-- 
http://gnuffy.chaotika.org - Real Community Distro



Re: [dwm] Tag events

2009-04-17 Thread Bartosz Nitkiewicz

Enno Boland (Gottox) pisze:

 What are tag events? Never heard of it.

 2009/4/17, Bartosz Nitkiewicz bartosz.nitkiew...@dziq.pl:
 I'm wondering how to set up tag events. I had this feature before, but
 suddenly disappeared.





I am not too good at English, but I was about to be notified about the 
event in tag 1, when I'm in other tag. Eg irssi nick calling .




Re: [SOLVED] [dwm] Gvim size problem

2009-04-17 Thread Dusan
On Fri, 17 Apr 2009 11:50:44 +0800
bill lam cbill@gmail.com wrote:

Thanks, tried this too. Does not work either. Can you attach
your .vimrc / .gvimrc please?


 On Thu, 16 Apr 2009, Dusan wrote:
  On Thu, 16 Apr 2009 13:54:45 +0200 (CEST)
  Preben Randhol rand...@pvv.org wrote:
  
  Does not help :(
 
 may try adding:
 
 set lines=200
 
  
Similar experience in the past but seem fixed now.  I guess it
should be a gvim problem.  You may test by comparing with other
gtk based text editors such as geany or gedit.
   
It should be `lines' not set correctly. try
:set lines?
   
for gvim, lines depends on both gfn and window height.
   
   I see. set lines report 34 when Gvim is opened and when it is
   refreshed (by using one of the workarounds mentioned here) set
   lines report 37.
   
   So I search around in the vim help files and found out in the end
   that the 'guiheadroom' is set to 50 by default. This is subtracted
   from window height.
   
   But by adding:
   
   set ghr=0
   
   to .gvimrc, gvim will use the whole height and the problem goes
   away!
   
   So not a dwm problem after all... Hope it works for others too.
   I use vim 7.2.79
   
   HTH
   
   Preben
   
   
   
   
   
  
  
  
 





Re: [dwm] Tag events

2009-04-17 Thread Antoni Grzymala
Bartosz Nitkiewicz dixit (2009-04-17, 09:52):

 Enno Boland (Gottox) pisze:
   What are tag events? Never heard of it.
 
   2009/4/17, Bartosz Nitkiewicz bartosz.nitkiew...@dziq.pl:
   I'm wondering how to set up tag events. I had this feature before, but
   suddenly disappeared.

 I am not too good at English, but I was about to be notified about the 
 event in tag 1, when I'm in other tag. Eg irssi nick calling .

Works and has worked for me. Running 5.5_pre from hg right now.

-- 
[a]


pgp91CTTRq1rm.pgp
Description: PGP signature


Re: [SOLVED] [dwm] Gvim size problem

2009-04-17 Thread bill lam
On Fri, 17 Apr 2009, Dusan wrote:
 Thanks, tried this too. Does not work either. Can you attach
 your .vimrc / .gvimrc please?

I do not use .gvimrc, relevant portion of .vimrc

if has(gui_running)
 this line must after gfn and inside gui_running
   set lines=200 columns=124
   right and bottom srollbars
  set guioptions+=rb
   tab interface
  set guioptions+=em
   disable popup dialog
  set guioptions+=c
endif


What exactly is your problem, can you post a screenshot?

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩119 王維  酬張少府
晚年惟好靜  萬事不關心  自顧無長策  空知返舊林
松風吹解帶  山月照彈琴  君問窮通理  漁歌入浦深



Re: [SOLVED] [dwm] Gvim size problem

2009-04-17 Thread Dusan
On Fri, 17 Apr 2009 16:12:10 +0800
bill lam cbill@gmail.com wrote:

 On Fri, 17 Apr 2009, Dusan wrote:
  Thanks, tried this too. Does not work either. Can you attach
  your .vimrc / .gvimrc please?
 
 I do not use .gvimrc, relevant portion of .vimrc
 
 if has(gui_running)
  this line must after gfn and inside gui_running
set lines=200 columns=124
right and bottom srollbars
   set guioptions+=rb
tab interface
   set guioptions+=em
disable popup dialog
   set guioptions+=c
 endif
 
 
 What exactly is your problem, can you post a screenshot?
 

Here it is. Gvim is on the left -- there is huge vertical stripe on the
right part of it. When I do float-unfloat gvim takes whole area and
works well after that. I use 50:50 split.attachment: 2009-04-17-103540_336x210_scrot-thumb.png

Re: [SOLVED] [dwm] Gvim size problem

2009-04-17 Thread Preben Randhol
 Here it is. Gvim is on the left -- there is huge vertical stripe on the
 right part of it. When I do float-unfloat gvim takes whole area and
 works well after that. I use 50:50 split.

What happens if you run: gvim -U NONE -u NONE

This starts gvim without loading any setup you have.

It is not ghr nor lines that will fix your problem, they are for the
vertical space and not horizontal as seem to be your problem.

type :set columns
in vim before and after you float unfloat the gvim to see if this changes.

HTH

Preben




Re: [SOLVED] [dwm] Gvim size problem

2009-04-17 Thread Dusan
On Fri, 17 Apr 2009 12:57:53 +0200 (CEST)
Preben Randhol rand...@pvv.org wrote:

  Here it is. Gvim is on the left -- there is huge vertical stripe on
  the right part of it. When I do float-unfloat gvim takes whole area
  and works well after that. I use 50:50 split.
 
 What happens if you run: gvim -U NONE -u NONE
 
 This starts gvim without loading any setup you have.
 
 It is not ghr nor lines that will fix your problem, they are for the
 vertical space and not horizontal as seem to be your problem.
 
 type :set columns
 in vim before and after you float unfloat the gvim to see if this
 changes.
 
 HTH
 
 Preben
 
 

104 first time, 119 after gvim gets real dimensions.

-u NONE works so I tested what makes problem in my .vimrc. It was font
definition :(

set guifont was the problem. I don't get it but Envy Code font makes
this problem.

I will investigate more. Thanks all.




Re: [dwm] Tag events

2009-04-17 Thread Bartosz Nitkiewicz

Jeremy Jay pisze:

 You mean the urgent window manager hints.  there was a thread not long
 ago with everything you need probably:
  http://lists.suckless.org/dwm/0904/7798.html

 Jeremy

 On Fri 17 Apr 2009 - 10:00AM, Antoni Grzymala wrote:
 Bartosz Nitkiewicz dixit (2009-04-17, 09:52):

 Enno Boland (Gottox) pisze:
  What are tag events? Never heard of it.

  2009/4/17, Bartosz Nitkiewicz bartosz.nitkiew...@dziq.pl:
 I'm wondering how to set up tag events. I had this feature before, but
 suddenly disappeared.
 I am not too good at English, but I was about to be notified about the
 event in tag 1, when I'm in other tag. Eg irssi nick calling .
 Works and has worked for me. Running 5.5_pre from hg right now.

 --
 [a]




Jeremy Jay thank you. Now it's working



[dwm] Font recomendation to get unicode in statusbar?

2009-04-17 Thread Preben Randhol
I'm currently using the terminus font, but it doesn't seem to work with
unicode. Is there another font you would recommend that works with
unicode?

Thanks in advance

Preben




Re: [dwm] Font recomendation to get unicode in statusbar?

2009-04-17 Thread Szabolcs Nagy
On 4/17/09, Preben Randhol rand...@pvv.org wrote:
 Is there another font you would recommend that works with
 unicode?

fixed font

more details: http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html



Re: [dwm] Font recomendation to get unicode in statusbar?

2009-04-17 Thread Haomin Wen
I manage to use wenquanyi bitmap song to display Chinese characters on
the dwm bar in Arch linux,  but there is always something wrong on
Ubuntu. Now I give up. I begin to use Xft.

You can use Xft. There are several patches which enable Xft.

The attached patch uses pango to render text. You can apply the patch
and change your font to something like sans-10. Then pango and
fontconfig will select proper fonts for you.

I found this patch on this mailing list, but I do not remember who write it.

On Fri, Apr 17, 2009 at 9:21 PM, Preben Randhol rand...@pvv.org wrote:
 I'm currently using the terminus font, but it doesn't seem to work with
 unicode. Is there another font you would recommend that works with
 unicode?

 Thanks in advance

 Preben



diff -r b4e7c220422d config.mk
--- a/config.mk	Sat Feb 21 19:20:11 2009 +
+++ b/config.mk	Sun Mar 01 15:22:30 2009 +0800
@@ -15,8 +15,8 @@
 #XINERAMAFLAGS = -DXINERAMA
 
 # includes and libs
-INCS = -I. -I/usr/include -I${X11INC}
-LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${XINERAMALIBS}
+INCS = -I. -I/usr/include -I${X11INC} `pkg-config --cflags xft pango pangoxft`
+LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 ${XINERAMALIBS} `pkg-config --libs xft pango pangoxft`
 
 # flags
 CPPFLAGS = -DVERSION=\${VERSION}\ ${XINERAMAFLAGS}
diff -r b4e7c220422d dwm.c
--- a/dwm.c	Sat Feb 21 19:20:11 2009 +
+++ b/dwm.c	Sun Mar 01 15:22:30 2009 +0800
@@ -36,6 +36,10 @@
 #include X11/Xlib.h
 #include X11/Xproto.h
 #include X11/Xutil.h
+#include X11/Xft/Xft.h
+#include pango/pango.h
+#include pango/pangoxft.h
+#include pango/pango-font.h
 #ifdef XINERAMA
 #include X11/extensions/Xinerama.h
 #endif
@@ -46,8 +50,12 @@
 #define INRECT(X,Y,RX,RY,RW,RH) ((X) = (RX)  (X)  (RX) + (RW)  (Y) = (RY)  (Y)  (RY) + (RH))
 #define ISVISIBLE(x)(x-tags  tagset[seltags])
 #define LENGTH(x)   (sizeof x / sizeof x[0])
+#ifndef MAX
 #define MAX(a, b)   ((a)  (b) ? (a) : (b))
+#endif
+#ifndef MIN
 #define MIN(a, b)   ((a)  (b) ? (a) : (b))
+#endif
 #define MAXTAGLEN   16
 #define MOUSEMASK   (BUTTONMASK|PointerMotionMask)
 #define WIDTH(x)((x)-w + 2 * (x)-bw)
@@ -98,12 +106,19 @@
 	unsigned long sel[ColLast];
 	Drawable drawable;
 	GC gc;
+
+	XftColor  xftnorm[ColLast];
+	XftColor  xftsel[ColLast];
+	XftDraw  *xftdrawable;
+
+	PangoContext *pgc;
+	PangoLayout  *plo;
+	PangoFontDescription *pfd;
+
 	struct {
 		int ascent;
 		int descent;
 		int height;
-		XFontSet set;
-		XFontStruct *xfont;
 	} font;
 } DC; /* draw context */
 
@@ -152,7 +167,7 @@
 static void focusin(XEvent *e);
 static void focusstack(const Arg *arg);
 static Client *getclient(Window w);
-static unsigned long getcolor(const char *colstr);
+//static unsigned long getcolor(const char *colstr);
 static long getstate(Window w);
 static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
 static void grabbuttons(Client *c, Bool focused);
@@ -351,10 +366,6 @@
 	lt[sellt] = foo;
 	while(stack)
 		unmanage(stack);
-	if(dc.font.set)
-		XFreeFontSet(dpy, dc.font.set);
-	else
-		XFreeFont(dpy, dc.font.xfont);
 	XUngrabKey(dpy, AnyKey, AnyModifier, root);
 	XFreePixmap(dpy, dc.drawable);
 	XFreeGC(dpy, dc.gc);
@@ -568,7 +579,7 @@
 		return;
 	olen = strlen(text);
 	h = dc.font.ascent + dc.font.descent;
-	y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
+	y = dc.y;
 	x = dc.x + (h / 2);
 	/* shorten text if necessary */
 	for(len = MIN(olen, sizeof buf); len  textnw(text, len)  dc.w - h; len--);
@@ -577,11 +588,8 @@
 	memcpy(buf, text, len);
 	if(len  olen)
 		for(i = len; i  i  len - 3; buf[--i] = '.');
-	XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
-	if(dc.font.set)
-		XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
-	else
-		XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
+	pango_layout_set_text(dc.plo, text, len);
+	pango_xft_render_layout(dc.xftdrawable, (col==dc.norm?dc.xftnorm:dc.xftsel)+(invert?ColBG:ColFG), dc.plo, x * PANGO_SCALE, y * PANGO_SCALE);
 }
 
 void
@@ -671,13 +679,13 @@
 }
 
 unsigned long
-getcolor(const char *colstr) {
+getcolor(const char *colstr, XftColor *color) {
 	Colormap cmap = DefaultColormap(dpy, screen);
-	XColor color;
+	Visual *vis = DefaultVisual(dpy, screen);
 
-	if(!XAllocNamedColor(dpy, cmap, colstr, color, color))
+	if(!XftColorAllocName(dpy,vis,cmap,colstr, color))
 		die(error, cannot allocate color '%s'\n, colstr);
-	return color.pixel;
+	return color-pixel;
 }
 
 long
@@ -762,36 +770,20 @@
 
 void
 initfont(const char *fontstr) {
-	char *def, **missing;
-	int i, n;
+	PangoFontMetrics *metrics;
 
-	missing = NULL;
-	dc.font.set = XCreateFontSet(dpy, fontstr, missing, n, def);
-	if(missing) {
-		while(n--)
-			fprintf(stderr, dwm: missing fontset: %s\n, missing[n]);
-		XFreeStringList(missing);
-	}
-	if(dc.font.set) {
-		XFontSetExtents *font_extents;
-		XFontStruct **xfonts;
-		char **font_names;
-		dc.font.ascent = dc.font.descent = 0;
-		font_extents = 

Re: [SOLVED] [dwm] Gvim size problem

2009-04-17 Thread bill lam
On Fri, 17 Apr 2009, Dusan wrote:
 On Fri, 17 Apr 2009 12:57:53 +0200 (CEST)
 Preben Randhol rand...@pvv.org wrote:
 
   Here it is. Gvim is on the left -- there is huge vertical stripe on
   the right part of it. When I do float-unfloat gvim takes whole area
   and works well after that. I use 50:50 split.
  
  What happens if you run: gvim -U NONE -u NONE
  
  This starts gvim without loading any setup you have.
  
  It is not ghr nor lines that will fix your problem, they are for the
  vertical space and not horizontal as seem to be your problem.
  
  type :set columns
  in vim before and after you float unfloat the gvim to see if this
  changes.
  
  HTH
  
  Preben
  
  
 
 104 first time, 119 after gvim gets real dimensions.
 
 -u NONE works so I tested what makes problem in my .vimrc. It was font
 definition :(
 
 set guifont was the problem. I don't get it but Envy Code font makes
 this problem.

You may try adding 

set lines=200 columns=200

after the line that set gfn.  It doesn't matter these values are
larger than your screem since it will resize itself to the maximum
allowable lines and columns.

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩291 杜牧  泊秦淮
煙籠寒水月籠沙  夜泊秦淮近酒家  商女不知亡國恨  隔江猶唱後庭花



Re: [SOLVED] [dwm] Gvim size problem

2009-04-17 Thread Preben Randhol
On Fri, 17 Apr 2009 22:25:46 +0800
bill lam cbill@gmail.com wrote:


 You may try adding 
 
 set lines=200 columns=200
 
 after the line that set gfn.  It doesn't matter these values are
 larger than your screem since it will resize itself to the maximum
 allowable lines and columns.

No, they won't. At least not for me.

Preben



Re: [SOLVED] [dwm] Gvim size problem

2009-04-17 Thread Preben Randhol
On Thu, 16 Apr 2009 23:12:15 -0700
Amit Uttamchandani atu13...@csun.edu wrote:


 When opening a new tab the command input disappears, setting ghr=5
 fixes it in my set up.
 

Yes, you are right. I don't use tabs though, so didn't think of
testing that :-). However, I see that when the interface changes like
tabs or horizontal scrollbar, one may need to float unfloat to get gvim
drawn correctly.

So just experiment with the ghr to fit your setup the best :-)

Preben



Re: [dwm] Font recomendation to get unicode in statusbar?

2009-04-17 Thread Preben Randhol
On Fri, 17 Apr 2009 15:33:53 +0200
Szabolcs Nagy nszabo...@gmail.com wrote:

 On 4/17/09, Preben Randhol rand...@pvv.org wrote:
  Is there another font you would recommend that works with
  unicode?
 
 fixed font
 
 more details: http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html
 

Problem is that fixed font in xterm looks nice, but in the status bar
it looks ugly for Greek language. the letters are both bold and italic.
How do you define font[] ?

Preben



Re: [dwm] Font recomendation to get unicode in statusbar?

2009-04-17 Thread Preben Randhol
On Fri, 17 Apr 2009 21:47:27 +0800
Haomin Wen wen1...@gmail.com wrote:

 I manage to use wenquanyi bitmap song to display Chinese characters on
 the dwm bar in Arch linux,  but there is always something wrong on
 Ubuntu. Now I give up. I begin to use Xft.
 
 You can use Xft. There are several patches which enable Xft.
 
 The attached patch uses pango to render text. You can apply the patch
 and change your font to something like sans-10. Then pango and
 fontconfig will select proper fonts for you.
 
 I found this patch on this mailing list, but I do not remember who
 write it.

Interesting! I'll have a look.
Thanks

Preben



[dwm] Replacing slock screen overlay with screenshot / bitmap

2009-04-17 Thread Antony Jepson
Hello.

This is a random thought that popped into my head earlier on today but I
was wondering if it would be possible to replace the black screen
overlay (I assume that's what it is) with a screen shot of the desktop,
taken immediately as slock is executed.  My intent is to have a static
picture of the screen so that when someone tries to use it, nothing
happens, i.e., the desktop is locked.

Is this possible?  Well, of course it is, but the real question is,
would someone be willing to help implement it / point me in the right
direction?

Thanks.

-- 
Sincerely,

Antony Jepson /  anton...@gmail.com / GPG Key: 0xFA10ED80


pgpSNzMHfyjWm.pgp
Description: PGP signature


Re: [dwm] Replacing slock screen overlay with screenshot / bitmap

2009-04-17 Thread Scytrin dai Kinthra
I use a combination of xss and xkeygrab to lock my screen but allow
the UI to update in the background so I can see incoming emails and
chats. I imagine you could use a combination of a screencap and a
static image display screen saver.

On Fri, Apr 17, 2009 at 19:53, Antony Jepson anton...@gmail.com wrote:
 Hello.

 This is a random thought that popped into my head earlier on today but I
 was wondering if it would be possible to replace the black screen
 overlay (I assume that's what it is) with a screen shot of the desktop,
 taken immediately as slock is executed.  My intent is to have a static
 picture of the screen so that when someone tries to use it, nothing
 happens, i.e., the desktop is locked.

 Is this possible?  Well, of course it is, but the real question is,
 would someone be willing to help implement it / point me in the right
 direction?

 Thanks.

 --
 Sincerely,

 Antony Jepson /  anton...@gmail.com / GPG Key: 0xFA10ED80




-- 
stadik.net