You are not logged in.

#1 2009-07-28 16:47:56

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

CAW!!! Python Taskbar / Panel / Systray

It seemed like PyPanel had the right idea but the configuration was very limited and it was very old and unmaintained.  It also had the limitation that it didn't allow one to display system information or add new functionality.  The Awesome panel is a perfect example of something that has all the features but it is tied to the Awesome WM.  dzen2 has all the features but it relies heavily on sed/awk which can end up being un-fun to configure and it doesn't as easily allow for input (although the new dzen allows for clickable areas).

I basically find it easier to configure my statusbar with a language like Python which already has lots of libraries available to provide information as opposed to writing shell script which can be a headache.

So I completely rewrote PyPanel using inspiration from Awesome and dzen to use XCB / XPYB and Cairo (and eventually Pango).

Right now it's currently only available from github.  I am looking for feedback.  Are people interested in this?  What is missing?  Is writing in Python mean it's not lightweight enough?

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

GitHub

AUR

Screenshots (shows the current desktop, systray, cpu1, cpu2, net(down), net(up), vol(PCM), vol(MASTER), datetime)
cawt.png

Shows the new and improved taskbar
caw2t.png

Documentation: http://caw.milkbox.net

Last edited by dcurtis (2009-08-19 13:25:12)


CAW! Taskbar: AUR ;; forum ;; git

Offline

#2 2009-07-28 17:46:55

lman
Member
From: CZ
Registered: 2007-12-18
Posts: 255

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

I think it's an amazing idea. You should continue working on this, as far as I have seen, there is still a bit of work until it get's usable in real life. Also you should consider separating the plugins, configs, core, so the first two could exist also in the users .config or whatever directory.
Keep up the good work!

Offline

#3 2009-07-28 19:21:11

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

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

dcurtis wrote:

Right now it's currently only available from github. I am looking for feedback.  Are people interested in this?  What is missing?  Is writing in Python mean it's not lightweight enough?

I like the project, and Python. I browsed trough the code and I think your should make the "official" widgets modular right from the start. User imports what he wants, ignores the rest and so on... but it is also much easier to contribute (or share with others) that way, someone just writes a few lines of Python and plugs them in.

I thought about that a lot recently, in the context of awesome, you can read my conclusions here http://sysphere.org/~anrxc/j/archives/2 … awesome_wm


You need to install an RTFM interface.

Offline

#4 2009-07-28 21:01:50

Square
Member
Registered: 2008-06-11
Posts: 435

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

< ~/caw > python setup.py build
Traceback (most recent call last):
  File "setup.py", line 33, in <module>
    for line in fileinput.input(["pynel.py"], inplace=1):
  File "/usr/lib/python2.6/fileinput.py", line 253, in next
    line = self.readline()
  File "/usr/lib/python2.6/fileinput.py", line 322, in readline
    os.rename(self._filename, self._backupfilename)
OSError: [Errno 2] No such file or directory

 

Offline

#5 2009-07-29 04:13:47

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

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

I fixed some errors, separated widgets, and added a config file.  But, the install doesn't work right now. 

There is also some segfault issue somewhere.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#6 2009-07-29 05:23:21

Square
Member
Registered: 2008-06-11
Posts: 435

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

Hope you get everything sorted out soon. I was eager to give it a shot.


 

Offline

#7 2009-07-29 06:14:59

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

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

dcurtis wrote:

I fixed some errors, separated widgets, and added a config file.  But, the install doesn't work right now. 

There is also some segfault issue somewhere.

Will you marry me?

j/k
I'll try this out when I get home (remember you are competing against tint2 now wink )


neutral

Offline

#8 2009-07-29 14:35:56

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

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

I have fixed the segfault error.  Hilarious. 

Anyways, I'm working on an install script right now and when I get that done i'll post a PKGFILE on the aur for it.  I'll make a post when it gets sorted out.  Thanks for the feedback so far.

PS: Not so worried about tint2.  It seems to have little extensibility.  But, their taskbar is much faster than the experimental one in CAW.  I don't personally use a taskbar.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#9 2009-07-29 19:37:23

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

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

I have posted a new version which includes a weather and net app, along with a PKGBUILD file (which is also available on the aur).

To configure you should copy the /etc/xdg/caw/configure.py into $HOME/.config/caw/config.py and tweak that.

The taskbar should reload itself when seeing a config change, but won't fallback to alternate config if you fail miserably and configuration smile


CAW! Taskbar: AUR ;; forum ;; git

Offline

#10 2009-08-03 16:54:45

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

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

/shameless bump

wanted to see if anyone has given this a shot and had any success.  i recently fixed a few bugs and added a FIFO plugin which should make a lot of xmonad people happy.  This means you can pipe in some data to the bar through a file fifo.  I need to make a stdin one and also make one that can parse some text to be processed.  Right now I leave it up to the plugins to render their own text as I don't want to write a string parser.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#11 2009-08-03 17:32:57

Renan Birck
Member
From: Brazil
Registered: 2007-11-11
Posts: 401
Website

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

I love it, even though I know very little Python I managed to configure it. Is there documentation for the modules and their features?

EDIT: just discovered a bug. If I have the taskbar on and switch to a desktop with no windows, it dies:

Traceback (most recent call last):
  File "/home/renan/.config/caw/config.py", line 72, in <module>
    caw.mainloop()
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 306, in mainloop
    self.redraw()
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 384, in redraw
    w.draw()
  File "/usr/lib/python2.6/site-packages/caw/widgets/tasklist.py", line 134, in draw
    percli = availwidth / len(clients)
ZeroDivisionError: float division

Last edited by Renan Birck (2009-08-03 17:49:25)

Offline

#12 2009-08-03 20:14:20

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

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

I don't yet have a project page.  I want to stay away from Sourceforge.  I'd like something that integrates well with Github or at least uses git.

That bug has been fixed.

Last edited by dcurtis (2009-08-03 20:15:21)


CAW! Taskbar: AUR ;; forum ;; git

Offline

#13 2009-08-05 10:55:50

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

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

Hi,

i really like caw! would be nice if you can provide an template for the widgets, so it'd be easier for others to develop their own. and is there a way to configure the taskbar entries, like maximal width, colors, alignment etc?

anyway, thank you for this piece of software!

rich_o

Offline

#14 2009-08-09 08:07:44

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

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

Looks nice. I'll consider switching from lxpanel to caw.
Still, it needs some documentation, I think.
I.e. I could not make the battery monitor and sound level work (well, I didn't try hard). And the task bar didn't take all free space by default. If there were some docs, I could refer to them.

Offline

#15 2009-08-09 22:32:52

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

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

Mr.Cat reporting.
Consider adding python-pyalsaaudio as an optdepend for Volume widget. Also, what is this stuff with vol.button5 in a default config about?

It would be nice if a battery (when charging) could show time until it is fully charged. It would also be nice to have the battery output customizable.

Also, I wanna change the foreground and the background color for the active window in the taskbar. How would I do that?

My config file for samsung nc10 (notably, it has BAT1 instead of BAT0): http://gist.github.com/164932

Offline

#16 2009-08-09 23:34:31

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

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

I am still working out a way to customize output.  I am slightly opposed to writing a string parser which would be needed to parse strings and change colors while outputting.

the vol.button5 is a trick i used so that the percentage sign will perform the button4 and button5 button events just like if it were on the widget.  Notice that the volume widget doesn't (by default) show the percentage sign, and i have a text widget actually display the percentage sign (because I don't want it to be the same color).  So, i instanctiate 'vol' which is a Volume widget, then when I create the Text widget for the "%", the button binding for % is the same as the volume widget causing a scroll on the "%" to adjust the volume also.   I think i'm going to change this syntax slightly in the upcoming days.

as for the taskbar, that is coming.  I haven't gotten that far yet  with the taskbar, I'll work on it soon.  At some point it will simply be an option of the widget itself.  I'll let you know. 

Thanks for the comments.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#17 2009-08-10 00:19:56

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

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

Thanks for the response.

Now I've encountered the following issue. With my config above when a window which has a tray icon (like pidgin or xchat) is closed - caw crashes this way:

Traceback (most recent call last):
  File "/home/cat/.config/caw/config.py", line 49, in <module>
    caw.mainloop()
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 323, in mainloop
    self._fdhandlers[fd](eventmask)
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 284, in _process_xevents
    func(event)
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 410, in _property_notify
    func(e)
  File "/usr/lib/python2.6/site-packages/caw/widgets/tasklist.py", line 73, in _update_desktop
    self.clients[id]['desktop'] = struct.unpack_from('I',r.value.buf())[0]
struct.error: unpack_from requires a buffer of at least 4 bytes

Also, caw won't display nonlatin letters (cyrillic in my case). Does not seem to be a font issue (I've also tried with DejaVu Sans Mono which has cyrillic letters for sure).

Last edited by Mr.Cat (2009-08-10 08:19:14)

Offline

#18 2009-08-10 01:01:22

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

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

Non-latin support is a must for me too. I'm really interested in this project.


< 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

#19 2009-08-10 02:29:19

simongmzlj
Member
From: Canada
Registered: 2008-11-06
Posts: 135

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

Awesome job. Might not be a bad idea to blur the lines a bit between a panel and something conky like.

Offline

#20 2009-08-10 19:25:04

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

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

Mr.Cat wrote:

Thanks for the response.

Now I've encountered the following issue. With my config above when a window which has a tray icon (like pidgin or xchat) is closed - caw crashes this way:

Traceback (most recent call last):
  File "/home/cat/.config/caw/config.py", line 49, in <module>
    caw.mainloop()
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 323, in mainloop
    self._fdhandlers[fd](eventmask)
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 284, in _process_xevents
    func(event)
  File "/usr/lib/python2.6/site-packages/caw/caw.py", line 410, in _property_notify
    func(e)
  File "/usr/lib/python2.6/site-packages/caw/widgets/tasklist.py", line 73, in _update_desktop
    self.clients[id]['desktop'] = struct.unpack_from('I',r.value.buf())[0]
struct.error: unpack_from requires a buffer of at least 4 bytes

Also, caw won't display nonlatin letters (cyrillic in my case). Does not seem to be a font issue (I've also tried with DejaVu Sans Mono which has cyrillic letters for sure).

I fixed this bug.  I'm not sure what is going on with the font issue.

I will try to fix this next.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#21 2009-08-10 19:28:15

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

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

Mr.Cat wrote:

Mr.Cat reporting.
Consider adding python-pyalsaaudio as an optdepend for Volume widget. Also, what is this stuff with vol.button5 in a default config about?

It would be nice if a battery (when charging) could show time until it is fully charged. It would also be nice to have the battery output customizable.

Also, I wanna change the foreground and the background color for the active window in the taskbar. How would I do that?

My config file for samsung nc10 (notably, it has BAT1 instead of BAT0): http://gist.github.com/164932

I made a new commit that allows you to change the forground and background color for the taskbar and also the borders.  Detailed documentation is coming.

basically the Taskbar class taske some parameters at instantiation time:

margin : padding on top and bottom of task
padding : padding between border to task (on the x direction)
spacing : space between each task
border_width : width of the border
border_color : border color of all tasks
border_current : border color of current task
border_minimized : border color of minimized

There are also fg_color, fg_current, fg_minimized, bg_color, bg_current, bg_minimized... they do what you would expect for tasks.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#22 2009-08-11 02:59:25

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

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

Just an update.  I am currently working on migrating from cairo to xft even thought they have not yet ported xft to xcb.  Frankly, XFT's font rendering is 100 times better than cairo.  So disappointing.


CAW! Taskbar: AUR ;; forum ;; git

Offline

#23 2009-08-11 09:05:45

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

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

dcurtis wrote:

I made a new commit that allows you to change the forground and background color for the taskbar and also the borders.  Detailed documentation is coming.

Awesome!

Offline

#24 2009-08-11 09:07:47

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

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

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).

Last edited by Mr.Cat (2009-08-11 10:10:33)

Offline

#25 2009-08-11 09:11:26

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

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

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.

Offline

Board footer

Powered by FluxBB