You are not logged in.

#26 2009-08-11 15:10:02

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

Mr.Cat wrote:

Btw, I'm curious, what's wrong with cairo, so that you're going to switch to xft? Iirc you're using cairo "toy api" (*_text functions, not *_glyph) ones. You may switch to the latter (together with pango to convert text to glyphs).

I'm not sure about this but here is an example.  It took me only about 30 min and I added some legacy stuff to use Xft and look at the difference in rendering:

cairo_text.png xft_text.png

Can you figure out which is which?  The one on the right is XFT.  I can tell a noticeable difference.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#27 2009-08-11 20:12:52

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

Fixed the bugs with the font rendering.  It had to do with DPI settings and I improved the whole thing to use Pango.  Try your special fonts as I assume they will work now... Or I cross my fingers that they will..

As a side question: does pypanel properly handle your cyrillic characters?

Edit: I tested this and caw is now supporting cyrillic character.

As to your response about cairo:
Cairo give a lot of advantages as itI am in a way stuck with cairo.  I think that Xft is old news but supposedly all I've read is that for performance, pango and cairo are pretty heavy duty, things like imlib and xft can perform a little bit faster.  I don't know much about either of them but I am concerned about performance.  I chose XCB because it was supposed to perform better than Xlib, but it kinda forces you to use cairo until Xft gets ported (probably never will) or something new comes along.  It looks like even GTK2 isn't using cairo?

The other problem I have with pango/cairo is that it relies on glib2 so that throws another dependency in the mix.  I'm not sure there is any system that doesn't have glib on it but maybe.

Regardless, if performance is an issue it should be discussed now because it is easy enough for me to switch to imlib/xft rather than pango/cairo.

Last edited by dcurtis (2009-08-11 20:33:15)


CAW! Taskbar: AUR ;; forum ;; git

Offline

#28 2009-08-11 21:40:28

murilo
Member
From: Brazil
Registered: 2009-02-15
Posts: 8
Website

Re: CAW!!! Python Taskbar / Panel / Systray

I have much interest in your app dcurtis! I've used pypanel for almost a year now, and it's a shame the project is discontinued. I was waiting eagerly for another pypanel-like panel (:

Subscribed!

Offline

#29 2009-08-11 22:18:17

makimaki
Member
From: Ireland
Registered: 2009-04-02
Posts: 109

Re: CAW!!! Python Taskbar / Panel / Systray

dcurtis wrote:

Fixed the bugs with the font rendering.  It had to do with DPI settings and I improved the whole thing to use Pango.  Try your special fonts as I assume they will work now... Or I cross my fingers that they will..
....

The latest version is very nice, I really like the new font rendering smile

I only have a little suggestion, and noticed a bug with the Tasklist:

1. Panel x,y offset:
In caw.py change

        self.x = 0
        if kwargs.get('edge', 1):
         self.y = self.screen.height_in_pixels - self.height
        else:
         self.y = 0

to:

  
        self.x = kwargs.get('x_offset',0)
        if kwargs.get('edge', 1):
         self.y = kwargs.get('y_offset',0) + self.screen.height_in_pixels - self.height
        else:
         self.y = kwargs.get('y_offset',0)

So that in .config/caw/config.py this can be done (I have an NC10 with a 1024x600 display like Mr. Cat)

caw = Caw(
        font_face='gelly',
        font_size=12,
        fg_color=0x636363,
        bg_color=0x181818,
        shading=256/4 * 3,
        border_color=0x303030,
        height=12,
        border_width=1,
        x_offset=0,
        y_offset=600,
        edge=0
        )

2. Tasklist Bug
I still use LXDE, but I have it load Musca rather than Openbox as my WM, and if I minimize somthing from the taskbar caw crashes giving this error:

Traceback (most recent call last):
  File "/home/peter/.config/caw/config.py", line 81, in <module>
    caw.mainloop()
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 341, in mainloop
    self._fdhandlers[fd](eventmask)
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 295, in _process_xevents
    event = self.connection.poll_for_event()
xcb.xproto.BadMatch: <xcb.xproto.MatchError object at 0xb72cba7c>

If I start caw again and restore the window, caw crashes again and gives a very slightly different error:

Traceback (most recent call last):
  File "/home/peter/.config/caw/config.py", line 81, in <module>
    caw.mainloop()
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 341, in mainloop
    self._fdhandlers[fd](eventmask)
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 295, in _process_xevents
    event = self.connection.poll_for_event()
xcb.xproto.BadMatch: <xcb.xproto.MatchError object at 0xb71de964>

I'll try and play around with it a bit more under different WMs see if its something particular to Musca.

PS Thank you for your great work, caw is a really nice panel smile


====* -- Joke
    O
    \|/ --- Me
    / \             Whooooosh

Offline

#30 2009-08-11 22:23:49

makimaki
Member
From: Ireland
Registered: 2009-04-02
Posts: 109

Re: CAW!!! Python Taskbar / Panel / Systray

Mr.Cat wrote:
dcurtis wrote:

Right now the volume widgets allow you to scroll up and down to change the volume.

Btw, on my box I had to change the default volume step from 1 to 2 or 3 to make the scroll work.

I also had the same issue as Mr.Cat, I changed the step to 2 and the scroll works fine, otherwise it scrolls very slowly down to 94% from 100% and won't go further. This is only for the master volume though, a step of 1 works fine when controlling the PCM.


====* -- Joke
    O
    \|/ --- Me
    / \             Whooooosh

Offline

#31 2009-08-11 23:02:07

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

makimaki wrote:

2. Tasklist Bug
I still use LXDE, but I have it load Musca rather than Openbox as my WM, and if I minimize somthing from the taskbar caw crashes giving this error:

Traceback (most recent call last):
  File "/home/peter/.config/caw/config.py", line 81, in <module>
    caw.mainloop()
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 341, in mainloop
    self._fdhandlers[fd](eventmask)
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 295, in _process_xevents
    event = self.connection.poll_for_event()
xcb.xproto.BadMatch: <xcb.xproto.MatchError object at 0xb72cba7c>

If I start caw again and restore the window, caw crashes again and gives a very slightly different error:

Traceback (most recent call last):
  File "/home/peter/.config/caw/config.py", line 81, in <module>
    caw.mainloop()
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 341, in mainloop
    self._fdhandlers[fd](eventmask)
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 295, in _process_xevents
    event = self.connection.poll_for_event()
xcb.xproto.BadMatch: <xcb.xproto.MatchError object at 0xb71de964>

I'll try and play around with it a bit more under different WMs see if its something particular to Musca.

PS Thank you for your great work, caw is a really nice panel smile

**1)  I'll take care of that soon.

**2) I had a similar problem in OpenBox and it's something to do with trying to set a value or get a state for a window that doesn't exist.  Easily enough I can ignore those errors in the mainloop, but I'd rather figure out what is causing it.  I know there is a bug when a system tray icon gets deleted, the way that events propogate after the window has been deleted causes some BadWindow requests which I think are fine to ignore as the tray sees the windows as being deleted.

**3) The volume problem is something with pyalsaaudio.  It seems like on some systems (my laptop is the same), there is no 32 value.  So, if stepping by 1, if the current volume is 31, it tries to set the volume to 32, but the pyalsaaudio won't let it, so it sets it back to 31.  I should most likely set the  default step to something higher and hopefully aleviate this problem.

SideNote: anyone else noticing flickering and have any idea hohw to fix it?  I ontice it when i'm on slower machines.  there must be some trick but I don't know what it is.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#32 2009-08-12 00:17:38

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

@makimaki

The latest git version supports the following additional parameters: above, xoffset, yoffset, width, height

above: specify of the taskbar should be on top of all other windows.  there is still a bug with this, it doesn't stay below...  don't know the exact atoms i need to set.

xoffset :: can be the number of pixels or a float specifying the fraction of pixels to offset,

yoffset :: may be positive or negative

width :: can be a negative to remove from the screen width.  may also be a float representing a fractino of the total screen size.

There are a few details about setting WM struts so that windows don't cover the panel.  basically if the panel is directly on an edge and "above"


CAW! Taskbar: AUR ;; forum ;; git

Offline

#33 2009-08-12 09:01:58

wankel
Member
From: Iowa, USA
Registered: 2008-05-30
Posts: 218
Website

Re: CAW!!! Python Taskbar / Panel / Systray

Nice project! Btw, I just graduated from the UofI last week, glad to be out of there big_smile

Offline

#34 2009-08-12 19:57:55

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

Just wanted to let you all know I posted some new documentation for the project.

http://caw.milkbox.net

I haven't gotten around to doing the widgets yet (except a few have some documentation) but the main module is pretty well documented.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#35 2009-08-12 22:49:41

Mr.Cat
Member
Registered: 2008-09-27
Posts: 79

Re: CAW!!! Python Taskbar / Panel / Systray

Still no success with cyrillic for me. Tasklist seems to call draw_text with an empty string as text when window title contains cyrillic letters (even when mixed with latin). Pypanel shows cyrillic letters fine.

Offline

#36 2009-08-12 23:13:17

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

I've never used foreign characters like that.  Is there an easy way for me to replicate what you're seeing.. Do I just change my locale?

If you can explain it to me ill be happy to figure out what's going on...


CAW! Taskbar: AUR ;; forum ;; git

Offline

#37 2009-08-12 23:47:52

Mr.Cat
Member
Registered: 2008-09-27
Posts: 79

Re: CAW!!! Python Taskbar / Panel / Systray

The easiest way, I think, is to visit a web-site which puts nonlatin characters in the browser's title.
An example is http://www.yandex.ru/ (it's a popular russian search engine, those guys even mantain an archlinux mirror).

As an alternative, you may generate ru_RU.UTF8 locale and then run, say `LANG=ru_RU.UTF8 pidgin`. Its contact list title should be "Список собеседников".

Another way could be just running, say, urxvt with -name set to a cyrillic string, but... it works fine. Caw displays urxvt's name correctly.

I think, I should post a cople of shots:
200908130345321024x600s.th.png
200908130345501024x600s.th.png

Last edited by Mr.Cat (2009-08-12 23:50:18)

Offline

#38 2009-08-13 19:31:11

makimaki
Member
From: Ireland
Registered: 2009-04-02
Posts: 109

Re: CAW!!! Python Taskbar / Panel / Systray

@dcurtis

wow that's a lot of work you put into the docs and the updates. I'm on holidays at the moment so I won't be able to bug test/try-to-break-your-code properly til next week smile


====* -- Joke
    O
    \|/ --- Me
    / \             Whooooosh

Offline

#39 2009-08-13 22:43:55

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

i generated a locale for ru_RU.UTF-8 but it didn't want to open Pidgin with russian translations.  I don't know if I'm missing something or what.  The website didn't work either.  This may be a XCB issue or something like that.  I'm not sure.  I'll have to see what they do in Awesome.  Will have more time later.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#40 2009-08-14 19:54:38

Psyce
Member
Registered: 2008-05-06
Posts: 51

Re: CAW!!! Python Taskbar / Panel / Systray

I like your new taskbar just installed it! How can I change the temperature from fahrenheit to celsius?

Offline

#41 2009-08-14 21:05:08

Mr.Cat
Member
Registered: 2008-09-27
Posts: 79

Re: CAW!!! Python Taskbar / Panel / Systray

Hm.. Sorry. Seems, that pidgin does not respect LANG and i (dunno why) thought it does.
And what's wrong with the site? Is it down? That's strange, since in this country it has ~100% uptime.
Well, I'll try to figure out, where does caw lose the letters (it's unlikely I'll succeed, but I'll try).

The issue seems to be in GetProperty method for XA_WM_NAME. It returns zero value_lengh for strings with cyrillic. Unfortunately, I'm not good at X11 and couldn't move further. Maybe, XA_STRING imlplies not utf-8, but latin1 only? But why does urxvt -name ... work fine?

I wonder, whether anyone else has this issue.

Last edited by Mr.Cat (2009-08-14 21:58:35)

Offline

#42 2009-08-14 22:29:34

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

Mr.Cat wrote:

Hm.. Sorry. Seems, that pidgin does not respect LANG and i (dunno why) thought it does.
And what's wrong with the site? Is it down? That's strange, since in this country it has ~100% uptime.
Well, I'll try to figure out, where does caw lose the letters (it's unlikely I'll succeed, but I'll try).

The issue seems to be in GetProperty method for XA_WM_NAME. It returns zero value_lengh for strings with cyrillic. Unfortunately, I'm not good at X11 and couldn't move further. Maybe, XA_STRING imlplies not utf-8, but latin1 only? But why does urxvt -name ... work fine?

I wonder, whether anyone else has this issue.

FIXED IT!

It was that there are some other atoms.  _NET_WM_NAME uses UTF8_STRING and COMPOUND_STRING or something like that.  It doesn't matter.  Anyways, I request whatever there is and it seems to find the correct text!

We'll see how that all goes from now on.  Give the newest push.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#43 2009-08-15 04:08:53

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

first, I promise what i'm about to say isn't going to happen again at least between major releases.

I changed the argument names for widgets and the main class to use a format that is more object-oriented and seem more logical to me....

for most widgets the colors are specified using fg/bg/border

There are a few widgets that have multiple colors based on state.  For example the CPU widget has

    fg as an alias for normal_fg

    normal_border : normal foreground for the cpu stat

    medium_fg : foreground for cpu when medium is met

    high_fg : foreground for cpu when the high is met

    medium : medium threshold

    high : high threshold

this is opposed to the previous syntax: (fg_color, fg_medium, fg_high).

I am sorry to change the config syntax.  I am alittle OCD so I wanted to finally pick something.  Before it was just kinda random.  Hope this isn't a deal breaker.  Like I said, I won't do this again and everything else should conform to it.  I'll write up some documentation about writing new widgets and naming parameters.


Fixed a lot of bugs too.

Last edited by dcurtis (2009-08-15 04:11:06)


CAW! Taskbar: AUR ;; forum ;; git

Offline

#44 2009-08-15 04:47:21

murilo
Member
From: Brazil
Registered: 2009-02-15
Posts: 8
Website

Re: CAW!!! Python Taskbar / Panel / Systray

I see a great future for your app, dcurtis :-)
If only I knew python, or had free time..

Offline

#45 2009-08-18 15:31:19

Chokkan
Member
Registered: 2009-04-06
Posts: 129

Re: CAW!!! Python Taskbar / Panel / Systray

I'd initially tried this from AUR and liked it, so I decided to go the git route. I know nothing about how git works but I managed to clone the repository and build caw as directed in the README. My problem is I can't start caw with ./caw like the README says. Give a noob a break and tell me where I'm going wrong.


< Daenyth> tomkx: my girlfriend is linux
< Daenyth> srsly
< Daenyth> she loves the way I «make install»
< Daenyth> all her /dev entries are mode 7 for me

Offline

#46 2009-08-18 21:35:55

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

@Chokkan


First off, the README you're referring to is out of date so I updated it.

Basically, you need to export your PYTHONPATH to use the development directories.

32bit

export PYTHONPATH=$HOME/src/caw/build/lib.linux-i686-2.6

64bit

export PYTHONPATH=$HOME/src/caw/build/lib.linux-x86_64-2.6

Then you can just run 'caw' as normal (or bin/caw) OR you can just run your config file....

python $HOME/.config/caw/config.py

If you're going to develop, this is the way to do it.  If not, I think just updating via AUR is the way to go.  Right now there isn't a way to run directly from the source directory without building between edits.  In other words, if you are doing development, setuptools builds everything and places it in that <src>/build/lib.linux-<arch>-2.6 directory.

Then I just run: 

python setup.py build && python $HOME/.config/caw/config.py

Last edited by dcurtis (2009-08-18 22:11:40)


CAW! Taskbar: AUR ;; forum ;; git

Offline

#47 2009-08-18 23:32:04

rich_o
Member
Registered: 2008-07-28
Posts: 49

Re: CAW!!! Python Taskbar / Panel / Systray

Hi Chokkan,

the AUR-Version is indeed a git-Version, too. So just use that, you get the newest version everytime you reinstall it via pacman. Way easier!

rich_o

Offline

#48 2009-08-19 01:56:43

Chokkan
Member
Registered: 2009-04-06
Posts: 129

Re: CAW!!! Python Taskbar / Panel / Systray

smile Thanks to both of you. I think I'll stick to AUR and keep an eye out for updates.


< Daenyth> tomkx: my girlfriend is linux
< Daenyth> srsly
< Daenyth> she loves the way I «make install»
< Daenyth> all her /dev entries are mode 7 for me

Offline

#49 2009-08-19 13:13:53

dcurtis
Member
From: Iowa City, IA
Registered: 2008-10-13
Posts: 53

Re: CAW!!! Python Taskbar / Panel / Systray

I renamed the 'caw' package to the git version.  So there is now a package 'caw-git'

Last edited by dcurtis (2009-08-19 13:23:39)


CAW! Taskbar: AUR ;; forum ;; git

Offline

#50 2009-08-20 08:58:32

rich_o
Member
Registered: 2008-07-28
Posts: 49

Re: CAW!!! Python Taskbar / Panel / Systray

Hi,

i have a bug with the tasklist. I post it here or do you prefer another place for bug reports?

Problem seems to occur when the window title contains those masked html stuff (how do you call that?) like Ü or — (i.e. on http://caw.milkbox.net/). The title line is pushed down.

Strange enough, when i wanted to take a screenshot of firefox with http://caw.milkbox.net opened, the bug was gone. So i took the screenshot of a local copy of "Documentation for CAW! — CAW! v.9 documentation.html", where it still exists as long as the — is in the title tag. After that, i reopened http://caw.milkbox.net and, well, the bug was back there. I really don't know...

caw_title_bug.png

My config.py (expires 2009-08-23 10:56:15) , using caw-git 20090820.

Last edited by rich_o (2009-08-20 09:43:25)

Offline

Board footer

Powered by FluxBB