Compare commits
96 Commits
cairo-love
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
35183ab81d | ||
|
09b5a9b8ba | ||
|
2f255b1756 | ||
|
8cd84e8edf | ||
|
b721a37ab0 | ||
|
1411d260a4 | ||
|
50fe7d2083 | ||
|
84be3d8dbf | ||
|
d680ea4256 | ||
|
44a708b7a4 | ||
|
40f08d5245 | ||
|
3dbdf9d078 | ||
|
a3fb967ad9 | ||
|
ae5a3a477a | ||
|
f2662d75c8 | ||
|
3020df1923 | ||
|
13dcc66cae | ||
|
c788534107 | ||
|
0f2cfbab28 | ||
|
61985278f2 | ||
|
d3d7a87b66 | ||
|
7c8eb7495b | ||
|
f26b88272e | ||
|
214ad63925 | ||
|
495ac4e546 | ||
|
e4ea4071ab | ||
|
63ed303553 | ||
|
e0aee14533 | ||
|
da26209013 | ||
|
2c0f57c584 | ||
|
3b5baa93b1 | ||
|
531c575575 | ||
|
6580e2d4f7 | ||
|
255c93dc7a | ||
|
38422c5014 | ||
|
1585d7257d | ||
|
7f8a79131b | ||
|
177deb0860 | ||
|
b331ee3927 | ||
|
71ed0d3375 | ||
|
63a55dd06c | ||
|
a390ef6a5c | ||
|
04d22b4ae5 | ||
|
73d8c58286 | ||
|
49fdc25f37 | ||
|
a8fa2766fb | ||
|
a9f285fd28 | ||
|
7880eac8c9 | ||
|
25c3441925 | ||
|
b82d96a68e | ||
|
ebb625b529 | ||
|
72106b17b1 | ||
|
19167c2e55 | ||
|
fe4ff881dd | ||
|
75dbf3397e | ||
|
eeb88f8ae0 | ||
|
d32cd8bce9 | ||
|
5186f68658 | ||
|
4ee19586a3 | ||
|
1ef64eab99 | ||
|
ab3a49962f | ||
|
8351859593 | ||
|
2778c81699 | ||
|
d8443785a8 | ||
|
704ba652d9 | ||
|
392f23ef36 | ||
|
7f1f722965 | ||
|
927c05604c | ||
|
0affee3d2f | ||
|
8492309a88 | ||
|
a313800686 | ||
|
4ad9cbd823 | ||
|
bb466a8c16 | ||
|
3483f1b083 | ||
|
7d2c7ab438 | ||
|
e197a15c3a | ||
|
6959085f8d | ||
|
78dc0d0d21 | ||
|
3b8afc6b05 | ||
|
c39c4e4d8b | ||
|
145c66b471 | ||
|
5746d15cf8 | ||
|
3c2b9ff150 | ||
|
95c41381ac | ||
|
e9cdee9701 | ||
|
dbbdf373a3 | ||
|
c258d0a0fa | ||
|
8475ff4fdb | ||
|
28b0db1cfa | ||
|
69e8ac6f07 | ||
|
6df9a2dd68 | ||
|
02627e7609 | ||
|
1c106dbfd0 | ||
|
128e212c14 | ||
|
d22cd1561b | ||
|
f3e9df4a97 |
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,5 +1,4 @@
|
||||||
config.h
|
lemonbar
|
||||||
bar
|
|
||||||
*.o
|
*.o
|
||||||
*.swp
|
*.swp
|
||||||
*~
|
*~
|
||||||
|
|
|
@ -3,5 +3,8 @@ compiler:
|
||||||
- clang
|
- clang
|
||||||
- gcc
|
- gcc
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get install -qq libx11-xcb-dev libxcb-randr0-dev libxcb-xinerama0-dev
|
- sudo apt-get update -qq
|
||||||
|
- sudo apt-get install -y libx11-xcb-dev libxcb-randr0-dev libxcb-xinerama0-dev
|
||||||
|
env:
|
||||||
|
- CFLAGS='-DWITH_XINERAMA=1'
|
||||||
script: make
|
script: make
|
||||||
|
|
32
Makefile
32
Makefile
|
@ -1,12 +1,19 @@
|
||||||
|
# This snippet has been shmelessly stol^Hborrowed from thestinger's repose Makefile
|
||||||
|
VERSION = 1.3
|
||||||
|
GIT_DESC=$(shell test -d .git && git describe --always 2>/dev/null)
|
||||||
|
|
||||||
|
ifneq "$(GIT_DESC)" ""
|
||||||
|
VERSION=$(GIT_DESC)
|
||||||
|
endif
|
||||||
|
|
||||||
CC ?= gcc
|
CC ?= gcc
|
||||||
STRIP ?= strip
|
CFLAGS += -Wall -std=c99 -Os -DVERSION="\"$(VERSION)\""
|
||||||
CFLAGS = -std=c99 -Os
|
LDFLAGS += -lxcb -lxcb-xinerama -lxcb-randr
|
||||||
LDFLAGS = -lxcb -lcairo -lxcb-xinerama -lxcb-randr
|
CFDEBUG = -g3 -pedantic -Wall -Wunused-parameter -Wlong-long \
|
||||||
CFDEBUG = -g3 -pedantic -Wall -Wunused-parameter -Wlong-long\
|
|
||||||
-Wsign-conversion -Wconversion -Wimplicit-function-declaration
|
-Wsign-conversion -Wconversion -Wimplicit-function-declaration
|
||||||
|
|
||||||
EXEC = bar
|
EXEC = lemonbar
|
||||||
SRCS = bar.c
|
SRCS = lemonbar.c
|
||||||
OBJS = ${SRCS:.c=.o}
|
OBJS = ${SRCS:.c=.o}
|
||||||
|
|
||||||
PREFIX?=/usr
|
PREFIX?=/usr
|
||||||
|
@ -15,14 +22,13 @@ BINDIR=${PREFIX}/bin
|
||||||
all: ${EXEC}
|
all: ${EXEC}
|
||||||
|
|
||||||
doc: README.pod
|
doc: README.pod
|
||||||
pod2man --section=1 --center="bar Manual" --name "bar" --release="bar $(shell git describe --always)" README.pod > bar.1
|
pod2man --section=1 --center="lemonbar Manual" --name "lemonbar" --release="lemonbar $(VERSION)" README.pod > lemonbar.1
|
||||||
|
|
||||||
.c.o:
|
.c.o:
|
||||||
${CC} ${CFLAGS} -o $@ -c $<
|
${CC} ${CFLAGS} -o $@ -c $<
|
||||||
|
|
||||||
${EXEC}: ${OBJS}
|
${EXEC}: ${OBJS}
|
||||||
${CC} -o ${EXEC} ${OBJS} ${LDFLAGS}
|
${CC} -o ${EXEC} ${OBJS} ${LDFLAGS}
|
||||||
${STRIP} -s ${EXEC}
|
|
||||||
|
|
||||||
debug: ${EXEC}
|
debug: ${EXEC}
|
||||||
debug: CC += ${CFDEBUG}
|
debug: CC += ${CFDEBUG}
|
||||||
|
@ -31,12 +37,12 @@ clean:
|
||||||
rm -f ./*.o ./*.1
|
rm -f ./*.o ./*.1
|
||||||
rm -f ./${EXEC}
|
rm -f ./${EXEC}
|
||||||
|
|
||||||
install: bar doc
|
install: lemonbar doc
|
||||||
install -D -m 755 bar ${DESTDIR}${BINDIR}/bar
|
install -D -m 755 lemonbar ${DESTDIR}${BINDIR}/lemonbar
|
||||||
install -D -m 644 bar.1 ${DESTDIR}${PREFIX}/share/man/man1/bar.1
|
install -D -m 644 lemonbar.1 ${DESTDIR}${PREFIX}/share/man/man1/lemonbar.1
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f ${DESTDIR}${BINDIR}/bar
|
rm -f ${DESTDIR}${BINDIR}/lemonbar
|
||||||
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/bar.1
|
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/lemonbar.1
|
||||||
|
|
||||||
.PHONY: all debug clean install
|
.PHONY: all debug clean install
|
||||||
|
|
49
README.pod
49
README.pod
|
@ -1,16 +1,16 @@
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
bar - bar ain't recursive
|
lemonbar - Featherweight lemon-scented bar
|
||||||
|
|
||||||
=for HTML <a href="https://travis-ci.org/LemonBoy/bar"><img src="https://travis-ci.org/LemonBoy/bar.svg?branch=master"></a>
|
=for HTML <a href="https://travis-ci.org/LemonBoy/bar"><img src="https://travis-ci.org/LemonBoy/bar.svg?branch=master"></a>
|
||||||
|
|
||||||
=head1 SYNOPSIS
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
I<bar> [-h | -g I<width>B<x>I<height>B<+>I<x>B<+>I<y> | -b | -d | -f I<font> | -p | -u I<pixel> | -B I<color> | -F I<color>]
|
I<lemonbar> [-h | -g I<width>B<x>I<height>B<+>I<x>B<+>I<y> | -b | -d | -f I<font> | -p | -n I<name> | -u I<pixel> | -B I<color> | -F I<color> | -U I<color>]
|
||||||
|
|
||||||
=head1 DESCRIPTION
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
B<bar> is a lightweight bar entirely based on XCB. Provides full UTF-8 support, basic formatting, RandR and Xinerama support and EWMH compliance without wasting your precious memory.
|
B<lemonbar> (formerly known as B<bar>) is a lightweight bar entirely based on XCB. Provides full UTF-8 support, basic formatting, RandR and Xinerama support and EWMH compliance without wasting your precious memory.
|
||||||
|
|
||||||
=head1 OPTIONS
|
=head1 OPTIONS
|
||||||
|
|
||||||
|
@ -34,11 +34,20 @@ Force docking without asking the window manager. This is needed if the window ma
|
||||||
|
|
||||||
=item B<-f> I<font>
|
=item B<-f> I<font>
|
||||||
|
|
||||||
Comma separated list of fonts, bar supports a maximum of two fonts.
|
Define the font to load into one of the five slots (the number of slots is hardcoded and can be tweaked by
|
||||||
|
changing the MAX_FONT_COUNT parameter in the source code).
|
||||||
|
|
||||||
|
=item B<-a> I<number>
|
||||||
|
|
||||||
|
Set number of clickable areas (default is 10)
|
||||||
|
|
||||||
=item B<-p>
|
=item B<-p>
|
||||||
|
|
||||||
Make bar permanent, don't exit after the standard input is closed.
|
Make the bar permanent, don't exit after the standard input is closed.
|
||||||
|
|
||||||
|
=item B<-n> I<name>
|
||||||
|
|
||||||
|
Set the WM_NAME atom value for the bar.
|
||||||
|
|
||||||
=item B<-u> I<pixel>
|
=item B<-u> I<pixel>
|
||||||
|
|
||||||
|
@ -46,17 +55,21 @@ Sets the underline width in pixels. The default is 1.
|
||||||
|
|
||||||
=item B<-B> I<color>
|
=item B<-B> I<color>
|
||||||
|
|
||||||
Set the background color of the bar. I<color> might be either in hex format (#aarrggbb) or in the symbolic name format (eg. white, brightred, darkgray). If no compositor such as compton or xcompmgr is running the alpha channel is silently ignored.
|
Set the background color of the bar. I<color> 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.
|
||||||
|
|
||||||
=item B<-F> I<color>
|
=item B<-F> I<color>
|
||||||
|
|
||||||
Set the foreground color of the bar. Accepts the same color formats as B<-B>.
|
Set the foreground color of the bar. Accepts the same color formats as B<-B>.
|
||||||
|
|
||||||
|
=item B<-U> I<color>
|
||||||
|
|
||||||
|
Set the underline color of the bar. Accepts the same color formats as B<-B>.
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=head1 FORMATTING
|
=head1 FORMATTING
|
||||||
|
|
||||||
bar provides a screenrc-inspired formatting syntax to allow full customization at runtime. Every formatting block is opened with B<%{> and closed by B<}> and accepts the following commands, the parser tries it's best to handle malformed input.
|
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 its best to handle malformed input. Use C<%%> to get a literal percent sign (C<%>).
|
||||||
|
|
||||||
=over
|
=over
|
||||||
|
|
||||||
|
@ -76,6 +89,10 @@ Aligns the following text to the center of the screen.
|
||||||
|
|
||||||
Aligns the following text to the right side of the screen.
|
Aligns the following text to the right side of the screen.
|
||||||
|
|
||||||
|
=item B<O>I<width>
|
||||||
|
|
||||||
|
Offset the current position by I<width> pixels in the alignment direction.
|
||||||
|
|
||||||
=item B<B>I<color>
|
=item B<B>I<color>
|
||||||
|
|
||||||
Set the text background color. The parameter I<color> can be I<-> or a color in one of the formats mentioned before. The special value I<-> resets the color to the default one.
|
Set the text background color. The parameter I<color> can be I<-> or a color in one of the formats mentioned before. The special value I<-> resets the color to the default one.
|
||||||
|
@ -84,21 +101,29 @@ Set the text background color. The parameter I<color> can be I<-> or a color in
|
||||||
|
|
||||||
Set the text foreground color. The parameter I<color> can be I<-> or a color in one of the formats mentioned before. The special value I<-> resets the color to the default one.
|
Set the text foreground color. The parameter I<color> can be I<-> or a color in one of the formats mentioned before. The special value I<-> resets the color to the default one.
|
||||||
|
|
||||||
|
=item B<T>I<index>
|
||||||
|
|
||||||
|
Set the font used to draw the following text. The parameter I<index> 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
|
||||||
|
|
||||||
=item B<U>I<color>
|
=item B<U>I<color>
|
||||||
|
|
||||||
Set the text underline color. The parameter I<color> can be I<-> or a color in one of the formats mentioned before. The special value I<-> resets the color to the default one.
|
Set the text underline color. The parameter I<color> can be I<-> or a color in one of the formats mentioned before. The special value I<-> resets the color to the default one.
|
||||||
|
|
||||||
=item B<A>I<button>:I<command>:
|
=item B<A>I<button>:I<command>:
|
||||||
|
|
||||||
Create a clickable area starting from the current position, when the area is clicked I<command> is executed. The area is closed when a B<A> token, not followed by : is encountered.
|
Create a clickable area starting from the current position, when the area is clicked I<command> is printed on stdout. The area is closed when a B<A> token, not followed by : is encountered.
|
||||||
|
|
||||||
Eg. I<%{A:reboot:} Click here to reboot %{A}>
|
Eg. I<%{A:reboot:} Click here to reboot %{A}>
|
||||||
|
|
||||||
The I<button> field is optional, it defaults to the left button, and it's a number ranging from 1 to 5 which maps to the left, middle, right, scroll down and scroll up movements. Your mileage may vary.
|
The I<button> field is optional, it defaults to the left button, and it's a number ranging from 1 to 5 which maps to the left, middle, right, scroll up and scroll down movements. Your mileage may vary.
|
||||||
|
|
||||||
|
Nested clickable areas can trigger different commands.
|
||||||
|
|
||||||
|
Eg. I<%{A:reboot:}%{A3:halt:} Left click to reboot, right click to shutdown %{A}%{A}>
|
||||||
|
|
||||||
=item B<S>I<dir>
|
=item B<S>I<dir>
|
||||||
|
|
||||||
Change the monitor bar is rendering to. I<dir> can be either
|
Change the monitor the bar is rendered to. I<dir> can be either
|
||||||
|
|
||||||
=over
|
=over
|
||||||
|
|
||||||
|
@ -152,7 +177,7 @@ Draw a line under the text.
|
||||||
|
|
||||||
=head1 OUTPUT
|
=head1 OUTPUT
|
||||||
|
|
||||||
Clicking on an area makes bar output the command to stdout, followed by a newline, allowing the user to pipe it into a script, execute it or simply ignore it. Simple and powerful, that's it.
|
Clicking on an area makes lemonbar output the command to stdout, followed by a newline, allowing the user to pipe it into a script, execute it or simply ignore it. Simple and powerful, that's it.
|
||||||
|
|
||||||
=head1 WWW
|
=head1 WWW
|
||||||
|
|
||||||
|
@ -160,7 +185,7 @@ L<git repository|https://github.com/LemonBoy/bar>
|
||||||
|
|
||||||
=head1 AUTHOR
|
=head1 AUTHOR
|
||||||
|
|
||||||
2012-2014 (C) The Lemon Man
|
2012-2017 (C) The Lemon Man
|
||||||
|
|
||||||
Xinerama support was kindly contributed by Stebalien
|
Xinerama support was kindly contributed by Stebalien
|
||||||
|
|
||||||
|
|
1407
lemonbar.c
Normal file
1407
lemonbar.c
Normal file
File diff suppressed because it is too large
Load Diff
36
palette.pl
36
palette.pl
|
@ -1,36 +0,0 @@
|
||||||
#!/usr/bin/env perl
|
|
||||||
#
|
|
||||||
# palette.pl
|
|
||||||
#
|
|
||||||
# Converts your .Xdefault/.Xresources colors into a ready to paste palette
|
|
||||||
# for bar. It takes your foreground/background settings into account and if
|
|
||||||
# it cant find them it leaves COLOR0/COLOR1 undefined.
|
|
||||||
#
|
|
||||||
|
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
|
|
||||||
open (F, "<".$ARGV[0]) || die "Can't open!";
|
|
||||||
|
|
||||||
our %vars = ();
|
|
||||||
|
|
||||||
while (<F>) {
|
|
||||||
# Don't match comments
|
|
||||||
if ($_ !~ m/^\s*!/) {
|
|
||||||
# It's a define!
|
|
||||||
if ($_ =~ m/^\s*#define\s+(\w+)\s+#([0-9A-Fa-f]{1,6})/) {
|
|
||||||
$vars{"$1"} = hex($2);
|
|
||||||
}
|
|
||||||
elsif ($_ =~ m/^\s*\w*\*(background|foreground|color\d)\s*:\s*([\w\d#]+)/) {
|
|
||||||
my ($name, $value) = (uc $1, $2);
|
|
||||||
# Check if it's a color
|
|
||||||
if (substr($value, 0, 1) eq '#') {
|
|
||||||
$value = hex(substr($value, 1));
|
|
||||||
} else {
|
|
||||||
$value = $vars{"$value"};
|
|
||||||
}
|
|
||||||
printf "#define $name 0x%06x\n", $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user