You are not logged in.

#1 2012-07-16 09:59:13

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

bar - Lightweight xcb-based bar

A lightweight bar based on XCB (yay).
Provides foreground/background color switching along with text alignment (screw you dzen!), nothing less and nothing more.

Read this first.

Grab the code from Github

Last edited by TheLemonMan (2012-07-18 15:31:51)

Offline

#2 2012-07-16 10:01:04

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: bar - Lightweight xcb-based bar

nice, I'll be tring it out smile

edit: ha, works great big_smile

Last edited by c00kiemon5ter (2012-07-16 11:58:25)


.:[ git me! ] :.

Offline

#3 2012-07-16 12:21:40

guelfi
Member
From: /home/guelfi
Registered: 2011-07-01
Posts: 111

Re: bar - Lightweight xcb-based bar

Um, I haven't tried out the bar yet, but when looking over the source code, I saw that the bar doesn't react to Expose events. This could lead to some visual glitches (don't know a better word) if you temporarily move a window above the bar. Look at the XCB tutorial for more information.

Offline

#4 2012-07-16 12:48:57

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

guelfi wrote:

Um, I haven't tried out the bar yet, but when looking over the source code, I saw that the bar doesn't react to Expose events. This could lead to some visual glitches (don't know a better word) if you temporarily move a window above the bar. Look at the XCB tutorial for more information.

Done smile

Last edited by TheLemonMan (2012-07-17 09:34:53)

Offline

#5 2012-07-17 13:07:14

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: bar - Lightweight xcb-based bar

Thank you very much for that!

ps_mem.py:

 Private  +   Shared  =  RAM used	Program 
160.0 KiB +  51.0 KiB = 211.0 KiB	bar
224.0 KiB + 127.5 KiB = 351.5 KiB	monsterwm
324.0 KiB + 149.0 KiB = 473.0 KiB	some_sorta_bar

Edit: Forgot to mention the above is on x64...

Last edited by mhertz (2012-07-17 13:08:26)

Offline

#6 2012-07-17 16:50:19

bladdo
Member
From: Blacksburg, VA
Registered: 2008-05-05
Posts: 111
Website

Re: bar - Lightweight xcb-based bar

This is awesome. Straight up.


bladdo / mil / Miles
userbound.com - blog and projects

Offline

#7 2012-07-18 15:33:20

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

Utf-8 support got in along with a couple of fixes smile
Also, I have added a tool that extracts a bar-compatible palette out of your terminal colors, refer to the readme for more infos.

Offline

#8 2012-07-18 17:40:07

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: bar - Lightweight xcb-based bar

Thanks for this. I started playing with monsterwm again and I'm using bar. Is there an easy way to change the way the text gets aligned? I'm using terminus 12 and with the bar height set to 18 it's centered, but if you set it to 16 or 14 it doesn't seem to get centered properly. It looks like it keeps the bottom border space but not the top? Also, is there anyway to define more than one font? Thank you

Last edited by stlarch (2012-07-18 17:42:54)

Offline

#9 2012-07-20 08:50:26

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

stlarch wrote:

Thanks for this. I started playing with monsterwm again and I'm using bar. Is there an easy way to change the way the text gets aligned? I'm using terminus 12 and with the bar height set to 18 it's centered, but if you set it to 16 or 14 it doesn't seem to get centered properly. It looks like it keeps the bottom border space but not the top? Also, is there anyway to define more than one font? Thank you

The text is now centered properly smile
You can easily align the text by using \l \c \r (left, center, right), it's all explained in the readme.

Anyway, I've added underlining (for doing things like this) but I'm not sure it'll be useful and I didn't push it yet.

Offline

#10 2012-07-20 14:24:29

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: bar - Lightweight xcb-based bar

Thanks, I'll keep playing with it.

Offline

#11 2012-07-21 19:35:51

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: bar - Lightweight xcb-based bar

Is there an option to have the bar on the bottom of the screen?

Offline

#12 2012-07-22 10:48:19

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

hellomynameisphil wrote:

Is there an option to have the bar on the bottom of the screen?

Done smile
Also, refactored a bit some code, please test bar with different window managers (non tiling ones too) and report back.

Offline

#13 2012-07-22 11:37:17

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: bar - Lightweight xcb-based bar

Working perfectly on monsterwm! (I guess you allready knew that yourself wink )

Also, I can see you changed the -p option to behave correctly, as before the following would stay untill killed:

echo test | bar

Thank you!

Edit: Sorry, I meant you've fixed the "non -p" "option"...

Edit2: Again sorry, I see from the commit-log that the -p thing was changed 4 days ago! I guess I didn't try the echo thing when I previously updated, but only after I initially installed it and then now, so didn't knew it was fixed allready then...

Last edited by mhertz (2012-07-22 11:47:43)

Offline

#14 2012-07-22 14:23:49

nperry
Member
Registered: 2010-05-16
Posts: 86

Re: bar - Lightweight xcb-based bar

For some reason I'm having problems with bar.

Here is my config.h

/* The height of the bar (in pixels) */
#define BAR_HEIGHT  18
/* The thickness of the underline (in pixels) */
#define BAR_UNDERLINE_HEIGHT 2
/* Whether to put the bar at the screen bottom or not */
#define BAR_BOTTOM 0
/* The font used for the bar */
#define BAR_FONT "-*-terminus-medium-r-normal-*-12-*-*-*-c-*-*-1"
/* Color palette */
#define COLOR0  0x1A1A1A /* background */
#define COLOR1  0xA9A9A9 /* foreground */
#define COLOR2  0x303030
#define COLOR3  0xF92672
#define COLOR4  0xA6E22E
#define COLOR5  0xFD971F
#define COLOR6  0x66D9EF
#define COLOR7  0x9E6FFE
#define COLOR8  0xAF875F
#define COLOR9  0xCCCCC6
laptop ~ $ echo test | bar
Couldn't load the font
community/terminus-font 4.36-2 [installed]
    A superb, monospace bitmap font (for X11 and console)

Offline

#15 2012-07-22 14:41:47

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

fc-cache -rv
xset fp rehash

Xorg is silly when it comes to fonts neutral

Offline

#16 2012-07-22 14:41:57

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: bar - Lightweight xcb-based bar

@nperry, do you have this in your .xinitrc?

xset +fp /usr/share/fonts/local
xset fp rehash

too slow

Last edited by stlarch (2012-07-22 14:42:27)

Offline

#17 2012-07-22 19:07:02

hellomynameisphil
Member
From: /home/phil/Vancouver
Registered: 2009-10-02
Posts: 257
Website

Re: bar - Lightweight xcb-based bar

TheLemonMan wrote:
hellomynameisphil wrote:

Is there an option to have the bar on the bottom of the screen?

Done smile
Also, refactored a bit some code, please test bar with different window managers (non tiling ones too) and report back.

Thanks!

I tested bar in openbox and I can't get it correctly positioned on the screen. I only tried it with BAR_BOTTOM set to 1.

In xmonad it doesn't seem to start at all for me.

Works well in wmii, but the irony is that I don't need it there! :-)

Offline

#18 2012-07-22 19:34:57

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: bar - Lightweight xcb-based bar

I also tested it in dwm quicky and it also works there...

Btw, if testing with e.g. 'xinit ./dwm-- :1' so another X session starts on vt8, then you have to run the xset [....] commands again for the fonts, as else bar dosen't work as it cannot find the fonts...

Of course not a bar problem, but just a headsup to others testing this... smile

Offline

#19 2012-07-22 19:52:23

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: bar - Lightweight xcb-based bar

you can just "startx" so that your .xinitrc is picked up

Last edited by c00kiemon5ter (2012-07-22 19:52:46)


.:[ git me! ] :.

Offline

#20 2012-07-22 23:30:44

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: bar - Lightweight xcb-based bar

Ha, yes obviously smile

I was simpy reffering to if not wanting to kill your current X session...

E.g. in my example I was running monsterwm, and to help test bar, I fired up another X session with dwm on VT8, and then return back to monsterwm on VT7 afterwards(and kill VT8)...

..Actually it was also a suddel hint to others as to how other wm's could be tested without changing .xinitrc each time and without quitting your own wm...

Offline

#21 2012-07-22 23:36:04

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

Thanks for the tests, the bugs have already been ironed and waiting in my local repo.
I'll push everything once I get some new ideas for text parsing that became a mess after adding the multi font thing smile

Offline

#22 2012-07-23 08:07:02

Šaran
Member
From: Bosnia
Registered: 2011-09-03
Posts: 407

Re: bar - Lightweight xcb-based bar

This is great, I finally ditched dzen!
Just one request: Can you make it use fallback font?
I was using this with dwm for icons and it works with dunst too.

"-Misc-Stlarch-Medium-R-Normal--11-100-75-75-C-80-ISO10646-1" "," "-*-ohsnap-medium-*-*-*-14-*-*-*-*-*-*-*"

Thanks!

Offline

#23 2012-07-23 14:51:36

TheLemonMan
Member
From: Italy
Registered: 2011-09-04
Posts: 214
Website

Re: bar - Lightweight xcb-based bar

Done big_smile
Please test it as much as you can with all kind of strange fonts (remember, you *have* to use unicode fonts)

Offline

#24 2012-07-23 16:40:14

Šaran
Member
From: Bosnia
Registered: 2011-09-03
Posts: 407

Re: bar - Lightweight xcb-based bar

Works perfectly, thanks! I don't have many strange fonts for testing, but everything is fine with my usual setup.

EDIT: Would it be hard to make "overline" instead of underline?

Last edited by Šaran (2012-07-23 17:56:47)

Offline

#25 2012-07-23 20:09:15

kalle97
Member
Registered: 2012-07-18
Posts: 80

Re: bar - Lightweight xcb-based bar

I got a question, does it work like a taskbar? I got a few apps which got these small icons that appear at the indecator area of GNOME's bar, and I'm using monsterwm now and wanna be able to view those.

Offline

Board footer

Powered by FluxBB