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 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 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.2.0 --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**. An upcoming change will replace all occurences of colon's with dashes in the parameter names. 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 ~~~ ### 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-BARNAME_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: ;