Merge branch 'master' into bacardi55
This commit is contained in:
commit
b7ded56ef9
13
.gitignore
vendored
13
.gitignore
vendored
@ -1,17 +1,6 @@
|
||||
CMakeCache.txt
|
||||
CMakeFiles/
|
||||
cmake_install.cmake
|
||||
cmake_uninstall.cmake
|
||||
Makefile
|
||||
*.o
|
||||
.*.sw?
|
||||
wmfs
|
||||
src/config.h
|
||||
changelog
|
||||
config.h
|
||||
#*
|
||||
\#*
|
||||
build/
|
||||
doc/
|
||||
wmfs.doxygen
|
||||
wmfsrc
|
||||
build
|
||||
|
||||
58
BSDmakefile
Normal file
58
BSDmakefile
Normal file
@ -0,0 +1,58 @@
|
||||
.include "config.mk"
|
||||
.include "common.mk"
|
||||
|
||||
PROG= wmfs
|
||||
MAN1= wmfs.1
|
||||
|
||||
.for lib in xrandr xinerama
|
||||
.if !empty(LIBS:M${lib})
|
||||
CFLAGS+= -DHAVE_${lib:U}
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
.if !empty(LIBS:Mimlib2)
|
||||
CFLAGS+= -DHAVE_IMLIB
|
||||
.endif
|
||||
|
||||
.if !defined(CFLAGS_LIBS)
|
||||
CFLAGS_LIBS!= pkg-config --cflags-only-I ${LIBS}
|
||||
.endif
|
||||
|
||||
.if !defined(LDFLAGS_LIBS)
|
||||
LDFLAGS_LIBS!= pkg-config --libs ${LIBS}
|
||||
.endif
|
||||
|
||||
CFLAGS+= ${CFLAGS_LIBS}
|
||||
LDADD+= ${LDFLAGS_LIBS} -lpthread
|
||||
|
||||
install: all
|
||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
@install ${.OBJDIR}/wmfs ${DESTDIR}${PREFIX}/bin
|
||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
@install -m 644 ${.OBJDIR}/wmfs.1.gz ${DESTDIR}${MANPREFIX}/man1/
|
||||
@echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions
|
||||
@mkdir -p ${DESTDIR}${PREFIX}/share/xsessions
|
||||
@install -m 644 ${.CURDIR}/wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/
|
||||
@echo installing default config file to ${DESTDIR}${XDG_CONFIG_DIR}
|
||||
@mkdir -p ${DESTDIR}${XDG_CONFIG_DIR}
|
||||
@install -m 444 ${.CURDIR}/wmfsrc ${DESTDIR}${XDG_CONFIG_DIR}
|
||||
|
||||
uninstall:
|
||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||
@rm -f ${DESTDIR}${PREFIX}/bin/wmfs
|
||||
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
|
||||
@rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz
|
||||
@echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions/
|
||||
@rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop
|
||||
@echo removing config file from ${DESTDIR}${XDG_CONFIG_DIR}
|
||||
@rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc
|
||||
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
.c.o: config.mk
|
||||
@if [ ! -d `dirname ${.TARGET}` ]; then mkdir -p `dirname ${.TARGET}`; fi
|
||||
@echo CC ${.IMPSRC}
|
||||
@${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
|
||||
171
CMakeLists.txt
171
CMakeLists.txt
@ -1,171 +0,0 @@
|
||||
# -*- mode: cmake -*-
|
||||
|
||||
# Minimal version of CMake
|
||||
cmake_minimum_required(VERSION 2.6.0)
|
||||
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
|
||||
if(COMMAND cmake_policy)
|
||||
cmake_policy(SET CMP0003 NEW)
|
||||
endif(COMMAND cmake_policy)
|
||||
|
||||
# set some default options
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} )
|
||||
set(CMAKE_COLOR_MAKEFILE ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
set(CMAKE_BUILD_TYPE_SHARED_LIBS ON)
|
||||
set(CMAKE_C_FLAGS $ENV{CFLAGS})
|
||||
set(CMAKE_CXX_FLAGS $ENV{CXXFLAGS})
|
||||
set(CMAKE_LINK_FLAGS $ENV{LDFLAGS})
|
||||
|
||||
# include macros
|
||||
include(MacroConfigureFile)
|
||||
|
||||
# uninstall
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY )
|
||||
add_custom_target( uninstall
|
||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" )
|
||||
|
||||
# Project name - wmfs
|
||||
set(PROJECT_NAME wmfs)
|
||||
set(VERSION "WMFS-201008")
|
||||
project(${PROJECT_NAME} C)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
# required packages
|
||||
pkg_check_modules(FREETYPE REQUIRED freetype2)
|
||||
pkg_check_modules(X11 REQUIRED x11)
|
||||
pkg_check_modules(XFT REQUIRED xft)
|
||||
|
||||
include_directories(
|
||||
${FREETYPE_INCLUDE_DIRS}
|
||||
${X11_INCLUDE_DIRS}
|
||||
${XFT_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
set(CMAKE_LINK_LIBRARIES
|
||||
${FREETYPE_LIBRARIES}
|
||||
${X11_LIBRARIES}
|
||||
${XFT_LIBRARIES}
|
||||
-lpthread
|
||||
)
|
||||
|
||||
# options
|
||||
option(BUILD_DOC "Generate documentation using doxygen" OFF)
|
||||
option(WITH_XINERAMA "Build with Xinerama support" ON)
|
||||
option(WITH_XRANDR "Build with Xrandr support" ON)
|
||||
option(WITH_IMLIB2 "Build with Imlib2 support" ON)
|
||||
|
||||
# optional finders
|
||||
if(WITH_XINERAMA)
|
||||
add_definitions(-DHAVE_XINERAMA)
|
||||
pkg_check_modules(XINERAMA REQUIRED xinerama)
|
||||
include_directories(${XINERAMA_INCLUDE_DIRS})
|
||||
set(CMAKE_LINK_LIBRARIES ${XINERAMA_LIBRARIES} ${CMAKE_LINK_LIBRARIES})
|
||||
else(WITH_XINERAMA)
|
||||
message(STATUS "Not building with Xinerama support")
|
||||
endif(WITH_XINERAMA)
|
||||
|
||||
if(WITH_XRANDR)
|
||||
add_definitions(-DHAVE_XRANDR)
|
||||
pkg_check_modules(XRANDR REQUIRED xrandr)
|
||||
include_directories(${XRANDR_INCLUDE_DIRS})
|
||||
set(CMAKE_LINK_LIBRARIES ${XRANDR_LIBRARIES} ${CMAKE_LINK_LIBRARIES})
|
||||
else(WITH_XRANDR)
|
||||
message(STATUS "Not building with Xrandr support")
|
||||
endif(WITH_XRANDR)
|
||||
|
||||
if(WITH_IMLIB2)
|
||||
add_definitions(-DHAVE_IMLIB)
|
||||
pkg_check_modules(IMLIB2 REQUIRED imlib2)
|
||||
include_directories(${IMLIB2_INCLUDE_DIRS})
|
||||
set(CMAKE_LINK_LIBRARIES ${IMLIB2_LIBRARIES} ${CMAKE_LINK_LIBRARIES})
|
||||
else(WITH_IMLIB2)
|
||||
message(STATUS "Not building with Imlib2 support")
|
||||
endif(WITH_IMLIB2)
|
||||
|
||||
set(CMAKE_SYSCONFDIR ${CMAKE_INSTALL_PREFIX}/etc/ CACHE PATH "Config directory")
|
||||
set(CMAKE_XDGCONFDIR ${CMAKE_SYSCONFDIR}/xdg/ CACHE PATH "XDG config directory")
|
||||
set(CMAKE_DATADIR ${CMAKE_INSTALL_PREFIX}/share/ CACHE PATH "Data directory")
|
||||
set(CMAKE_DOCDIR ${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}-${VERSION} CACHE PATH "Data directory")
|
||||
|
||||
# set default terminal for user
|
||||
set(WMFS_TERM xterm)
|
||||
# get the user compiling this thing
|
||||
SET(USERNAME $ENV{USER})
|
||||
|
||||
# configure files
|
||||
set(CONFIGURE_FILES
|
||||
src/config.h.in
|
||||
wmfs.doxygen.in
|
||||
wmfsrc.in)
|
||||
foreach(file ${CONFIGURE_FILES})
|
||||
ConfigureFile(${file})
|
||||
endforeach(file)
|
||||
|
||||
# add the source directory
|
||||
add_subdirectory(src)
|
||||
|
||||
# documentation
|
||||
if(BUILD_DOC)
|
||||
find_package(Doxygen REQUIRED)
|
||||
if(DOXYGEN_FOUND)
|
||||
add_custom_target(doc
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/wmfs.doxygen
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
else(DOXYGEN_FOUND)
|
||||
MESSAGE(FATAL_ERROR "Doxygen executable not found")
|
||||
endif(DOXYGEN_FOUND)
|
||||
endif(BUILD_DOC)
|
||||
|
||||
# Generating ChangeLog only for live version, for release we generate it to tarball
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ChangeLog)
|
||||
find_program(GIT_EXECUTABLE git)
|
||||
if(EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD AND GIT_EXECUTABLE)
|
||||
message(STATUS "<<< Generating ChangeLog... >>>")
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} log
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/ChangeLog)
|
||||
else(EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD AND GIT_EXECUTABLE)
|
||||
message(STATUS "No ChangeLog present and git not found")
|
||||
message(STATUS "<<< Will not generate ChangeLog >>>")
|
||||
endif(EXISTS ${CMAKE_SOURCE_DIR}/.git/HEAD AND GIT_EXECUTABLE)
|
||||
endif(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ChangeLog)
|
||||
|
||||
# manpage (compression handled by system not by us)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wmfs.1 DESTINATION ${CMAKE_DATADIR}/man/man1)
|
||||
|
||||
# install docs
|
||||
# changelog || can have 2 locations based on whether we generate it or not
|
||||
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ChangeLog)
|
||||
set(WMFS_DOCS ${CMAKE_CURRENT_BINARY_DIR}/ChangeLog ${WMFS_DOCS})
|
||||
endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/ChangeLog)
|
||||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog)
|
||||
set(WMFS_DOCS ${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog ${WMFS_DOCS})
|
||||
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog)
|
||||
set(WMFS_DOCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/TODO
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/README
|
||||
${WMFS_DOCS}
|
||||
)
|
||||
install(FILES ${WMFS_DOCS} DESTINATION ${CMAKE_DOCDIR})
|
||||
|
||||
# config file
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/wmfsrc DESTINATION ${CMAKE_XDGCONFDIR}/${PROJECT_NAME})
|
||||
|
||||
# xsession
|
||||
install(FILES "wmfs.desktop" DESTINATION ${CMAKE_DATADIR}/xsessions)
|
||||
|
||||
# Status messages
|
||||
message(STATUS "<<< ${PROJECT_NAME} ${VERSION} configuration >>>
|
||||
Build type ${CMAKE_BUILD_TYPE}
|
||||
Install path ${CMAKE_INSTALL_PREFIX}
|
||||
Compiler flags:
|
||||
C ${CMAKE_C_FLAGS}
|
||||
C++ ${CMAKE_CXX_FLAGS}
|
||||
Linker flags:
|
||||
Executable ${CMAKE_EXE_LINKER_FLAGS}
|
||||
Module ${CMAKE_MODULE_LINKER_FLAGS}
|
||||
Shared ${CMAKE_SHARED_LINKER_FLAGS}\n")
|
||||
81
Makefile
Normal file
81
Makefile
Normal file
@ -0,0 +1,81 @@
|
||||
include config.mk
|
||||
include common.mk
|
||||
|
||||
OBJ = ${patsubst %.c,${O}/%.o,${SRCS}}
|
||||
|
||||
ifneq ($(findstring xrandr, ${LIBS}),)
|
||||
CFLAGS+= -DHAVE_XRANDR
|
||||
endif
|
||||
|
||||
ifneq ($(findstring xinerama, ${LIBS}),)
|
||||
CFLAGS+= -DHAVE_XINERAMA
|
||||
endif
|
||||
|
||||
ifneq ($(findstring imlib2, ${LIBS}),)
|
||||
CFLAGS+= -DHAVE_IMLIB
|
||||
endif
|
||||
|
||||
ifndef CFLAGS_LIBS
|
||||
CFLAGS_LIBS= $(shell pkg-config --cflags-only-I ${LIBS})
|
||||
endif
|
||||
|
||||
ifndef LDFLAGS_LIBS
|
||||
LDFLAGS_LIBS= $(shell pkg-config --libs ${LIBS})
|
||||
endif
|
||||
|
||||
CFLAGS+= ${CFLAGS_LIBS}
|
||||
LDFLAGS+= ${LDFLAGS_LIBS} -lpthread
|
||||
|
||||
all: options ${O}/wmfs ${O}/wmfs.1.gz
|
||||
|
||||
${O}/wmfs.1.gz: wmfs.1
|
||||
gzip -cn -9 $< > $@
|
||||
|
||||
${O}/%.o: %.c config.mk
|
||||
@if [ ! -d `dirname ${O}/$<` ]; then mkdir -p `dirname ${O}/$<`; fi
|
||||
@echo CC $<
|
||||
@${CC} -c ${CFLAGS} $< -o $@
|
||||
|
||||
options:
|
||||
@echo wmfs compile with ${LIBS}
|
||||
@echo - CFLAGS ${CFLAGS}
|
||||
@echo - LDFLAGS ${LDFLAGS}
|
||||
@echo - OUTPUT ${O}
|
||||
|
||||
@if [ ! -d ${O} ]; then mkdir -p ${O}; fi
|
||||
|
||||
${O}/wmfs: ${OBJ} config.mk src/structs.h src/wmfs.h src/parse/parse.h
|
||||
@echo CC -o $@
|
||||
@${CC} -o $@ ${OBJ} ${LDFLAGS}
|
||||
|
||||
clean:
|
||||
@rm -f ${OBJ} ${O}/wmfs ${O}/wmfs.1.gz
|
||||
|
||||
install: all
|
||||
@echo installing executable file to ${DESTDIR}${PREFIX}/bin
|
||||
@mkdir -p ${DESTDIR}${PREFIX}/bin
|
||||
@install ${O}/wmfs ${DESTDIR}${PREFIX}/bin
|
||||
@echo installing manual page to ${DESTDIR}${MANPREFIX}/man1
|
||||
@mkdir -p ${DESTDIR}${MANPREFIX}/man1
|
||||
@install -m 644 ${O}/wmfs.1.gz ${DESTDIR}${MANPREFIX}/man1/
|
||||
@echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions
|
||||
@mkdir -p ${DESTDIR}${PREFIX}/share/xsessions
|
||||
@install -m 644 wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/
|
||||
@echo installing default config file to ${DESTDIR}${XDG_CONFIG_DIR}
|
||||
@mkdir -p ${DESTDIR}${XDG_CONFIG_DIR}
|
||||
@install -m 444 wmfsrc ${DESTDIR}${XDG_CONFIG_DIR}
|
||||
|
||||
uninstall:
|
||||
@echo removing executable file from ${DESTDIR}${PREFIX}/bin
|
||||
@rm -f ${DESTDIR}${PREFIX}/bin/wmfs
|
||||
@echo removing manual page from ${DESTDIR}${MANPREFIX}/man1
|
||||
@rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz
|
||||
@echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions
|
||||
@rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop
|
||||
@echo removing config file from ${DESTDIR}${XDG_CONFIG_DIR}
|
||||
@rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc
|
||||
|
||||
|
||||
|
||||
.PHONY: all clean install uninstall
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
STRING(REGEX REPLACE "\n" ";" files "${files}")
|
||||
FOREACH(file ${files})
|
||||
MESSAGE(STATUS "Uninstalling: \"$ENV{DESTDIR}${file}\"")
|
||||
IF(EXISTS "$ENV{DESTDIR}${file}")
|
||||
EXEC_PROGRAM(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
IF(NOT "${rm_retval}" STREQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Problem when removing: \"$ENV{DESTDIR}${file}\"")
|
||||
ENDIF(NOT "${rm_retval}" STREQUAL 0)
|
||||
ELSE(EXISTS "$ENV{DESTDIR}${file}")
|
||||
MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
||||
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
|
||||
ENDFOREACH(file)
|
||||
@ -1,8 +0,0 @@
|
||||
macro(ConfigureFile file)
|
||||
string(REGEX REPLACE ".in\$" "" outfile ${file})
|
||||
message(STATUS "<<< Configuring ${outfile} >>>")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${outfile}
|
||||
ESCAPE_QUOTE
|
||||
@ONLY)
|
||||
endmacro(ConfigureFile)
|
||||
33
common.mk
Normal file
33
common.mk
Normal file
@ -0,0 +1,33 @@
|
||||
SRCS= \
|
||||
src/barwin.c \
|
||||
src/client.c \
|
||||
src/config.c \
|
||||
src/draw.c \
|
||||
src/event.c \
|
||||
src/ewmh.c \
|
||||
src/frame.c \
|
||||
src/getinfo.c \
|
||||
src/infobar.c \
|
||||
src/init.c \
|
||||
src/launcher.c \
|
||||
src/layout.c \
|
||||
src/menu.c \
|
||||
src/mouse.c \
|
||||
src/parse/api.c \
|
||||
src/parse/parse.c \
|
||||
src/screen.c \
|
||||
src/status.c \
|
||||
src/systray.c \
|
||||
src/tag.c \
|
||||
src/util.c \
|
||||
src/viwmfs.c \
|
||||
src/wmfs.c
|
||||
|
||||
# flags
|
||||
CFLAGS+= ${C_FLAGS}
|
||||
CFLAGS+= -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\"
|
||||
CFLAGS+= -DWMFS_VERSION=\"${VERSION}\"
|
||||
LDFLAGS+= ${LD_FLAGS}
|
||||
|
||||
# build directory
|
||||
O?= build
|
||||
27
config.mk
Normal file
27
config.mk
Normal file
@ -0,0 +1,27 @@
|
||||
# wmfs version
|
||||
VERSION= 201011
|
||||
|
||||
# Customize below to fit your system
|
||||
# x11 xft and freetype2 are REQUIRED, others are optionals
|
||||
LIBS= x11 xft freetype2 xrandr xinerama imlib2
|
||||
|
||||
|
||||
# If theses variables are defined, make will not call pkg-config
|
||||
#
|
||||
# Linux example
|
||||
# CFLAGS_LIBS= -I/usr/include/freetype2
|
||||
# LDFLAGS_LIBS= -lX11 -lXft -lfreetype -lXrandr -lXinerama -lImlib2
|
||||
#
|
||||
# FreeBSD example
|
||||
# CFLAGS_LIBS= -I/usr/local/include -I/usr/local/include/freetype2
|
||||
# LDFLAGS_LIBS= -L/usr/local/lib -lXft -lXrender -lfontconfig -lX11 -lfreetype -lXrandr -lXinerama -lImlib2
|
||||
|
||||
# paths
|
||||
PREFIX= /usr/local
|
||||
MANPREFIX= ${PREFIX}/man
|
||||
XDG_CONFIG_DIR= /usr/local/etc/xdg/wmfs
|
||||
|
||||
|
||||
# CFLAGS LDFLAGS can be customised here
|
||||
C_FLAGS= -Wall
|
||||
LD_FLAGS=
|
||||
@ -1,35 +0,0 @@
|
||||
# -*- mode: cmake -*-
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/parse)
|
||||
|
||||
SET(WMFS_SOURCES
|
||||
parse/parse.c
|
||||
parse/api.c
|
||||
barwin.c
|
||||
client.c
|
||||
config.c
|
||||
draw.c
|
||||
event.c
|
||||
ewmh.c
|
||||
frame.c
|
||||
getinfo.c
|
||||
infobar.c
|
||||
init.c
|
||||
launcher.c
|
||||
layout.c
|
||||
menu.c
|
||||
mouse.c
|
||||
screen.c
|
||||
status.c
|
||||
systray.c
|
||||
tag.c
|
||||
util.c
|
||||
viwmfs.c
|
||||
wmfs.c
|
||||
)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${WMFS_SOURCES})
|
||||
target_link_libraries(${PROJECT_NAME} ${CMAKE_LINK_LIBRARIES})
|
||||
INSTALL ( TARGETS ${PROJECT_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib${LIB_SUFFIX} )
|
||||
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* config.h
|
||||
* Copyright © 2008 Martin Duquesnoy <xorg62@gmail.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following disclaimer
|
||||
* in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* * Neither the name of the nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "wmfs.h"
|
||||
|
||||
#define WMFS_VERSION "@VERSION@"
|
||||
#define WMFS_COMPILE_MACHINE "@CMAKE_SYSTEM_PROCESSOR@"
|
||||
#define WMFS_COMPILE_BY "@USERNAME@"
|
||||
#define WMFS_COMPILE_FLAGS "@CMAKE_C_FLAGS@"
|
||||
#define WMFS_LINKED_LIBS "@CMAKE_LINK_LIBRARIES@"
|
||||
#define XDG_CONFIG_DIR "@CMAKE_XDGCONFDIR@"
|
||||
|
||||
#endif /* CONFIG_H */
|
||||
@ -80,7 +80,9 @@ static struct keyword *
|
||||
push_keyword(struct keyword *tail, enum keyword_t type, char *buf, size_t *offset, struct files *file, int line)
|
||||
{
|
||||
struct keyword *kw;
|
||||
#ifdef DEBUG
|
||||
int i = 0;
|
||||
#endif
|
||||
|
||||
if (type == WORD && *offset == 0)
|
||||
return tail;
|
||||
@ -165,8 +167,15 @@ parse_keywords(const char *filename)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (st.st_size == 0) {
|
||||
warnx("%s: empty file", filename);
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!realpath(filename, path)) {
|
||||
warn("%s", filename);
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -338,7 +347,7 @@ include(struct keyword *head)
|
||||
filename = head->name;
|
||||
|
||||
if (!(kw = parse_keywords(filename))) {
|
||||
warnx("no config fond in include file %s", head->name);
|
||||
warnx("no config found in include file %s", head->name);
|
||||
|
||||
if (filename != head->name)
|
||||
free(filename);
|
||||
|
||||
@ -449,11 +449,7 @@ main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
printf("WMFS version : "WMFS_VERSION"\n"
|
||||
" Compilation settings :\n"
|
||||
" - Flags : "WMFS_COMPILE_FLAGS"\n"
|
||||
" - Linked Libs : "WMFS_LINKED_LIBS"\n"
|
||||
" - On "WMFS_COMPILE_MACHINE" by "WMFS_COMPILE_BY".\n");
|
||||
printf("WMFS "WMFS_VERSION"\n");
|
||||
exit(EXIT_SUCCESS);
|
||||
break;
|
||||
|
||||
|
||||
@ -60,7 +60,6 @@
|
||||
|
||||
/* Local headers */
|
||||
#include "parse/parse.h"
|
||||
#include "config.h"
|
||||
#include "structs.h"
|
||||
|
||||
/* Optional dependencies */
|
||||
|
||||
@ -73,7 +73,7 @@ WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/src
|
||||
INPUT = src
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS = *.c \
|
||||
*.h \
|
||||
@ -231,7 +231,7 @@
|
||||
fg_focus = "#191919" bg_focus = "#7E89A2"
|
||||
fg_normal = "#9F9AB3" bg_normal = "#191919"
|
||||
|
||||
[item] name = "Terminal" func = "spawn" cmd = "@WMFS_TERM@" [/item]
|
||||
[item] name = "Terminal" func = "spawn" cmd = "urxvt || xterm || gnome-terminal" [/item]
|
||||
[item] name = "Applications" submenu = "appmenu" [/item]
|
||||
[item] name = "Next tag" func = "tag_next" [/item]
|
||||
[item] name = "Previous tag" func = "tag_prev" [/item]
|
||||
@ -285,7 +285,7 @@
|
||||
[key] mod = {"Alt", "Control"} key = "r" func = "reload" [/key]
|
||||
|
||||
# Open a terminal.
|
||||
[key] mod = {"Control"} key = "Return" func = "spawn" cmd = "@WMFS_TERM@" [/key]
|
||||
[key] mod = {"Control"} key = "Return" func = "spawn" cmd = "xterm" [/key]
|
||||
|
||||
# Kill the selected client.
|
||||
[key] mod = {"Alt"} key = "q" func = "client_kill" [/key]
|
||||
Loading…
x
Reference in New Issue
Block a user