-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
%C uses wrong line width when used in description #73
Comments
Can you post a screenshot ? Also for the length I know the problem and i'm working on it. |
This Makefile works on my machine. CC=gcc
OBJDIR=objs
SRCDIR=src
INCDIR=$(SRCDIR)/inc
CFLAGS+=-I$(INCDIR)
SRCS=$(wildcard $(SRCDIR)/*.c)
OBJS=$(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%.o,$(SRCS))
CFLAGS+=-O2 -Wall -std=c99
CFLAGS_DEBUG+=-O0 -g3 -Werror -DDEBUG -pedantic
LDFLAGS+=-lxcb -lxcb-xkb -lxcb-xinerama -lxcb-randr -lcairo -lpthread
# OS X keeps xcb in a different spot
platform=$(shell uname)
ifeq ($(platform),Darwin)
CFLAGS+=-I/usr/X11/include
LDFLAGS+=-L/usr/X11/lib
endif
# Library specific
HAS_GDK := `pkg-config --exists gdk-2.0 && echo $?`
ifneq $(HAS_GDK,)
CFLAGS+=`pkg-config --cflags gdk-2.0`
LDFLAGS+=`pkg-config --libs gdk-2.0`
else
CFLAGS+=-DNO_GDK
endif
HAS_PANGO := `pkg-config --exists pango && echo $?`
ifneq ($(HAS_PANGO),)
CFLAGS+=`pkg-config --cflags pango`
LDFLAGS+=`pkg-config --libs pango`
else
CFLAGS+=-DNO_PANGO
endif
all: lighthouse
debug: CC+=$(CFLAGS_DEBUG)
debug: lighthouse .FORCE
config: lighthouse .FORCE
cp -ir ./config/* ~/.config/
chmod +x ~/.config/lighthouse/cmd*
.FORCE:
lighthouse: $(OBJS)
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
$(OBJS): | $(OBJDIR)
$(OBJDIR):
mkdir -p $@
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(wildcard $(INCDIR)/*.h) Makefile
$(CC) $(CFLAGS) $< -c -o $@
clean:
rm -rf $(OBJDIR) lighthouse |
I have no idea why you posted that Makefile. This issue is just about the wrong line width -- I have not had any issues with compiling, and I am unsure why you would have gotten the idea that I did have such problems. Now that you have prompted me to update, I do have some comments though:
Trying to compile, I see that NO_PANGO is wrongly being defined. Applying the changes you list above, it seems to correctly detect Pango, but halts with an error :
Which, to me, suggests that there is an -I directive that would make cairo.h available that is not being set for some reason (I agree, pkg-config for pango should return that, since it is a dependency). Anyway, not entirely sure why that is happening, I'll update this as things happen. EDIT: substituting 'pangocairo EDIT2: The text in the newly compiled lighthouse appears to be correctly centred, which means this issue is out of date (doesn't relate to git head). Is there any other related issue, or can I close this issue now? From your comments, I wasn't entirely sure if there was another existing related issue. |
I've pushed a fix for the missing documentation. I think I got the header size wrong though, the heading 'Passing arguments to cmd' seems too big. Tell me what you think. |
Because it's not working for me.
Yes the problem came from the cairo
Okay I will change my script.
The only issue is that we have to handle command like this |
Changing 'pango' into 'pangocairo' allows compilation to succeed, for me. Sorry, there was probably a little confusion about what happened with the Makefile.
I see, the first % is interpreted (correctly) as closing the 'bold' section, but also is interpreted (wrongly) as closing the 'centred' section. |
%C appears to use the width of the main item list to determine where to put the text. However, this is larger than the width of the description; therefore, the string being 'centred' is a) not centrally located and b) may be clipped, in the case of longer strings.
How to reproduce:
containing strings such as '%C some longish string %C'
The text was updated successfully, but these errors were encountered: