Lemonbuddy ========== [![Build Status](https://travis-ci.org/jaagr/lemonbuddy.svg?branch=master)](https://travis-ci.org/jaagr/lemonbuddy) 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 hasn't been tested, other then by myself, so bugs and various bumps is to be expected. Please report any issues here on github. Here's a screenshot showing you an example of what it could look like: [![bspwm workspace](http://i.imgur.com/xvlw9iHh.png)](http://i.imgur.com/xvlw9iH.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 A package will be written for XBPS so stay tuned. ### Dependencies: A C++ compiler with C++14 support. For example `clang`. - lemonbar - cmake - boost - libx11 - libxrandr - wireless_tools _(optional: used by the network module)_ - alsa-lib _(optional: used by the volume module)_ - libmpdclient _(optional: used by the mpd module)_ - libsigc++ _(optional: used by the i3 module)_ > **NOTE:** The application has only been tested against the `single-mon` fork. > If you have trouble running it with your current version, install the one > included in `contrib/lemonbar-sm-git`. > Plans are to make `lemonbar` an internal module. **Install dependencies using pacman:** ~~~ sh $ sudo pacman -S cmake boost libx11 libxrandr wireless_tools alsa-lib libmpdclient libsigc++ $ yaourt ttf-font-awesome ~~~ **Install dependencies using xbps-install:** ~~~ sh $ sudo xbps-install cmake alsa-lib-devel boost-devel i3-devel libX11-devel libXrandr-devel libmpdclient-devel libsigc++-devel wireless_tools-devel $ sudo xbps-install font-awesome ~~~ **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` `fonts-font-awesome` ~~~ sh $ sudo apt-get install cmake libxrandr-dev libboost-dev libiw-dev libasound2-dev libmpdclient-dev libsigc++-2.0-dev $ sudo apt-get install fonts-font-awesome ~~~ ### Building from source > **NOTE:** In Void Linux you will need to install `git-perl` to get support for submodules. ~~~ sh $ git clone --branch 0.1.4 --recursive https://github.com/jaagr/lemonbuddy.git $ mkdir lemonbuddy/build $ cd lemonbuddy/build $ cmake .. # Optionally list and edit build settings before compiling # $ make edit_cache $ sudo make install ~~~ ## 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.sh 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.sh` when launching the bars. `lemonbuddy_wrapper.sh` 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.sh` 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. For example in `$HOME/.config/bspwmrc`: ~~~ sh # Terminate already running bar instances pgrep -f '(lemonbuddy_wrapper.sh|^lemonb(uddy|ar))' | xargs kill -9 >/dev/null 2>&1 # Launch bar1 and bar2 lemonbuddy_wrapper.sh bar1 & lemonbuddy_wrapper.sh bar2 & echo "Bars launched..." ~~~ ## Configuration The configuration syntax is very much **WIP**. If you have any feedback or suggestions, please [create an issue ticket](https://github.com/jaagr/lemonbuddy/issues). 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. `🟊 = 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 ~~~ ### 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: ;