Lemonbar

lemonbar is a lightweight bar based on XCB. It provides foreground/background color switching along with text alignment and colored under/overlining of text, full UTF-8 support and reduced memory footprint. Nothing less and nothing more.

Installation

Install the lemonbar-gitAUR package.

Configuration

Configuration of lemonbar is now completely done via screenrc-like format strings and command line options as opposed to older versions, where configuration took place at compile-time.

See lemonbar(1) for a short overview of those configuration options.

Usage

lemonbar prints no information on its own. To get any text into lemonbar you need to pipe text into it. The following example would write the text "Hello World" into your bar.

#!/bin/sh

# Echo the text
echo "Hello World"

If you want the text in lemonbar to update through a script, you need to add the -p option. This prevents lemonbar from exiting after stdin is closed.

Colors

lemonbar uses the following commands to color the text, background or the under/overline. Colors can be specified via the formats #RRGGBB, #AARRGGBB (with an alpha channel; this requires a compositor to be running), or even #RGB.

The special color - indicates the default color (which is set by command-line flags, or is otherwise the default white text on a black background).

CommandMeaning
%{Fcolor} Use color as the foreground/font color
%{Bcolor} Use color as the background
Use color for under/overlining the text

Text alignment

lemonbar also supports alignment of text. It uses the following commands to align the text

CommandMeaning
%{l} Aligns the text to the left
Aligns the text to the center
%{r} Aligns the text to the right

Examples

The following example prints the date and time in the middle of the bar, the font's color being yellow and the background and changes the font/background color back to the default color afterwards. Run it with

Another example showing the battery percentage. To use this script you need to install .

XFT fonts

The default lemonbar version does not support XFT fonts. To get support for XFT fonts, you need to install , which replaces lemonbar-gitAUR.

To use different font with lemonbar, you need to pass option when starting lemonbar e.g. .

Font Awesome icons

With XFT support, you can also add font-awesome icons to your bar. You need to install before using the icons and pass -f 'Font Awesome 5 Free' -f 'Font Awesome 5 Brands' -f 'Font Awesome 5 Free Solid' (or the appropriate version instead of '5') to lemonbar. Please note, that you also need to specify one more font (e.g. ) to be used for other symbols than font awesome icons if you want something else visible in your lemonbar as font awesome does not contain other symbols.

Before adding an icon to lemonbar, you need to look up its unicode id on the icon list and pass it to lemonbar string. Here is a script that displays icon with Unicode id in lemonbar:

Pay extra attention to flag, as it is necessary to properly use echo with escape sequences.

And corresponding lemonbar command:

gollark: Also, they just announced that Ryzen 3000 is to be released on July 7th. Not next month. It's, what, 6 weeks?
gollark: The 1700 is only about £130 now.
gollark: The prices for 1st gen Ryzen and B450 boards are already stupidly low.
gollark: It's better to actually look at the specs they give for total write endurance.
gollark: I'm fine with QLC for desktop stuff but if I'm buying an SSD for my home server it'll probably be TLC.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.