Code Monkey home page Code Monkey logo

bar's Introduction

NAME

lemonbar - Featherweight lemon-scented bar

SYNOPSIS

lemonbar [-h | -g widthxheight+x+y | -b | -d | -f font | -p | -n name | -u pixel | -B color | -F color | -U color | -o offset ]

DESCRIPTION

lemonbar (formerly known as bar) is a lightweight bar entirely based on XCB. Provides full UTF-8 support, basic formatting, RandR and Xinerama support and EWMH compliance without wasting your precious memory.

OPTIONS

-h

Display the help and exit.

-g widthxheight+x+y

Set the window geometry. If a parameter is omitted it's filled with the default value. If the y parameter is specified along with the -b switch then the position is relative to the bottom of the screen.

-b

Dock the bar at the bottom of the screen.

-d

Force docking without asking the window manager. This is needed if the window manager isn't EWMH compliant.

-f font

Define the font to load into one of the five slots (the number of slots is hardcoded and can be tweaked by changing the MAX_FONT_COUNT parameter in the source code). This version supports fontconfig font specifiers and anti-aliased fonts.

-a number

Set number of clickable areas (default is 10)

-p

Make the bar permanent, don't exit after the standard input is closed.

-n name

Set the WM_NAME atom value for the bar.

-u pixel

Sets the underline width in pixels. The default is 1.

-B color

Set the background color of the bar. color must be specified in the hex format (#aarrggbb, #rrggbb, #rgb). If no compositor such as compton or xcompmgr is running the alpha channel is silently ignored.

-F color

Set the foreground color of the bar. Accepts the same color formats as -B.

-o offset

Add a vertical offset to the text. offset must be a number and can be negative. -o -3 will push the text 3 pixels up.

-U color

Set the underline color of the bar. Accepts the same color formats as -B.

FORMATTING

lemonbar provides a screenrc-inspired formatting syntax to allow full customization at runtime. Every formatting block is opened with %{ and closed by } and accepts the following commands, the parser tries it's best to handle malformed input. Use %% to get a literal percent sign (%).

R

Swap the current background and foreground colors.

l

Aligns the following text to the left side of the screen.

c

Aligns the following text to the center of the screen.

r

Aligns the following text to the right side of the screen.

Owidth

Offset the current position by width pixels in the alignment direction.

Bcolor

Set the text background color. The parameter color can be - or a color in one of the formats mentioned before. The special value - resets the color to the default one.

Fcolor

Set the text foreground color. The parameter color can be - or a color in one of the formats mentioned before. The special value - resets the color to the default one.

Tindex

Set the font used to draw the following text. The parameter index can either be - or the 1-based index of the slot which contains the desired font. If the parameter is - lemonbar resets to the normal behavior (matching the first font that can be used for the character). If the selected font can't be used to draw a character, lemonbar will fall back to normal behavior for that character

Ucolor

Set the text underline color. The parameter color can be - or a color in one of the formats mentioned before. The special value - resets the color to the default one.

Abutton:command:

Create a clickable area starting from the current position, when the area is clicked command is printed on stdout. The area is closed when a A token, not followed by : is encountered.

Eg. %{A:reboot:} Click here to reboot %{A}

The button field is optional, it defaults to the left button, and it's a number ranging from 1 to 5 which maps to the left, middle, right, scroll up and scroll down movements. Your mileage may vary.

Nested clickable areas can trigger different commands.

Eg. %{A:reboot:}%{A3:halt:} Left click to reboot, right click to shutdown %{A}%{A}

Sdir

Change the monitor the bar is rendered to. dir can be either

+/-

Next/previous monitor.

f/l

First/last monitor.

0-9

Nth monitor.

Attribute modifiers

+attribute

Set the attribute attribute for the following text.

-attribute

Unset the attribute attribute for the following text.

!attribute

Toggle the attribute attribute for the following text.

Where attribute is one of the following

o

Draw a line over the text.

u

Draw a line under the text.

OUTPUT

Clicking on an area makes lemonbar output the command to stdout, followed by a newline, allowing the user to pipe it into a script, execute it or simply ignore it. Simple and powerful, that's it.

WWW

git repository

AUTHOR

2012-2015 (C) The Lemon Man

Xinerama support was kindly contributed by Stebalien

RandR support was kindly contributed by jvvv

Clickable areas support was heavily based off u-ra contribution

bar's People

Contributors

adamniederer avatar andornaut avatar baskerville avatar bill-kolokithas avatar boblehest avatar c00kiemon5ter avatar chadvoegele avatar delusionallogic avatar flannelhead avatar graboy avatar jeromebon avatar jvvv avatar kainonergon avatar krypt-n avatar lemonboy avatar neeasade avatar ntrrgc avatar numeromancer avatar otommod avatar rootcoma avatar sector-f avatar sprocklem avatar stebalien avatar tryone144 avatar vyp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bar's Issues

Faraway unicode symbols (☢,⚙, …) not displayed.

When I enter this:
echo "☢☢☢" | lemonbar -f "hack:size=8" -p
It shows nothing. My font (hack) has the glyph.

Is it something related to multibyte utf8?

I opened a new issue on your fork as I suspect it is associated with XFT. If, not, I'll report it in the original repo too.

Foreground transparency

It was mentioned in issue #6, but the foreground transparency (font transparency) is broken in this fork.
Transparency in lemonbar-xdg:
lemonbar-xcb
Versus transparency in base lemonbar:
lemonbar

(It is worth noting that lemonbar-xdg does correctly recognise the #RRGGBB value from a #AARRGGBB, theyre just different in those screenshots).

Fontconfig never reports failure - with workable solution.

So I emerged lemonbar-xft, and attempted to try out the last example on the arch linux lemonbar page:

https://wiki.archlinux.org/index.php/lemonbar#Font_Awesome_icons

Unfortunately, for some reason it's not working - the Font Awesome glyph won't display - and lemonbar-xft doesn't report failure or give me any information to help me debug this problem. Looking around the lemonbar-xft issues tracker, I found a link to this page, which explains why:

http://www.freedesktop.org/software/fontconfig/fontconfig-user.html

Fontconfig never fails to select a font, it always just selects a closest match. So fontconfig will never return an error if it can't give you the font you want. On the surface, this is pretty terrible behavior. Luckily, there's an easy fix. Every time lemonbar-xft loads a font, it should report the name of the font it loads on STDERR. Then, in sort of an inversion of the usual pattern on unix, not reporting anything on STDERR while attempting to load a font would ALWAYS indicate an error, whereas reporting something on STDERR while attempting to load a font COULD be an error (user error or program error) depending on whether the user got the font they want.

It might be a little weird, but I think this is the only real solution. Because failing to give the user their preferred font and also not giving them any sort of explanation at all is really unacceptable. The linked document seems to say that the environment variable FC_DEBUG controls this behavior, but unfortunately I can't seem to pass this variable to fontconfig via lemonbar-xft by way of the commandline. It seems like lemonbar-xft should set this to something sensible by default (like 1 or 2 perhaps), and also make it configurable with a verbosity switch, and also allow the internal variable to be set directly by passing a commandline variable.

Weird hinting problem for block characters

I try to display a progressbar using █ characters like this: ███(change color)███.

However, it's rendered weird no matter what font or size I use:

2015-06-03-200456_456x114_escrotum

Note how it works in urxvt properly, while it's rendered with blue tint in lemonbar. Here's my font config:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="font" >
        <edit mode="assign" name="rgba" >
            <const>rgb</const>
        </edit>
    </match>
    <match target="font" >
        <edit mode="assign" name="hinting" >
            <bool>true</bool>
        </edit>
    </match>
    <match target="font" >
        <edit mode="assign" name="hintstyle" >
            <const>hintslight</const>
        </edit>
    </match>
    <match target="font" >
        <edit mode="assign" name="antialias" >
            <bool>true</bool>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="lcdfilter">
            <const>lcddefault</const>
        </edit>
    </match>

    <!-- Reject bitmap fonts -->
    <selectfont>
        <rejectfont>
            <pattern>
                <patelt name="scalable"><bool>false</bool></patelt>
            </pattern>
        </rejectfont>
    </selectfont>
</fontconfig>

Cannot display some special characters

For some reason I cannot display characters with hex code point greater than FFFF, instead a "?" glyph (clearly fallback) is printed on the bar, is this possible?

Documenting xft options

I think it would be good to document xft related options, like how to pass fonts in xft form or how to turn on antialiasing. I had to google the former from other places, and still have no idea how to do latter.

Color alpha

I could be doing something wrong when I build, but this branch appears to only read RRGGBB colors instead of RRGGBBAA like the master.

I'm on Arch Linux x86_64, Linux 3.16.4-1-ARCH, and built with gcc 4.9.1 20140903.

Otherwise, I would like to give my deepest thanks for this port— I have been missing my xft fonts in my statusbar.

Kerning issues?

1442779235

Here is an example of the same font (TeX Gyre Heros) rendered in a Firefox tab and in lemonbar (top). You can see that in Firefox (and its GTK menus), kerning has been applied to close the gap between the "T" and "w" which is not present in lemonbar. I'm using the infinality-bundle package for Arch Linux to handle my font rendering. I'm not really sure what's responsible for the discrepancy but I thought I should make a post in case there's a bug with the xft patch.

Scroll buttons are unresponsive, A4 and A5

Bound actions to buttons A1-3 are as expected but A4 and A5 are unresponsive, xev returns A4 and A5 button presses as expected. Tested with synaptics touch pad, logitech g300 and g402.

Why not merge ucs4?

The branch seems to work great and reduce SLOC, why not merge it? It's running for me quite well and other people also seem to be using it without issues.

Xlib-xcb dependency

make fails with this error:

/bar>make
cc -Wall -std=c99 -Os -DVERSION="\"020a3e1\"" -I/usr/include/freetype2 -o lemonbar.o -c lemonbar.c
lemonbar.c:19:26: fatal error: X11/Xlib-xcb.h: No such file or directory
 #include <X11/Xlib-xcb.h>
                          ^
compilation terminated.
make: *** [lemonbar.o] Error 1

Lemonbar is already installed, so what additional dependencies does this fork need?

Last commit broke Lemonbar

It skips pieces of data I send in, so sometimes I see nothing, or only parts of the bar I wanted to see... So in the end I solved by recompiling an older revision.

"Invalid geometry for the clickable area" error

Hello,

I'm using i3 on Ubuntu and recently, I tried the lemonbar status bar (with the xft version). But when I run my script, I get the error "Invalid geometry for the clickable area".

Here is the command I use to run the script:

$HOME/.config/i3/lemonbarshow.sh | lemonbar -a 33 -B "#3B4252" -F "#E5E9F0" -f "Liberation Mono for Powerline-11" -g x18 -p | sh
(The script)

It seems to dysfunction due to some lemonbar-xft problem, because, when I use the normal xft package, it works perfectly (except for the fonts)

When I run the command with the lemonbar-xft command, i get this

Do you know how I could solve my problem?

Thank you for your answer!

Action-Area Not Working

Hey.
I try to use the actions for a section in the bar. But unfortunately I can't get it work.
A minimal example would be the following: echo "%{A1:notify-send 'Test'} Test %{A}" | lemonbar -p.
When I click: nothing. What am I doing wrong?

Icon fonts not loading on latest AUR version

Hey just upgraded lemonbar-xft-git - Now fonts don't load as they used to.
Before the upgrade loading fonts like this worked, but not anymore.

lemonbar -p -f "Oxygen Mono-15","Icons-17","FontAwesome-17"

I tried reading the code but couldn't find anything after a quick glance, did I miss something or is this a new bug?

The following would usually output hi with a speaker icon:

echo "hi" | lemonbar -p -f "Oxygen Mono-15","Icons-17","FontAwesome-17"

EDIT: Added example with glyph

Latest build only rendering one font

Default amount of fonts allowed is 5, correct? saw that it was set to that in source. If I have my font set as "Dejavu Sans-8,FontAwesome-8", only the Dejavu text renders, and if I set my font as "FontAwesome-8", the icons render fine( though no text of course ). This is as of a pull of the lemonbar-xft-git aur package today.

State of this Repo

Hey folks,

this repository has been dead for ages and I stopped using lemonbar some years ago. The code only works by accident and the approach is questionable at best.

While I think that it's great that so many people found some use in my attempt at making this work, I recommend using a different statusbar implementation or implementing this again from scratch on top of a newer lemonbar version.

Ability to specify `-o` for each font separately

While I'd like to use a Powerline font for the cool triangles, I'd like to be able to use regular (unpatched) font for the text. Since these fonts have very different baselines, it would make sense to make -o able to handle them separately.

Glyphs overlapping (Sauce Code Powerline)

This is what it looks like:
img

I specify the font with

-f "Source Code Pro for Powerline-9"

other sizes are no better.

The same font looks alright in urxvt though:

img

*font: xft:Source Code Pro For Powerline:pixelsize=10
URxvt*.letterSpace: -2

maybe I can specify letterSpace for bar-aint-recursive too somehow?

segfault backround & foreground color

im getting a segfault when i set the background or the foreground

gdb output:

Program received signal SIGSEGV, Segmentation fault.
parse_color (str=0x7fffffffdcc3 "#222222", end=end@entry=0x0, def=16777215)
at bar.c:293
293 ptrdiff_t len = *end - str;

Formatting does not seem to work

The latest version (pulled yesterday) does not seem to support formatting. The problem seems to be that % isn't caught (As I don't have to use %% to get a literal percent sign as the man page states you should).

It should be reproduce-able with this command:
echo "test" | lemonbar %{c} -g 2550x14 -B #ff00ff -F #FFFFFF -p

The %{c} should center the text, however it does not seem to do that.

bar above fullscreen windows

Using the original lemonbar repository, a bar launched with -n BAR_NAME can be rendered below fullscreen windows using xdo below -t $(xdo id -n root) $(xdo id -a BAR_NAME).

Unfortunately, this doesn't seem to work with this fork.

Do you have any idea how to fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.