Re: [dev] smessage

2012-03-02 Thread Fernando C.V.
I've been wanting for a long time some simple tool to replace the
libnotify popups. Using xsetroot is just not enough for me to notice
the warnings (and I do need to be warned when my battery is running
out or the temperature is too high). Both xmessage and smessage use a
window that steals the focus as soon as it appears, so it's not very
nice.

I didn't play too much with X11 API.. would it be even possible to
modify smessage.c to draw directly on the display without using a
window? if so.. any help on how would I do this?

-- 
Fernando



Re: [dev] smessage

2012-03-02 Thread Nick
Quoth Fernando C.V.:
 I've been wanting for a long time some simple tool to replace the
 libnotify popups. Using xsetroot is just not enough for me to notice
 the warnings (and I do need to be warned when my battery is running
 out or the temperature is too high). Both xmessage and smessage use a
 window that steals the focus as soon as it appears, so it's not very
 nice.

Take a look at xosd's osd_cat program. I haven't looked at the code, 
but it will likely do what you want.

Nick


pgpnPa8qatAfQ.pgp
Description: PGP signature


Re: [dev] smessage

2012-02-27 Thread Florian Limberger

Greetings list,

On Thu, 23 Feb 2012 09:13:07 +0100, Michael Stummvoll wrote:

An operation Mode without any Buttons where the Window closes itselfs
after x seconds would be also great I think. Than somebody could use
smessage also for displaying popup-infos whithin a desktop 
environment

for example.


As mentioned before, the closing timer should be implemented in a
separate script, but how is the consensus about duplicating 
functionality?
The button handling of original xmessage might be provided by 
Christoph's
thingmenu, so is it reasonable to implement it again for smessage or 
should

the functionality kept separated?

-flo



Re: [dev] smessage

2012-02-26 Thread Florian Limberger

Hi Michael,

On 23.02.2012 09:13, Michael Stummvoll wrote:
 Also when i resize a window
 (make it bigger) its not redrawn correctly for me.
I've looked into this, but wasn't able to reproduce this. I've found
and fixed another error, which occured when it is shrinked to a width
below one character width + 2 * margins.
The only way I can think of is that you use a font, which width is not
8. Since I've not yet figured out an elegant way how to determine the
(average and/or actual) glyph width in X, it's hardcoded by now, so you
can try to change the 8 at the end of the line smessage.c:458 to the
width of your fixed font. If you use a proportinal font, I have no
solution at the moment.

-flo



Re: [dev] smessage

2012-02-26 Thread Aurélien Aptel
On Mon, Feb 27, 2012 at 12:14 AM, Florian Limberger
f...@snakeoilproductions.net wrote:
 width of your fixed font. If you use a proportinal font, I have no
 solution at the moment.

I guess you could find the right amount of characters to draw to fill
a line using (dichotomously) XmbTextExtents().



Re: [dev] smessage

2012-02-25 Thread Bartosz Pranczke
Hi Florian,
yes, I have deleted -Werror and then it works without any problem.
I use most current version of ArchLinux x64 with libx11 1.4.99.1-1.


On 18:55 Thu 23 Feb , Florian Limberger wrote:
 Hi Bartosz,
 
 On 23.02.2012 13:30, Bartosz Pranczke wrote:
  I have a warning preventing this from compile.
 
  cc -Wall -Wextra -Werror -std=c99 -pedantic  -I/usr/X11R6/include
  -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DNAME=\smessage\
  -DVERSION=\ALPHA\ -c smessage.c
  smessage.c: In function ‘handlekey’:
  smessage.c:568:2: error: ‘XKeycodeToKeysym’ is deprecated (declared at
  /usr/include/X11/Xlib.h:1695) [-Werror=deprecated-declarations]
 
 Delete -Werror to make it compile anyway, but this warning is new to
 me. And honestly, I don't think it makes sense, since if the want you
 to use XKB, you won't be using Xlib anyway.
 
 But it clearly shows that i should make a release option in the
 makefile, which is not that picky.
 
 Out of couriousity, what system do you use? I hacked on slackware,
 where I didn't got that warning.
 
 -flo



Re: [dev] smessage

2012-02-23 Thread Michael Stummvoll
Hi Florian, 
nice Tool, but you should make thinks like the font or colors
configurable (excluded in a config.h). Also when i resize a window
(make it bigger) its not redrawn correctly for me.

An operation Mode without any Buttons where the Window closes itselfs
after x seconds would be also great I think. Than somebody could use
smessage also for displaying popup-infos whithin a desktop environment
for example.

Kind regards,
Michael



Re: [dev] smessage

2012-02-23 Thread Aurélien Aptel
On Tue, Feb 21, 2012 at 11:55 AM, Florian Limberger
f...@snakeoilproductions.net wrote:
 I have hacked up a simple xmessage replacement which looks neater,
 has dmenu-like handling and supports unicode.

Nice code.
If you want to replace xmessage, you should make text scrollable and selectable.



Re: [dev] smessage

2012-02-23 Thread Bartosz Pranczke
I have a warning preventing this from compile.

cc -Wall -Wextra -Werror -std=c99 -pedantic  -I/usr/X11R6/include
-D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DNAME=\smessage\
-DVERSION=\ALPHA\ -c smessage.c
smessage.c: In function ‘handlekey’:
smessage.c:568:2: error: ‘XKeycodeToKeysym’ is deprecated (declared at
/usr/include/X11/Xlib.h:1695) [-Werror=deprecated-declarations]
cc1: all warnings being treated as errors

make: *** [smessage.o] Error 1



On 11:55 Tue 21 Feb , Florian Limberger wrote:
 Greetings list,
 
 I have hacked up a simple xmessage replacement which looks neater,
 has dmenu-like handling and supports unicode.
 
 Since this is my first real project, I appreciate serious criticism of
 the code.
 
 Thanks go out to Christoph Lohmann for svkb/thingmenu, which inspired
 various pieces of code.
 
 I do not consider the program finished yet, just grep for TODO to see
 what I mean.
 
 -flo



Re: [dev] smessage

2012-02-23 Thread Ivan Kanakarakis
There's XkbKeycodeToKeysym which needs theX11/XKBlib.h
Here's the man page relevant part:

   The XKeycodeToKeysym function uses internal Xlib tables and returns
the KeySym defined for the specified KeyCode and the element of the Key‐
   Code vector.  If no symbol is defined, XKeycodeToKeysym returns
NoSymbol.  XKeycodeToKeysym predates the XKB extension. If you want to
lookup
   a KeySym while using XKB you have to use XkbKeycodeToKeysym.

SEE ALSO
   XLookupKeysym(3)
   Xlib - C Language X Interface


On 23 February 2012 14:30, Bartosz Pranczke b.pranc...@gmail.com wrote:

 I have a warning preventing this from compile.

 cc -Wall -Wextra -Werror -std=c99 -pedantic  -I/usr/X11R6/include
 -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DNAME=\smessage\
 -DVERSION=\ALPHA\ -c smessage.c
 smessage.c: In function ‘handlekey’:
 smessage.c:568:2: error: ‘XKeycodeToKeysym’ is deprecated (declared at
 /usr/include/X11/Xlib.h:1695) [-Werror=deprecated-declarations]
 cc1: all warnings being treated as errors

 make: *** [smessage.o] Error 1



 On 11:55 Tue 21 Feb , Florian Limberger wrote:
  Greetings list,
 
  I have hacked up a simple xmessage replacement which looks neater,
  has dmenu-like handling and supports unicode.
 
  Since this is my first real project, I appreciate serious criticism of
  the code.
 
  Thanks go out to Christoph Lohmann for svkb/thingmenu, which inspired
  various pieces of code.
 
  I do not consider the program finished yet, just grep for TODO to see
  what I mean.
 
  -flo




-- 
*Ivan c00kiemon5ter V Kanakarakis *


Re: [dev] smessage

2012-02-23 Thread Ivan Kanakarakis
oh, forgot to say that I don't get such a warning, everything
seems fine here. I'm with libx11 1.4.4 , xproto 7.0.22-1


On 23 February 2012 15:20, Ivan Kanakarakis ivan.ka...@gmail.com wrote:

 There's XkbKeycodeToKeysym which needs theX11/XKBlib.h
 Here's the man page relevant part:

The XKeycodeToKeysym function uses internal Xlib tables and returns
 the KeySym defined for the specified KeyCode and the element of the Key‐
Code vector.  If no symbol is defined, XKeycodeToKeysym returns
 NoSymbol.  XKeycodeToKeysym predates the XKB extension. If you want to
 lookup
a KeySym while using XKB you have to use XkbKeycodeToKeysym.

 SEE ALSO
XLookupKeysym(3)
Xlib - C Language X Interface


 On 23 February 2012 14:30, Bartosz Pranczke b.pranc...@gmail.com wrote:

 I have a warning preventing this from compile.

 cc -Wall -Wextra -Werror -std=c99 -pedantic  -I/usr/X11R6/include
 -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DNAME=\smessage\
 -DVERSION=\ALPHA\ -c smessage.c
 smessage.c: In function ‘handlekey’:
 smessage.c:568:2: error: ‘XKeycodeToKeysym’ is deprecated (declared at
 /usr/include/X11/Xlib.h:1695) [-Werror=deprecated-declarations]
 cc1: all warnings being treated as errors

 make: *** [smessage.o] Error 1



 On 11:55 Tue 21 Feb , Florian Limberger wrote:
  Greetings list,
 
  I have hacked up a simple xmessage replacement which looks neater,
  has dmenu-like handling and supports unicode.
 
  Since this is my first real project, I appreciate serious criticism of
  the code.
 
  Thanks go out to Christoph Lohmann for svkb/thingmenu, which inspired
  various pieces of code.
 
  I do not consider the program finished yet, just grep for TODO to see
  what I mean.
 
  -flo




 --
 *Ivan c00kiemon5ter V Kanakarakis *




-- 
*Ivan c00kiemon5ter V Kanakarakis *


Re: [dev] smessage

2012-02-23 Thread Florian Limberger

Hi Michael,

On 23.02.2012 09:13, Michael Stummvoll wrote:
 nice Tool, but you should make thinks like the font or colors
 configurable (excluded in a config.h).

personally I don't like nested includes much, but if it's general
consent that it is the preferred way, I'll change it. At the moment,
nesting is not necessary anyway.

 Also when i resize a window
 (make it bigger) its not redrawn correctly for me.

The redrawing costed me a night and I thought it would work, but I'll
look into it. I just are short an time at the moment.

 An operation Mode without any Buttons where the Window closes itselfs
 after x seconds would be also great I think. Than somebody could use
 smessage also for displaying popup-infos whithin a desktop environment
 for example.

Thats a nice idea, I think it would be great with the (not yet
implemented) function to force geometry.

-flo




Re: [dev] smessage

2012-02-23 Thread Florian Limberger

Hi Aurélien,

On 23.02.2012 13:06, Aurélien Aptel wrote:
 Nice code.

Thanks.

 If you want to replace xmessage, you should make text scrollable and 
selectable.


Thats actually  quite at the top on my to do list.

-flo



Re: [dev] smessage

2012-02-23 Thread Florian Limberger

Hi Bartosz,

On 23.02.2012 13:30, Bartosz Pranczke wrote:
 I have a warning preventing this from compile.

 cc -Wall -Wextra -Werror -std=c99 -pedantic  -I/usr/X11R6/include
 -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DNAME=\smessage\
 -DVERSION=\ALPHA\ -c smessage.c
 smessage.c: In function ‘handlekey’:
 smessage.c:568:2: error: ‘XKeycodeToKeysym’ is deprecated (declared at
 /usr/include/X11/Xlib.h:1695) [-Werror=deprecated-declarations]

Delete -Werror to make it compile anyway, but this warning is new to
me. And honestly, I don't think it makes sense, since if the want you
to use XKB, you won't be using Xlib anyway.

But it clearly shows that i should make a release option in the
makefile, which is not that picky.

Out of couriousity, what system do you use? I hacked on slackware,
where I didn't got that warning.

-flo



Re: [dev] smessage

2012-02-23 Thread Hadrian Węgrzynowski
Dnia 2012-02-23, o godz. 18:45:08
Florian Limberger f...@snakeoilproductions.net napisał(a):

   An operation Mode without any Buttons where the Window closes
   itselfs after x seconds would be also great I think. Than somebody
   could use smessage also for displaying popup-infos whithin a
   desktop environment for example.
 
 Thats a nice idea, I think it would be great with the (not yet
 implemented) function to force geometry.

Closing after x seconds can be made within a simple shell script. So I
think you can omit that part of this feature. Maybe only provide script
itself as example.



Re: [dev] smessage

2012-02-21 Thread Nick
On Tue, Feb 21, 2012 at 11:55:20AM +0100, Florian Limberger wrote:
 I have hacked up a simple xmessage replacement which looks neater,
 has dmenu-like handling and supports unicode.

Linky?



Re: [dev] smessage

2012-02-21 Thread Florian Limberger

On Tue, 21 Feb 2012 11:55:20 +0100, Florian Limberger wrote:

Greetings list,

I have hacked up a simple xmessage replacement which looks neater,
has dmenu-like handling and supports unicode.


And I am obviously too tired to write mails.

Code now attached.

-flo

smessage.tar.bz2
Description: BZip2 compressed data