###### Did the bar stop working after your last update? [Read this](https://github.com/jaagr/lemonbuddy/wiki/pre-1.0:-Patching-your-configuration-file) to find out how to patch your config! --- Lemonbuddy ========== [![Build Status](https://travis-ci.org/jaagr/lemonbuddy.svg?branch=master)](https://travis-ci.org/jaagr/lemonbuddy) [![MIT License](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000?style=plastic)](https://github.com/jaagr/lemonbuddy/blob/master/LICENSE) A fast and easy-to-use tool for [Lemonbar](https://github.com/LemonBoy/bar/). **Lemonbuddy** aims to help users build beautiful and highly customizable status bars without messing with named pipes, MacGyver-like scripting or non-blocking loops lobotomizing your CPU. Please note that the project is still in early development, so please report any anomalies by [creating an issue ticket](https://github.com/jaagr/lemonbuddy/issues) here on GitHub. I welcome pull requests with fixes or improvements. Here are two screenshots showing you what it could look like (make sure to view them in full scale): [![bspwm workspace](http://i.imgur.com/xvlw9iHm.png)](http://i.imgur.com/xvlw9iH.png) [![dracula workspace](http://i.imgur.com/cYQOuRrm.png)](http://i.imgur.com/cYQOuRr.png) ## Installation #### Arch Linux Install the AUR package [lemonbuddy-git](https://aur.archlinux.org/packages/lemonbuddy-git/) to get the latest version, or [lemonbuddy](https://aur.archlinux.org/packages/lemonbuddy/) for the latest stable release. #### Void Linux Install the XBPS package [lemonbuddy](https://raw.githubusercontent.com/jaagr/void-packages/lemonbuddy/srcpkgs/lemonbuddy/template) for the latest stable release. ### Building from source ~~~ sh $ git clone --branch 1.3.2 --recursive https://github.com/jaagr/lemonbuddy $ mkdir lemonbuddy/build $ cd lemonbuddy/build $ cmake .. $ sudo make install ~~~ ### Dependencies: A C++ compiler with C++14 support. For example `clang`. - lemonbar (patched with xft support) - cmake - boost - libxcb - xcb-proto ##### Optional dependencies: - wireless_tools _(required to build the network module)_ - alsa-lib _(required to build the volume module)_ - libmpdclient _(required to build the mpd module)_ - libsigc++ _(required to build the i3 module)_ ##### Install dependencies using pacman: ~~~ sh $ sudo pacman -S cmake boost libxcb wireless_tools alsa-lib libmpdclient libsigc++ ~~~ ##### Install dependencies using xbps-install: ~~~ sh $ sudo xbps-install cmake boost-devel libxcb-devel xcb-proto alsa-lib-devel i3-devel libmpdclient-devel libsigc++-devel wireless_tools-devel ~~~ ##### Install dependencies using apt-get: > **NOTE:** To get support for the mpd and i3 modules, the `universe` repository > needs to be added to the list of sources in `/etc/apt/sources.list`. > > Packages in the `universe` repository: `libmpdclient-dev` ~~~ sh $ sudo apt-get install cmake libxcb1-dev xcb-proto python-xcbgen libboost-dev libiw-dev libasound2-dev libmpdclient-dev libsigc++-2.0-dev ~~~ ## Running Before customizing the bar, make sure everything works as expected by trying out one of the example configurations installed with the application. The following code will get you started: ~~~ sh # Create the config root directory $ mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/lemonbuddy $ cd ${XDG_CONFIG_HOME:-$HOME/.config}/lemonbuddy # Copy sample config for the running wm (uses a wm agnostic config as fallback) $ __wm=$(pgrep -l -x "(bspwm|i3)"); __prefix=$(which lemonbuddy) $ cp "${__prefix%%/bin*}/share/examples/lemonbuddy/config${__wm:+.${__wm##* }}" config # Launch the bar # (where "example" is the name of the bar as defined by [bar/NAME] in the config) $ lemonbuddy_wrapper example ~~~ > **NOTE:** If you are running i3 or bspwm and you don't see the workspace icons > it probably depends on the font. Install `font-awesome` and relaunch the bar. > ...or replace the icons in the config. **It is recommended** to always use `lemonbuddy_wrapper` when launching the bars. `lemonbuddy_wrapper` is just a simple shell script that takes care of redirecting the in-/output streams between `lemonbuddy` and `lemonbar`. If you handle the in-/output stream redirection's manually, the internal command handlers (e.g. mpd or volume controls) might stop working. It won't change the output of the bar but you will miss out on the internal API calls, which is one of the main advantages of using the application. The `lemonbuddy_wrapper` will be deprecated once `lemonbar` is integrated into the project. ## Launching the bar in your wm's bootstrap routine When using the wrapper to start the bar in in your wm's autostart routine, make sure to include a kill directive before launching the bar. This is done to make sure that any previously spawned processes gets terminated before before we launch the new ones. Create an executable file containing the startup logic, for example `$HOME/.config/lemonbuddy/launch.sh`: ~~~ sh #!/usr/bin/env sh # Terminate already running bar instances lemonbuddy_terminate noconfirm # Launch bar1 and bar2 lemonbuddy_wrapper bar1 & lemonbuddy_wrapper bar2 & echo "Bars launched..." ~~~ If you are using **bspwm**, add the following line to `bspwmrc`: ~~~ sh $HOME/.config/lemonbuddy/launch.sh ~~~ If you are using **i3**, add the following line to your configuration: ~~~ sh exec_always $HOME/.config/lemonbuddy/launch.sh ~~~ Remember to make it executable using: ~~~ sh $ chmod +x $HOME/.config/lemonbuddy/launch.sh ~~~ ## Configuration The configuration syntax is very much **WIP**. If you have any feedback or suggestions on how to improve it, please [create an issue ticket](https://github.com/jaagr/lemonbuddy/issues), or a pull request. When working with unicode symbols, remember that fonts render them differently. Changing font can change the quality of your generated output drastically. One must-have font is [Unifont](http://unifoundry.com/unifont.html), which has great unicode coverage. Also try different icon fonts, such as [Font Awesome](http://fontawesome.io/icons/) and [Material Icons](https://design.google.com/icons/). The values used in the examples below are to be considered placeholder values, and the resulting output might not be award-winning. ### Syntax and DSL The configuration syntax is based on the `ini` file format. ~~~ ini [section/name] str = My string ; Hint: Quote the value to keep the spaces str = " My string" bool = true bool = on int = 10 float = 10.0 ; Values for a defined bar can be referenced using: key = ${bar/top.foreground} ; Values for the current bar can be referenced using: key = ${BAR.foreground} ; Other values can be referenced using: key = ${section.key} ;format[-NAME] = "" ;format[-NAME]-spacing = N (unit: whitespaces) ;format[-NAME]-padding = N (unit: whitespaces) ;format[-NAME]-margin = N (unit: whitespaces) ;format[-NAME]-offset = N (unit: pixels) ;format[-NAME]-foreground = #aarrggbb ;format[-NAME]-background = #aarrggbb ;format[-NAME]-underline = #aarrggbb ;format[-NAME]-overline = #aarrggbb ; ;label-NAME[-(foreground|background|(under|over)line|font|padding)] = ? ;icon-NAME[-(foreground|background|(under|over)line|font|padding)] = ? ;ramp-NAME-[0-9]+[-(foreground|background|(under|over)line|font|padding)] = ? ;animation-NAME-[0-9]+[-(foreground|background|(under|over)line|font|padding)] = ? ; ;bar-NAME-width = N (unit: characters) ;bar-NAME-format = (tokens: %fill% %indicator% %empty%) ;bar-NAME-foreground-[0-9]+ = #aarrggbb ;bar-NAME-indicator[-(foreground|background|(under|over)line|font|padding)] = ;bar-NAME-fill[-(foreground|background|(under|over)line|font|padding)] = ;bar-NAME-empty[-(foreground|background|(under|over)line|font|padding)] = ~~~ `🟊 = module is still flagged as work in progress` ### Application settings ~~~ ini [settings] ; Limit the amount of events sent to lemonbar within a set timeframe: ; - "Allow updates within of time" ; Default values: ;throttle_limit = 5 ;throttle_ms = 50 ~~~ ### Bar settings ~~~ ini [bar/example] ; Use the following command to list available outputs: ; $ xrandr -q | grep " connected" | cut -d ' ' -f1 monitor = HDMI1 ; Omit the % to specify the width in pixels width = 100% height = 30 ; Offset value defined in pixels ;offset_x = 0 ;offset_y = 0 ; Put the bar at the bottom of the screen bottom = true ; Weather to force docking mode or not dock = false ; This value is used as a multiplier when adding spaces between elements spacing = 3 ; Height of under-/overline lineheight = 14 ; Colors background = #222222 foreground = #eefafafa linecolor = ${bar/example.background} ; Amount of spaces to add at the start/end of the whole bar padding_left = 5 padding_right = 2 ; Amount of spaces to add before/after each module module_margin_left = 3 module_margin_right = 3 ; Fonts are defined using: ; font-0 = NotoSans-Regular:size=8;0 font-1 = MaterialIcons:size=10;0 font-2 = Termsynu:size=8;-1 font-3 = FontAwesome:size=10;0 ; The separator will be inserted between the output of each module ;separator = | ; This value is used by Lemonbar and it specifies the clickable ; areas available -> %{A:action:}...%{A} clickareas = 30 ; Value to be used to set the WM_NAME atom ; This defaults to "lemonbuddy-[BAR]_[MONITOR]" ;wm_name = mybar ; Locale used to localize module output (for example date) ;locale = sv_SE.UTF-8 ; Define what modules to output modules-left = cpu ram modules-center = label modules-right = clock ~~~ ### Module `internal/backlight` ~~~ ini [module/backlight] type = internal/backlight ; Use the following command to list available cards: ; $ ls -1 /sys/class/backlight/ card = intel_backlight ~~~ ##### Extra formatting (example) ~~~ ini ; Available tags: ;