├── .gitignore ├── .travis.yml ├── LICENSE ├── Makefile ├── README.pod ├── example.sh └── lemonbar.c /.gitignore: -------------------------------------------------------------------------------- 1 | lemonbar 2 | *.o 3 | *.swp 4 | *~ 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | compiler: 3 | - clang 4 | - gcc 5 | before_install: 6 | - sudo apt-get update -qq 7 | - sudo apt-get install -y libx11-xcb-dev libxcb-randr0-dev libxcb-xinerama0-dev 8 | env: 9 | - CFLAGS='-DWITH_XINERAMA=1' 10 | script: make 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 The Lemon Man 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # This snippet has been shmelessly stol^Hborrowed from thestinger's repose Makefile 2 | VERSION = 1.1 3 | GIT_DESC=$(shell test -d .git && git describe --always 2>/dev/null) 4 | 5 | ifneq "$(GIT_DESC)" "" 6 | VERSION=$(GIT_DESC) 7 | endif 8 | 9 | CC ?= gcc 10 | CFLAGS += -Wall -std=c99 -Os -DVERSION="\"$(VERSION)\"" -I/usr/include/freetype2 11 | LDFLAGS += -lxcb -lxcb-randr -lX11 -lX11-xcb -lXft -lfreetype -lz -lfontconfig 12 | CFDEBUG = -g3 -pedantic -Wall -Wunused-parameter -Wlong-long \ 13 | -Wsign-conversion -Wconversion -Wimplicit-function-declaration 14 | 15 | EXEC = lemonbar 16 | SRCS = lemonbar.c 17 | OBJS = ${SRCS:.c=.o} 18 | 19 | PREFIX?=/usr 20 | BINDIR=${PREFIX}/bin 21 | 22 | all: ${EXEC} 23 | 24 | doc: README.pod 25 | pod2man --section=1 --center="lemonbar Manual" --name "lemonbar" --release="lemonbar $(VERSION)" README.pod > lemonbar.1 26 | 27 | .c.o: 28 | ${CC} ${CFLAGS} -o $@ -c $< 29 | 30 | ${EXEC}: ${OBJS} 31 | ${CC} -o ${EXEC} ${OBJS} ${LDFLAGS} 32 | 33 | debug: ${EXEC} 34 | debug: CC += ${CFDEBUG} 35 | 36 | clean: 37 | rm -f ./*.o ./*.1 38 | rm -f ./${EXEC} 39 | 40 | install: lemonbar doc 41 | install -D -m 755 lemonbar ${DESTDIR}${BINDIR}/lemonbar 42 | install -D -m 644 lemonbar.1 ${DESTDIR}${PREFIX}/share/man/man1/lemonbar.1 43 | 44 | uninstall: 45 | rm -f ${DESTDIR}${BINDIR}/lemonbar 46 | rm -f $(DESTDIR)$(PREFIX)/share/man/man1/lemonbar.1 47 | 48 | .PHONY: all debug clean install 49 | -------------------------------------------------------------------------------- /README.pod: -------------------------------------------------------------------------------- 1 | =head1 NAME 2 | 3 | lemonbar - Featherweight lemon-scented bar 4 | 5 | This fork is based on lemonbar-xft and adds the ability to select the xrandr monitor the bar should appear on. 6 | Hence, the executable always renders only a single panel, unlike upstream, where a single executable can display multiple panels. 7 | 8 | As of 2016-01-15 also available in AUR: https://aur.archlinux.org/packages/lemonbar-sm-git/ 9 | 10 | =head1 SYNOPSIS 11 | 12 | I [-h | -g IBIB<+>IB<+>I | -b | -d | -f I | -p | -n I | -u I | -B I | -F I | -U I | -o I ] MONITOR 13 | 14 | =head1 DESCRIPTION 15 | 16 | B (formerly known as B) is a lightweight bar entirely based on XCB. Provides full UTF-8 support, basic formatting, RandR support and EWMH compliance without wasting your precious memory. 17 | 18 | Monitor name can be determined using e.g. I 19 | 20 | =head1 OPTIONS 21 | 22 | =over 23 | 24 | =item B<-h> 25 | 26 | Display the help and exit. 27 | 28 | =item B<-g> IBIB<+>IB<+>I 29 | 30 | Set the window geometry. If a parameter is omitted it's filled with the default value. If the I parameter is specified along with the B<-b> switch then the position is relative to the bottom of the screen. The offsets are always relative to the selected monitor's upper left corner. 31 | 32 | =item B<-b> 33 | 34 | Dock the bar at the bottom of the screen. 35 | 36 | =item B<-d> 37 | 38 | Force docking without asking the window manager. This is needed if the window manager isn't EWMH compliant. 39 | 40 | =item B<-f> I 41 | 42 | Define the font to load into one of the five slots (the number of slots is hardcoded and can be tweaked by 43 | changing the MAX_FONT_COUNT parameter in the source code). This version supports fontconfig font specifiers and anti-aliased fonts. 44 | 45 | =item B<-a> I 46 | 47 | Set number of clickable areas (default is 10) 48 | 49 | =item B<-p> 50 | 51 | Make the bar permanent, don't exit after the standard input is closed. 52 | 53 | =item B<-n> I 54 | 55 | Set the WM_NAME atom value for the bar. 56 | 57 | =item B<-u> I 58 | 59 | Sets the underline width in pixels. The default is 1. 60 | 61 | =item B<-B> I 62 | 63 | Set the background color of the bar. I 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. 64 | 65 | =item B<-F> I 66 | 67 | Set the foreground color of the bar. Accepts the same color formats as B<-B>. 68 | 69 | =item B<-o> I 70 | 71 | Add a vertical offset to the text. I must be a number and can be negative. I<-o -3> will push the text 3 pixels up. 72 | 73 | =item B<-U> I 74 | 75 | Set the underline color of the bar. Accepts the same color formats as B<-B>. 76 | 77 | =back 78 | 79 | =head1 FORMATTING 80 | 81 | lemonbar provides a screenrc-inspired formatting syntax to allow full customization at runtime. Every formatting block is opened with C<%{> and closed by C<}> and accepts the following commands, the parser tries it's best to handle malformed input. Use C<%%> to get a literal percent sign (C<%>). 82 | 83 | =over 84 | 85 | =item B 86 | 87 | Swap the current background and foreground colors. 88 | 89 | =item B 90 | 91 | Aligns the following text to the left side of the screen. 92 | 93 | =item B 94 | 95 | Aligns the following text to the center of the screen. 96 | 97 | =item B 98 | 99 | Aligns the following text to the right side of the screen. 100 | 101 | =item BI 102 | 103 | Offset the current position by I pixels in the alignment direction. 104 | 105 | =item BI 106 | 107 | Set the text background color. The parameter I can be I<-> or a color in one of the formats mentioned before. The special value I<-> resets the color to the default one. 108 | 109 | =item BI 110 | 111 | Set the text foreground color. The parameter I can be I<-> or a color in one of the formats mentioned before. The special value I<-> resets the color to the default one. 112 | 113 | =item BI 114 | 115 | Set the font used to draw the following text. The parameter I can either be I<-> or the 1-based index of the slot which contains the desired font. If the parameter is I<-> 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 116 | 117 | =item BI 118 | 119 | Set the text underline color. The parameter I can be I<-> or a color in one of the formats mentioned before. The special value I<-> resets the color to the default one. 120 | 121 | =item BI