bugtpb -- ThinkPad Buttons - Bugs: bug #18415, [PATCH] Adjust number of bars in...


bug #18415: [PATCH] Adjust number of bars in XOSD percentagebars

Submitted by:  None
Submitted on:  Wed 29 Nov 2006 09:39:11 PM UTC  
Votes:  100  
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 29 Nov 2006 09:39:11 PM UTC, original submission:

I've made a patch against 0.6.4 to adjust number of the small bars in xosd percentagebar to reflect real number of levels. This aplies for volume, [un]mute and brightness.
So it sets 14 bars for volume (as it has 15 levels) and 7 bars for brightness, as it has 8 levels.

At compile time it checks for sufficient version of libxosd, otherwise it is disabled.

It also introduces the +1 hack - i've found out that libxosd count number of bars to display as floor(percent/100 * maxbars) or something silimar, but tpb counts it rounded. For example if the brightness is on level 1 of 7 (starting with 0), tpb counts the percentage as (brightnes_level * 100 / 7), which is 14,2857%... - but when xosd is set to display max 7 bars, it needs at least 15% to display one active bar, othervise it displays 0 active bars.
So this patch changes the call to xosd_display to (brightnes_level * 100 / 7 + 1), which should not hurt. Better way would be to count it as ceil(brightness_level * 100 / 7), but i think we could let it ugly, instead of including math.h.

This patch looks nice, if you set big XOSD font, such as:
OSDFONT -bitstream-bitstream vera sans mono-bold-r-normal--30-*-75-75-*-*-iso8859-1

Thanks for this great piece of software, hope this could be merged.

patch with -p1 in tpb's directory.

Matej Laitl - strohel (aT) gmail.com



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #11407:  tpb-0.6.4-xosd-percentagebar.diff added by None (2KiB - text/x-diff)


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 100 encouragements so far.

Only logged-in users can vote.


Please enter the title of George Orwell's famous dystopian book (it's a date):



Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-11-29 strohel Carbon-Copy- => Added strohel
2006-11-29 None Attached File- => Added tpb-0.6.4-xosd-percentagebar.diff, #11407

Back to the top

Powered by Savane 3.3