Merge branch 'next' into master

This commit is contained in:
Michael Stapelberg 2016-11-08 19:54:14 +01:00
commit 1994eea5da
262 changed files with 5974 additions and 2436 deletions

27
.gitignore vendored
View File

@ -34,3 +34,30 @@ i3-command-parser.stamp
i3-config-parser.stamp
.clang_complete
LAST_VERSION
################################################################################
# https://raw.githubusercontent.com/github/gitignore/master/Autotools.gitignore
################################################################################
# http://www.gnu.org/software/automake
Makefile.in
/ar-lib
/test-driver
# http://www.gnu.org/software/autoconf
/autom4te.cache
/autoscan.log
/autoscan-*.log
/aclocal.m4
/compile
/config.h.in
/config.guess
/config.sub
/configure
/configure.scan
/depcomp
/install-sh
/missing
/stamp-h1

View File

@ -6,18 +6,67 @@ language: c
compiler:
- gcc
- clang
addons:
apt:
packages:
# For https support in HTTP::Tiny.
- libio-socket-ssl-perl
env:
global:
- BASENAME="i3wm/travis-base:$(date +'%Y-%m')-$(./travis/ha.sh)"
- BASENAME="i3wm/travis-base:$(date +'%Y-%m')-$(./travis/ha.sh travis/travis-base.Dockerfile)"
- BASENAME_386="i3wm/travis-base-386:$(date +'%Y-%m')-$(./travis/ha.sh travis/travis-base-386.Dockerfile)"
- BASENAME_UBUNTU="i3wm/travis-base-ubuntu:$(date +'%Y-%m')-$(./travis/ha.sh travis/travis-base-ubuntu.Dockerfile)"
- BASENAME_UBUNTU_386="i3wm/travis-base-ubuntu-386:$(date +'%Y-%m')-$(./travis/ha.sh travis/travis-base-ubuntu-386.Dockerfile)"
- secure: "B5IICA8MPx/FKaB50rTPqL8P1NU+Q0yuWl+lElL4+a9xSyLikfm3NzUPHoVwx8lNw2AVK6br7p0OmF7vMFjqAgrgc1cajTtEae5uFRKNUrWLpXM046YgNEYLLIHsQOjInxE+S4O6EFVzsUqsu8aeo2Xhq4sm4iUocG7e5isYgYo=" # DOCKER_PASS
- secure: "EIvrq8PG7lRjidppG0RCv4F0X4GP3DT9F5+ixVuGPfhK/hZT3jYC2AVY9G+NnUcXVwQEpW92rlqpftQ/qZ13FoyWokC8ZyoyD06fr5FPCfoFF3OczZwAJzZYkObI/hE9+/hXcylx/Os6N4INd2My1ntGk3JPsWL9riopod5EjSg=" # DOCKER_EMAIL
- secure: "hvhBunS4xXTgnIOsk/BPT7I7FrJhvVwCSt5PfxxvMqNaztOJI9BuK7ZrZ5Cy38KyHwlh3VHAH5AaCygJcPauoSQCV3bpnlbaWn3ruq2F0Q697Q5uNf73liXzyUqb9/Zvfvge4y4WWOhP5tVz1C6ZBe/NfhU7pqKLMA+6ads+99c=" # DOCKER_USER
- secure: "uJuuefmnJUuEH15ZD8xQilibx7EeBvMHBLoIZ8bgGHeleEImBD0XbD1ypvhYJKpviOmw5BkZmc9bVO8DGDEHYbSlIa2xDlF6vGrwgCEaxcMIhOAhv+dW9C/maJVieLOEPM01/fK2qdKESZaLvlopkWmxZwDyMObI9L7AMW9zQD8=" # BINTRAY_USER
- secure: "L3aPSNLySPXtWCW+xf8h/AAdquwNgxyTQpYOwexJmTPav82Qx8uQlp1yJkUmt+a+FLZDFfQeMivaHq0311RvuQVmkAJx49DjaddrwqOJut2UPsoVDn1WeuAcSHIXOq/0H+zgFMr/PGY0HXIsw1mTMhgheGJNqg09BvYWROCEAcA=" # BINTRAY_KEY
- secure: "sBMVn4C/WRWgoAytEFGx4CC5O55Q63h02AcuBnb1jXcBm0RenoBpzUPtxSseJwDPUA1o/UkuEDDjm3PosT5NF+dvED01VDFMsPVE11K0u6+avYy3jYXqyUEDW3G2o6Wo/2aqNjmd++8jskBdS9+Cx9gaFbgxfzSp0Yfu3oJm/4c=" # GH_TOKEN
install:
- if [ -a .git/shallow ]; then git fetch --unshallow; fi
- docker pull ${BASENAME} || ./travis/docker-build-and-push.sh
- docker pull ${BASENAME} || ./travis/docker-build-and-push.sh ${BASENAME} travis/travis-base.Dockerfile
- ./travis/skip-pkg.sh || docker pull ${BASENAME_UBUNTU} || ./travis/docker-build-and-push.sh ${BASENAME_UBUNTU} travis/travis-base-ubuntu.Dockerfile
- ./travis/skip-pkg.sh || docker pull ${BASENAME_386} || ./travis/docker-build-and-push.sh ${BASENAME_386} travis/travis-base-386.Dockerfile
- ./travis/skip-pkg.sh || docker pull ${BASENAME_UBUNTU_386} || ./travis/docker-build-and-push.sh ${BASENAME_UBUNTU_386} travis/travis-base-ubuntu-386.Dockerfile
script:
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-safe-wrappers.sh
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-formatting.sh
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC -e CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror" ${BASENAME} make all mans -j ASAN=1
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Werror"'
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-spelling.pl
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/run-tests.sh
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} ./travis/run-tests.sh
- ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/debian-build.sh deb/debian-amd64/DIST
- ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME_UBUNTU} ./travis/debian-build.sh deb/ubuntu-amd64/DIST
- ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME_386} linux32 ./travis/debian-build.sh deb/debian-i386/DIST
- ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME_UBUNTU_386} linux32 ./travis/debian-build.sh deb/ubuntu-i386/DIST
- ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/clang-analyze.sh
- ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/docs.sh
- ./travis/skip-pkg.sh || travis/prep-bintray.sh
deploy:
- provider: bintray
file: travis/bintray-autobuild-debian.json
user: $BINTRAY_USER
key: $BINTRAY_KEY
skip_cleanup: true
on:
branch: next
condition: $CC = gcc
- provider: bintray
file: travis/bintray-autobuild-ubuntu.json
user: $BINTRAY_USER
key: $BINTRAY_KEY
skip_cleanup: true
on:
branch: next
condition: $CC = gcc
- provider: script
script: travis/deploy-github-pages.sh
skip_cleanup: true
on:
branch: next
condition: $CC = gcc
after_deploy:
- travis/cleanup-bintray.pl i3-autobuild
- travis/cleanup-bintray.pl i3-autobuild-ubuntu

29
DEPENDS
View File

@ -4,28 +4,29 @@
"min" means minimum required version
"lkgv" means last known good version
┌──────────────┬────────┬────────┬────────────────────────────────────────┐
┌──────────────┬────────┬────────┬───────────────────────────────────────────────────────────
│ dependency │ min. │ lkgv │ URL │
├──────────────┼────────┼────────┼────────────────────────────────────────┤
│ pkg-config │ 0.25 │ 0.28 │ http://pkgconfig.freedesktop.org/
│ libxcb │ 1.1.93 │ 1.11 │ http://xcb.freedesktop.org/dist/
├──────────────┼────────┼────────┼───────────────────────────────────────────────────────────
│ pkg-config │ 0.25 │ 0.29 │ http://pkgconfig.freedesktop.org/
│ libxcb │ 1.1.93 │ 1.12 │ http://xcb.freedesktop.org/dist/
│ xcb-util │ 0.3.3 │ 0.4.1 │ http://xcb.freedesktop.org/dist/ │
│ xkbcommon │ 0.4.0 │ 0.5.0 │ http://xkbcommon.org/
│ xkbcommon-x11│ 0.4.0 │ 0.5.0 │ http://xkbcommon.org/
│ util-cursor³⁴│ 0.0.99 │ 0.1.2 │ http://xcb.freedesktop.org/dist/
│ xkbcommon │ 0.4.0 │ 0.6.1 │ http://xkbcommon.org/
│ xkbcommon-x11│ 0.4.0 │ 0.6.1 │ http://xkbcommon.org/
│ util-cursor³⁴│ 0.0.99 │ 0.1.3 │ http://xcb.freedesktop.org/dist/
│ util-wm⁴ │ 0.3.8 │ 0.3.8 │ http://xcb.freedesktop.org/dist/ │
│ util-keysyms⁴│ 0.3.8 │ 0.4.0 │ http://xcb.freedesktop.org/dist/ │
│ util-xrm⁴ │ 1.0.0 │ 1.0.0 │ https://github.com/Airblader/xcb-util-xrm │
│ libev │ 4.0 │ 4.19 │ http://libev.schmorp.de/ │
│ yajl │ 2.0.1 │ 2.1.0 │ http://lloyd.github.com/yajl/ │
│ asciidoc │ 8.3.0 │ 8.6.8 │ http://www.methods.co.nz/asciidoc/
│ asciidoc │ 8.3.0 │ 8.6.9 │ http://www.methods.co.nz/asciidoc/
│ xmlto │ 0.0.23 │ 0.0.23 │ http://www.methods.co.nz/asciidoc/ │
│ Pod::Simple² │ 3.22 │ 3.22 │ http://search.cpan.org/~dwheeler/Pod-Simple-3.23/
│ Pod::Simple² │ 3.22 │ 3.22 │ http://search.cpan.org/~dwheeler/Pod-Simple-3.23/
│ docbook-xml │ 4.5 │ 4.5 │ http://www.methods.co.nz/asciidoc/ │
│ PCRE │ 8.12 │ 8.35 │ http://www.pcre.org/
│ libsn¹ │ 0.10 │ 0.12 │ http://freedesktop.org/wiki/Software/startup-notification
│ pango │ 1.30.0 | 1.36.8 │ http://www.pango.org/
│ cairo │ 1.14.4 │ 1.14.4 │ http://cairographics.org/
└──────────────┴────────┴────────┴────────────────────────────────────────┘
│ PCRE │ 8.12 │ 8.38 │ http://www.pcre.org/
│ libsn¹ │ 0.10 │ 0.12 │ http://freedesktop.org/wiki/Software/startup-notification
│ pango │ 1.30.0 | 1.40.1 │ http://www.pango.org/
│ cairo │ 1.14.4 │ 1.14.6 │ http://cairographics.org/
└──────────────┴────────┴────────┴───────────────────────────────────────────────────────────
¹ libsn = libstartup-notification
² Pod::Simple is a Perl module required for converting the testsuite
documentation to HTML. See http://michael.stapelberg.de/cpan/#Pod::Simple

1
I3_VERSION Normal file
View File

@ -0,0 +1 @@
4.13-non-git

View File

@ -1,68 +0,0 @@
TOPDIR=$(shell pwd)
include $(TOPDIR)/common.mk
SUBDIRS:=
ALL_TARGETS =
INSTALL_TARGETS =
CLEAN_TARGETS =
DISTCLEAN_TARGETS =
all: real-all
include libi3/libi3.mk
include src/i3.mk
include i3-config-wizard/i3-config-wizard.mk
include i3-msg/i3-msg.mk
include i3-input/i3-input.mk
include i3-nagbar/i3-nagbar.mk
include i3bar/i3bar.mk
include i3-dump-log/i3-dump-log.mk
include docs/docs.mk
include man/man.mk
# Update $(TOPDIR)/LAST_VERSION if it differs from $I3_VERSION
CACHED_VERSION := '$(shell [ -f $(TOPDIR)/LAST_VERSION ] && cat $(TOPDIR)/LAST_VERSION)'
ifneq ($(CACHED_VERSION),$(I3_VERSION))
$(shell echo -n ${I3_VERSION} > $(TOPDIR)/LAST_VERSION)
endif
real-all: $(ALL_TARGETS)
install: $(INSTALL_TARGETS)
dist: distclean
[ ! -d i3-${VERSION} ] || rm -rf i3-${VERSION}
[ ! -e i3-${VERSION}.tar.bz2 ] || rm i3-${VERSION}.tar.bz2
mkdir i3-${VERSION}
cp i3-migrate-config-to-v4 i3-save-tree generate-command-parser.pl i3-sensible-* i3-dmenu-desktop i3.config.keycodes DEPENDS LICENSE PACKAGE-MAINTAINER RELEASE-NOTES-${VERSION} i3.config i3.xsession.desktop i3-with-shmlog.xsession.desktop i3.applications.desktop pseudo-doc.doxygen common.mk Makefile i3-${VERSION}
cp -r src libi3 i3-msg i3-nagbar i3-config-wizard i3bar i3-dump-log include man parser-specs testcases i3-${VERSION}
# Only copy toplevel documentation (important stuff)
mkdir i3-${VERSION}/docs
# Pre-generate documentation
$(MAKE) docs
# Cleanup τεχ output files
find docs -regex ".*\.\(aux\|out\|log\|toc\|bm\|dvi\|log\)" -exec rm '{}' \;
find docs -maxdepth 1 -type f ! \( -name "*.xcf" -or -name "*.svg" \) -exec cp '{}' i3-${VERSION}/docs \;
# Only copy source code from i3-input
mkdir i3-${VERSION}/i3-input
find i3-input -maxdepth 1 -type f \( -name "*.c" -or -name "*.mk" -or -name "*.h" -or -name "Makefile" \) -exec cp '{}' i3-${VERSION}/i3-input \;
echo -n ${I3_VERSION} > i3-${VERSION}/I3_VERSION
echo -n ${VERSION} > i3-${VERSION}/VERSION
# Pre-generate a manpage to allow distributors to skip this step and save some dependencies
$(MAKE) mans
cp man/*.1 i3-${VERSION}/man/
tar cfj i3-${VERSION}.tar.bz2 i3-${VERSION}
rm -rf i3-${VERSION}
clean: $(CLEAN_TARGETS)
(which lcov >/dev/null 2>&1 && lcov -d . --zerocounters) || true
distclean: clean $(DISTCLEAN_TARGETS)
coverage:
rm -f /tmp/i3-coverage.info
rm -rf /tmp/i3-coverage
lcov -d . -b . --capture -o /tmp/i3-coverage.info
genhtml -o /tmp/i3-coverage/ /tmp/i3-coverage.info

563
Makefile.am Normal file
View File

@ -0,0 +1,563 @@
@CODE_COVERAGE_RULES@
echo-version:
@echo "@I3_VERSION@"
bin_PROGRAMS = \
i3 \
i3bar/i3bar \
i3-config-wizard/i3-config-wizard \
i3-dump-log/i3-dump-log \
i3-input/i3-input \
i3-msg/i3-msg \
i3-nagbar/i3-nagbar
install-exec-hook:
$(LN_S) -f i3 $(DESTDIR)$(bindir)/i3-with-shmlog
uninstall-hook:
rm -f $(DESTDIR)$(bindir)/i3-with-shmlog
i3includedir=$(includedir)/i3
i3include_HEADERS = \
include/i3/ipc.h
dist_bin_SCRIPTS = \
i3-dmenu-desktop \
i3-migrate-config-to-v4 \
i3-save-tree \
i3-sensible-editor \
i3-sensible-pager \
i3-sensible-terminal
i3confdir = $(sysconfdir)/i3
dist_i3conf_DATA = \
etc/config \
etc/config.keycodes
applicationsdir = $(datarootdir)/applications
xsessionsdir = $(datarootdir)/xsessions
dist_applications_DATA = \
share/applications/i3.desktop
dist_xsessions_DATA = \
share/xsessions/i3.desktop \
share/xsessions/i3-with-shmlog.desktop
noinst_LIBRARIES = libi3.a
check_PROGRAMS = test.commands_parser test.config_parser
check_SCRIPTS = \
testcases/complete-run.pl
clean-check:
rm -rf testsuite-* latest i3-cfg-for-* _Inline
clean-local: clean-check
TESTS = testcases/complete-run.pl
EXTRA_DIST = \
$(dist_docs_toc_DATA:.html=) \
$(dist_docs_notoc_DATA:.html=) \
docs/asciidoc-git.conf \
docs/bigpicture.png \
docs/i3-pod2html \
docs/i3-sync.dia \
docs/i3-sync.png \
docs/i3-sync-working.dia \
docs/i3-sync-working.png \
docs/keyboard-layer1.png \
docs/keyboard-layer2.png \
docs/layout-saving-1.png \
docs/logo-30.png \
docs/modes.png \
docs/refcard.html \
docs/refcard_style.css \
docs/single_terminal.png \
docs/snapping.png \
docs/tree-layout1.png \
docs/tree-layout2.png \
docs/tree-shot1.png \
docs/tree-shot2.png \
docs/tree-shot3.png \
docs/tree-shot4.png \
docs/two_columns.png \
docs/two_terminals.png \
docs/wsbar.dia \
docs/wsbar.png \
i3bar/LICENSE \
libi3/README \
$(asciidoc_MANS:.1=.man) \
$(asciidoc_MANS:.1=.man) \
man/asciidoc.conf.in \
DEPENDS \
I3_VERSION \
LICENSE \
PACKAGE-MAINTAINER \
RELEASE-NOTES-4.13 \
generate-command-parser.pl \
parser-specs/commands.spec \
parser-specs/config.spec \
parser-specs/highlighting.vim \
pseudo-doc.doxygen \
testcases/complete-run.pl.in \
testcases/i3-test.config \
testcases/lib/i3test/Test.pm \
testcases/lib/i3test/Util.pm \
testcases/lib/i3test/XTEST.pm \
testcases/lib/i3test.pm.in \
testcases/lib/SocketActivation.pm \
testcases/lib/StartXServer.pm \
testcases/lib/StatusLine.pm \
testcases/lib/TestWorker.pm \
testcases/Makefile.PL \
testcases/new-test \
testcases/restart-state.golden \
testcases/t \
testcases/valgrind.supp
# dirstamps contains directories which we want to be created in $(top_builddir)
# so that our custom rules can store files in them.
dirstamp = .dirstamp
dirstamps = \
docs/$(dirstamp) \
man/$(dirstamp) \
parser/$(dirstamp)
DISTCLEANFILES = $(dirstamps)
$(dirstamps):
@stamp='$@'; $(MKDIR_P) "$${stamp%/*}"
@: > $@
################################################################################
# docs generation
################################################################################
docs_tocdir = ${docdir}
docs_notocdir = ${docdir}
docs_poddir = ${docdir}
if BUILD_DOCS
dist_docs_toc_DATA = \
docs/hacking-howto.html \
docs/userguide.html \
docs/ipc.html \
docs/multi-monitor.html \
docs/wsbar.html \
docs/testsuite.html \
docs/i3bar-protocol.html \
docs/layout-saving.html
dist_docs_notoc_DATA = \
docs/debugging.html
dist_docs_pod_DATA = \
docs/lib-i3test.html \
docs/lib-i3test-test.html
$(dist_docs_toc_DATA): docs/%.html: docs/% docs/$(dirstamp)
$(AM_V_GEN) @PATH_ASCIIDOC@ -a toc -n -o $@ $<
$(dist_docs_notoc_DATA): docs/%.html: docs/% docs/$(dirstamp)
$(AM_V_GEN) @PATH_ASCIIDOC@ -n -o $@ $<
docs/lib-i3test.html: testcases/lib/i3test.pm docs/$(dirstamp)
$(AM_V_GEN) $(top_srcdir)/docs/i3-pod2html $< $@
docs/lib-i3test-test.html: testcases/lib/i3test/Test.pm docs/$(dirstamp)
$(AM_V_GEN) $(top_srcdir)/docs/i3-pod2html $< $@
else
dist_docs_toc_DATA =
dist_docs_notoc_DATA =
dist_docs_pod_DATA =
endif
################################################################################
# manpage generation
################################################################################
if BUILD_MANS
dist_man1_MANS = \
$(asciidoc_MANS) \
$(pod_MANS)
asciidoc_MANS = \
man/i3.1 \
man/i3bar.1 \
man/i3-msg.1 \
man/i3-input.1 \
man/i3-nagbar.1 \
man/i3-config-wizard.1 \
man/i3-migrate-config-to-v4.1 \
man/i3-sensible-editor.1 \
man/i3-sensible-pager.1 \
man/i3-sensible-terminal.1 \
man/i3-dump-log.1
pod_MANS = \
man/i3-dmenu-desktop.1 \
man/i3-save-tree.1
$(asciidoc_MANS): man/%.1: man/%.xml man/$(dirstamp)
$(AM_V_GEN) out='$@'; @PATH_XMLTO@ man -o "$${out%/*}" $<
@stamp='$@'; $(MKDIR_P) "$${stamp%/*}"
man/%.xml: man/%.man man/asciidoc.conf man/$(dirstamp)
$(AM_V_GEN) @PATH_ASCIIDOC@ -d manpage -b docbook -f $(top_builddir)/man/asciidoc.conf -o $@ $<
$(pod_MANS): man/%.1: % man/$(dirstamp)
$(AM_V_GEN) @PATH_POD2MAN@ --utf8 $< > $@
else
asciidoc_MANS =
endif
AM_CPPFLAGS = \
-I$(top_builddir)/parser \
-I$(top_srcdir)/include \
@AX_EXTEND_SRCDIR_CPPFLAGS@
i3_CFLAGS = \
$(AM_CFLAGS) \
$(libi3_CFLAGS) \
$(LIBSN_CFLAGS) \
$(XCB_CFLAGS) \
$(XCB_UTIL_CURSOR_CFLAGS) \
$(XCB_UTIL_KEYSYM_CFLAGS) \
$(XCB_UTIL_WM_CFLAGS) \
$(XCB_UTIL_XRM_CFLAGS) \
$(XKBCOMMON_CFLAGS) \
$(YAJL_CFLAGS) \
$(LIBPCRE_CFLAGS) \
$(PTHREAD_CFLAGS) \
$(CODE_COVERAGE_CFLAGS)
i3_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(CODE_COVERAGE_CPPFLAGS)
i3_LDADD = \
$(libi3_LIBS) \
$(LIBSN_LIBS) \
$(XCB_LIBS) \
$(XCB_UTIL_CURSOR_LIBS) \
$(XCB_UTIL_KEYSYMS_LIBS) \
$(XCB_UTIL_WM_LIBS) \
$(XCB_UTIL_XRM_LIBS) \
$(XKBCOMMON_LIBS) \
$(YAJL_LIBS) \
$(LIBPCRE_LIBS) \
$(PANGOCAIRO_LIBS) \
$(PTHREAD_LIBS) \
$(CODE_COVERAGE_LDFLAGS)
libi3_CFLAGS = \
$(AM_CFLAGS) \
$(XCB_CFLAGS) \
$(XCB_UTIL_CFLAGS) \
$(XCB_UTIL_XRM_CFLAGS) \
$(YAJL_CFLAGS) \
$(PANGOCAIRO_CFLAGS)
libi3_LIBS = \
$(top_builddir)/libi3.a \
$(XCB_LIBS) \
$(XCB_UTIL_LIBS) \
$(XCB_UTIL_XRM_LIBS) \
$(YAJL_LIBS) \
$(PANGOCAIRO_LIBS)
libi3_a_CFLAGS = \
$(libi3_CFLAGS)
libi3_a_SOURCES = \
include/libi3.h \
libi3/dpi.c \
libi3/draw_util.c \
libi3/fake_configure_notify.c \
libi3/font.c \
libi3/format_placeholders.c \
libi3/get_colorpixel.c \
libi3/get_config_path.c \
libi3/get_exe_path.c \
libi3/get_mod_mask.c \
libi3/get_process_filename.c \
libi3/get_visualtype.c \
libi3/ipc_connect.c \
libi3/ipc_recv_message.c \
libi3/ipc_send_message.c \
libi3/is_debug_build.c \
libi3/mkdirp.c \
libi3/resolve_tilde.c \
libi3/root_atom_contents.c \
libi3/safewrappers.c \
libi3/string.c \
libi3/strndup.c \
libi3/ucs2_conversion.c
i3_dump_log_i3_dump_log_CFLAGS = \
$(AM_CFLAGS) \
$(PTHREAD_CFLAGS) \
$(libi3_CFLAGS)
i3_dump_log_i3_dump_log_LDADD = \
$(PTHREAD_LIBS) \
$(libi3_LIBS)
i3_dump_log_i3_dump_log_SOURCES = \
i3-dump-log/main.c
i3_input_i3_input_CFLAGS = \
$(AM_CFLAGS) \
$(libi3_CFLAGS)
i3_input_i3_input_LDADD = \
$(libi3_LIBS) \
$(XCB_UTIL_KEYSYMS_LIBS)
i3_input_i3_input_SOURCES = \
i3-input/i3-input.h \
i3-input/keysym2ucs.c \
i3-input/keysym2ucs.h \
i3-input/main.c
i3_msg_i3_msg_CFLAGS = \
$(AM_CFLAGS) \
$(libi3_CFLAGS)
i3_msg_i3_msg_LDADD = \
$(libi3_LIBS)
i3_msg_i3_msg_SOURCES = \
i3-msg/main.c
i3_nagbar_i3_nagbar_CFLAGS = \
$(AM_CFLAGS) \
$(libi3_CFLAGS)
i3_nagbar_i3_nagbar_LDADD = \
$(libi3_LIBS) \
$(XCB_UTIL_CURSOR_LIBS)
i3_nagbar_i3_nagbar_SOURCES = \
i3-nagbar/atoms.xmacro \
i3-nagbar/i3-nagbar.h \
i3-nagbar/main.c
i3bar_i3bar_CPPFLAGS = \
$(AM_CPPFLAGS) \
-I$(top_srcdir)/i3bar/include
i3bar_i3bar_CFLAGS = \
$(AM_CFLAGS) \
$(libi3_CFLAGS) \
$(XCB_CFLAGS) \
$(XKBCOMMON_CFLAGS) \
$(PANGOCAIRO_CFLAGS) \
$(YAJL_CFLAGS)
i3bar_i3bar_LDADD = \
$(libi3_LIBS) \
$(XCB_LIBS) \
$(XCB_UTIL_CURSOR_LIBS) \
$(XKBCOMMON_LIBS) \
$(PANGOCAIRO_LIBS) \
$(YAJL_LIBS)
i3bar_i3bar_SOURCES = \
i3bar/include/child.h \
i3bar/include/common.h \
i3bar/include/configuration.h \
i3bar/include/ipc.h \
i3bar/include/mode.h \
i3bar/include/outputs.h \
i3bar/include/parse_json_header.h \
i3bar/include/trayclients.h \
i3bar/include/util.h \
i3bar/include/workspaces.h \
i3bar/include/xcb_atoms.def \
i3bar/include/xcb.h \
i3bar/src/child.c \
i3bar/src/config.c \
i3bar/src/ipc.c \
i3bar/src/main.c \
i3bar/src/mode.c \
i3bar/src/outputs.c \
i3bar/src/parse_json_header.c \
i3bar/src/workspaces.c \
i3bar/src/xcb.c
i3_config_wizard_i3_config_wizard_CFLAGS = \
$(AM_CFLAGS) \
$(libi3_CFLAGS) \
$(XKBCOMMON_CFLAGS)
i3_config_wizard_i3_config_wizard_LDADD = \
$(libi3_LIBS) \
$(XCB_UTIL_KEYSYMS_LIBS) \
$(XKBCOMMON_LIBS)
i3_config_wizard_i3_config_wizard_SOURCES = \
i3-config-wizard/atoms.xmacro \
i3-config-wizard/main.c \
i3-config-wizard/xcb.h
test_commands_parser_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DTEST_PARSER
test_commands_parser_CFLAGS = \
$(AM_CFLAGS) \
$(i3_CFLAGS)
test_commands_parser_SOURCES = \
src/commands_parser.c
test_commands_parser_LDADD = \
$(i3_LDADD)
test_config_parser_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DTEST_PARSER
test_config_parser_CFLAGS = \
$(AM_CFLAGS) \
$(i3_CFLAGS)
test_config_parser_SOURCES = \
src/config_parser.c
test_config_parser_LDADD = \
$(i3_LDADD)
command_parser_SOURCES = \
parser/GENERATED_command_enums.h \
parser/GENERATED_command_tokens.h \
parser/GENERATED_command_call.h
config_parser_SOURCES = \
parser/GENERATED_config_enums.h \
parser/GENERATED_config_tokens.h \
parser/GENERATED_config_call.h
i3_SOURCES = \
$(command_parser_SOURCES) \
$(config_parser_SOURCES) \
include/all.h \
include/assignments.h \
include/atoms_NET_SUPPORTED.xmacro \
include/atoms_rest.xmacro \
include/atoms.xmacro \
include/bindings.h \
include/click.h \
include/cmdparse.h \
include/commands.h \
include/commands_parser.h \
include/config_directives.h \
include/configuration.h \
include/config_parser.h \
include/con.h \
include/data.h \
include/debug.h \
include/display_version.h \
include/ewmh.h \
include/fake_outputs.h \
include/floating.h \
include/handlers.h \
include/i3.h \
include/ipc.h \
include/key_press.h \
include/load_layout.h \
include/log.h \
include/main.h \
include/manage.h \
include/match.h \
include/move.h \
include/output.h \
include/queue.h \
include/randr.h \
include/regex.h \
include/render.h \
include/resize.h \
include/restore_layout.h \
include/scratchpad.h \
include/sd-daemon.h \
include/shmlog.h \
include/sighandler.h \
include/startup.h \
include/tree.h \
include/util.h \
include/window.h \
include/workspace.h \
include/xcb.h \
include/xcursor.h \
include/x.h \
include/xinerama.h \
include/yajl_utils.h \
src/assignments.c \
src/bindings.c \
src/click.c \
src/commands.c \
src/commands_parser.c \
src/con.c \
src/config.c \
src/config_directives.c \
src/config_parser.c \
src/debug.c \
src/display_version.c \
src/ewmh.c \
src/fake_outputs.c \
src/floating.c \
src/handlers.c \
src/ipc.c \
src/key_press.c \
src/load_layout.c \
src/log.c \
src/main.c \
src/manage.c \
src/match.c \
src/move.c \
src/output.c \
src/randr.c \
src/regex.c \
src/render.c \
src/resize.c \
src/restore_layout.c \
src/scratchpad.c \
src/sd-daemon.c \
src/sighandler.c \
src/startup.c \
src/tree.c \
src/util.c \
src/version.c \
src/window.c \
src/workspace.c \
src/x.c \
src/xcb.c \
src/xcursor.c \
src/xinerama.c
################################################################################
# parser generation
################################################################################
$(command_parser_SOURCES): %.h: i3-command-parser.stamp
$(config_parser_SOURCES): %.h: i3-config-parser.stamp
src/i3-commands_parser.$(OBJEXT): i3-command-parser.stamp
src/i3-config_parser.$(OBJEXT): i3-config-parser.stamp
i3-command-parser.stamp: parser/$(dirstamp) generate-command-parser.pl parser-specs/commands.spec
$(AM_V_GEN) $(top_srcdir)/generate-command-parser.pl --input=$(top_srcdir)/parser-specs/commands.spec --prefix=command
$(AM_V_at) mv GENERATED_command_* $(top_builddir)/parser
$(AM_V_at) touch $@
i3-config-parser.stamp: parser/$(dirstamp) generate-command-parser.pl parser-specs/config.spec
$(AM_V_GEN) $(top_srcdir)/generate-command-parser.pl --input=$(top_srcdir)/parser-specs/config.spec --prefix=config
$(AM_V_at) mv GENERATED_config_* $(top_builddir)/parser
$(AM_V_at) touch $@
CLEANFILES = \
i3-command-parser.stamp \
i3-config-parser.stamp

View File

@ -23,14 +23,10 @@ x-terminal-emulator symlink in Debian, please use it in i3-sensible-terminal.
On debian, compilation and installing the manpages looks like this:
# Compilation
$(MAKE)
$(MAKE) -C man
# Installation
$(MAKE) DESTDIR=$(CURDIR)/debian/i3-wm/ install
mkdir -p $(CURDIR)/debian/i3-wm/usr/share/man/man1
cp man/*.1 $(CURDIR)/debian/i3-wm/usr/share/man/man1
autoreconf -fi
mkdir -p build && cd build
../configure
make -j8 install
Please make sure that i3-migrate-config-to-v4 and i3-config-wizard are
installed with i3. The Perl script is necessary to (automatically) convert v3
@ -42,7 +38,7 @@ If you have any questions, ideas, hints, problems or whatever, please do not
hesitate to contact me. I will help you out. Just drop me an E-Mail (find the
address at https://michael.stapelberg.de/Impressum/, scroll down to bottom),
contact me using the same address in jabber or ask on our IRC channel:
(#i3 on irc.twice-irc.de).
(#i3 on irc.freenode.net).
Thanks again for your efforts,
Michael

View File

@ -1,132 +0,0 @@
┌────────────────────────────┐
│ Release notes for i3 v4.12 │
└────────────────────────────┘
This is i3 v4.12. This version is considered stable. All users of i3 are
strongly encouraged to upgrade.
If cairo ≥ 1.14.4 is available, i3 and i3bar will use cairo for rendering
(instead of raw X11 drawing primitives). While this is currently optional,
having cairo ≥ 1.14.4 will be a hard requirement in future release.
This release contains a good number of detail improvements and fixes.
┌────────────────────────────┐
│ Changes in i3 v4.12 │
└────────────────────────────┘
• use https instead of git/http, update contact information, add GPG key
• docs/hacking-howto: fix old cfgparse.y reference to config_parser.c
• docs/ipc: added link to i3ipcpp (C++ library)
• docs/userguide: clarify no_focus documentation
• docs/userguide: add documentation for binding modes
• docs/userguide: fix rendering of __focused__
• docs/userguide: improve placement of explicit IDs for headings
• docs/userguide: make rendering of key bindings more consistent
• docs/userguide: clarify quoting of “exec” commands
• man/i3-nagbar: fix example invocation
• man/i3: add “floating window” to terminology
• i3-sensible-*: quote variables correctly
• i3-sensible-editor: add neovim
• i3-sensible-terminal: add termit, st
• i3bar: use cairo for all drawing operations
• i3bar: support per-statusblock border and background colors
• i3bar: support different bar background colors depending on whether the bar
is on the focused output or not
• i3bar: multiple tray_output directives on the same bar are now supported
• i3bar: support disabling the modifier by specifying “modifier none”
• use cairo for all drawing operations
• fix a number of memory leaks, thanks to AddressSanitizer
• no_focus is now suppressed for the first window of a workspace
• “workspace next/prev” now looks for numbered workspaces after reaching the
last workspace (it used to incorrectly only look at named workspaces)
• multiple marks can now be set on a single window (but a mark can still only
be present on one window at a time)
• the “unmark” command now supports criteria
• the “con_id” criterion now supports the special value __focused__
• the “workspace” command now supports the --no-auto-back-and-forth parameter
• the “move window to workspace” command now supports the
--no-auto-back-and-forth parameter
• the “resize grow|shrink width|height” command now works for a nested split
in the same direction
• support _NET_WM_USER_TIMEs special 0 value, indicating that a window
should not be focused
• use 32-bit visual by default if available. This reduces graphical glitches
when using transparency (which is still not officially supported)
• the “move position center” command now supports criteria
• specifying invalid match criteria now results in an error instead of
blindly applying the operation to the currently focused window
• allow mouse bindings to run on the root window
• support matching _NET_WM_WINDOW_TYPE_NOTIFICATION in criteria
• all criteria are now matched, even when con_id or con_mark are given (used
to be a special case)
• allow the “id” criterion to be specified in any base recognized by
strtol(), not only base 10
• non-true color displays are now supported again (e.g. the Raspberry Pi)
• the “split” command now has a “toggle” option
• the additional color class “decoration_border” was added
• title_format is now stored on containers instead of windows, allowing the
use of title_format on split containers
• On OpenBSD, i3 now uses pledge(2)
• support _NET_WM_DESKTOP (for pager applications like gnome-panel)
• floating workspaces are no longer available (they were not supported for a
while now)
• floating windows now carry the I3_FLOATING_WINDOW atom so that tools like
compositors can be configured to match on floating windows
┌────────────────────────────┐
│ Bugfixes │
└────────────────────────────┘
• i3bar: display short text only on the monitor(s) on which it is necessary
• i3bar: explicitly set cursor using libxcb-cursor if available
• i3bar: fix XEMBED messages
• i3-nagbar: explicitly set cursor using libxcb-cursor if available
• duplicated keybindings are now also detected when one uses bindcode but the
other(s) use(s) bindsym
• keymap fallback for servers without XKB (e.g. TightVNC) has been added
• using pango markup in mode names is now optional, fixing a regression in i3
v4.11 where modes which contained characters such as “<” would break.
• moving windows to a workspace by specifying a mark now works
• the root output is now used when any RandR request fails (for x2go)
• assignments are now marked as run before executing them, preventing endless
loops/crashes when assignments cause another assignment evaluation
• splitting/floating a dock container no longer crashes i3
• correctly compare modifier mask when identifying keybindings (fixes
bindings which use --release)
• no longer fail config validation when there is no newline at the end of
the config file
• scrollwheel buttons are now only grabbed when necessary, allowing the use
of “bindsym button*” or scrolling in windows without focusing them (in case
no “bindsym button*” is present)
• parse con_id in base 16 (affected FreeBSD only)
• fix crash when opening a large number of windows
• reject empty swallow definitions to avoid crashes
• dont remove SubstructureRedirect event mask temporarily (fixes i3bar
stopping after system suspend)
• move urgent flag before killing the parent to avoid a crash
• correctly validate “kill” command to avoid crashing when “kill” is invoked
on workspace containers
• actually accept the documented “workspace” token as an alternative to “→”
in assign statements
• remove _NET_WM_STATE on withdrawn windows to comply with the spec
• the “border” command now uses logical pixels (relevant for hi-dpi displays)
• “tray_output primary” does not properly fall back and hence was removed
from the default config again
• correctly determine focused workspace when moving workspace to output
• revert to default binding mode before reloading the config file
• correctly interpret _MOTIF_WM_HINTS (endianness-dependent)
┌────────────────────────────┐
│ Thanks! │
└────────────────────────────┘
Thanks for testing, bugfixes, discussions and everything I forgot go out to:
Adaephon, Airblader, Alexis211, bendem, botovq, brianmillar, DavidMikeSimon,
dcoppa, Florian Merkel, fmthoma, frederik, hwangcc23, jolange, Juuso
Lapinlampi, kneitinger, lotheac, nicklan, norrland, pra85, romanblanco,
sur5r, tbu-, tyll, wodny
-- Michael Stapelberg, 2016-03-06

114
RELEASE-NOTES-4.13 Normal file
View File

@ -0,0 +1,114 @@
┌────────────────────────────┐
│ Release notes for i3 v4.13 │
└────────────────────────────┘
This is i3 v4.13. This version is considered stable. All users of i3 are
strongly encouraged to upgrade.
For users, there are two changes to be aware of:
1. The X server DPI is read from the Xft.dpi X resource (if available).
Previously, i3 used to directly look at the X servers DPI (based on screen
resolution and physical size). Looking at Xft.dpi is more consistent with
other software, more likely to be correct (because its user-specified and
not read from possibly broken hardware information) and allows users to
override the value.
2. It is now possible to set config file variables from X resources using the
“set_from_resource” directive. This allows users to have a single source of
truth for e.g. theming X11 applications (specify “*color0: #121212” and have
it apply to URxvt and your i3 config).
For packagers, there are three changes that likely require action:
1. cairo/pango are now required dependencies, as announced in the i3 v4.12
release notes.
2. The aforementioned “set_from_resource” feature requires the new dependency
libxcb-util-xrm.
3. i3 now uses the GNU build system (autotools). Please see
https://github.com/i3/i3/commit/4a52a7e9fb6fb2e1f0256b2e086cfa313f411cd8 for
a lot more details about the rationale and what this means for your package.
Bottomline, things should get simpler for you, though :).
┌────────────────────────────┐
│ Changes in i3 v4.13 │
└────────────────────────────┘
• build: wire up version handling for non-release tarballs (as opposed to git
checkouts)
• build: switch to the GNU build system
• i3bar: disable pango markup for plain-text input
• man/i3-msg: point out default ipc message type
• config: introduce support for specifying variables from X resources
• config: ensure variables match on longest-length, eliminating problems
where one variable was a prefix of another
• config: do not count '\' in comment lines as line continuation
• ipc: introduce a new GET_BINDING_MODES command
• ipc: implement new window::mark event
• ipc: add “output” to IPC events referencing a container
• make fullscreen windows open on the output which is indicated by their
geometry (fixes LibreOffice Impress multi-monitor presentations)
• focus newly managed windows only if they dont use the globally active
input mode (fixes issues with RubyMine)
• remove title indentation in nested containers (rationale was unclear,
nobody spoke up when we asked about the feature on i3-discuss)
• use the last known timestamp when calling xcb_set_input_focus (might fix
rare race conditions in focus handling)
• introduce the “smart” option for hide_edge_borders, which will hide borders
when there is precisely one window on the workspace
• handle _MOTIF_WM_HINTS changes (_MOTIF_WM_HINTS were previously only
considered when managing a new window)
• dont change border style if BS_NORMAL is requested in _MOTIF_WM_HINTS
• only add numlock fallback for keybindings where necessary (allows users to
correctly bind keys on the numpad)
• do not match docks in config and command criteria
• get DPI from the Xft.dpi resource instead of directly looking at the screen
resolution/size
• handle _NET_ACTIVE_WINDOW for scratchpad windows (for pagers)
• set _NET_WM_DESKTOP to sticky for scratchpad windows
• add new criteria “tiling” and “floating”
• implement special output name “current” for commands
• handle ResizeRequests for tray clients (fixes VLC tray icon)
┌────────────────────────────┐
│ Bugfixes │
└────────────────────────────┘
• i3bar: fix crash when the I3SOCK environment variable is present
• i3-dmenu-desktop: do not die on failed open
• i3-input: properly position in non-standard cases (fixes an issue where
i3-input would launch off-screen)
• i3-save-tree: rename “mark” to “marks” to reflect our recent change to
allow multiple marks
• mouse bindings: only grab the mouse buttons that need to be grabbed
• no_focus: correctly count the number of windows (makes no_focus work with
tabbed/stacked workspace layouts).
• properly close disabled outputs restored during a restart (this fixes state
handling when RandR changes happen during i3 restarts)
• dont trigger bindings on window border clicks unless --border was
specified for the binding
• traverse numbered workspaces in correct order
• fix transition from named to numbered workspaces in “workspace next|prev”
• avoid setting urgency hint on content containers and above (fixes crashes)
• dont trigger unrelated key bindings for --release bindings
• fix colormap handling for containers (fixes taking screenshots using xwd)
• check output crossing on ENTER_NOTIFY to dockarea (fixes pointer jumping)
• fix a use-after-free bug (fixes “floating enable” on single split windows)
┌────────────────────────────┐
│ Thanks! │
└────────────────────────────┘
Thanks for testing, bugfixes, discussions and everything I forgot go out to:
Benedikt Heine, Cedric Buissart, Chih-Chyuan Hwang, Denton Liu, eplanet, Eric
Engeström, EvilPudding, Ferdinand Bachmann, Hong, Ingo Bürk, Jakob Schnell,
Jakub Wilk, johannes karoff, Johannes Lange, joshrosso, Julien Lequertier,
Kacper Kowalik, Kenneth Lyons, Kyle Kneitinger, madroach, Michael Vetter,
Nathan Schulte, Øsse, Peder Stray, Tony Crisci, Trevor Merrifield, wentasah,
yshui, Zamarin Arthur
-- Michael Stapelberg, 2016-11-08

218
common.mk
View File

@ -1,218 +0,0 @@
UNAME=$(shell uname)
DEBUG=1
ASAN=0
INSTALL=install
LN=ln
PKG_CONFIG=pkg-config
ifndef PREFIX
PREFIX=/usr
endif
ifndef EXEC_PREFIX
EXEC_PREFIX=$(PREFIX)
endif
ifndef SYSCONFDIR
ifeq ($(PREFIX),/usr)
SYSCONFDIR=/etc
else
SYSCONFDIR=$(PREFIX)/etc
endif
endif
# In dist tarballs, the version is stored in the I3_VERSION and VERSION files.
I3_VERSION := '$(shell [ -f $(TOPDIR)/I3_VERSION ] && cat $(TOPDIR)/I3_VERSION)'
VERSION := '$(shell [ -f $(TOPDIR)/VERSION ] && cat $(TOPDIR)/VERSION)'
ifeq ('',$(I3_VERSION))
VERSION := $(shell git describe --tags --abbrev=0)
I3_VERSION := '$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1), branch \"$(shell git describe --tags --always --all | sed s:heads/::)\")'
endif
MAJOR_VERSION := $(shell echo ${VERSION} | cut -d '.' -f 1)
MINOR_VERSION := $(shell echo ${VERSION} | cut -d '.' -f 2)
PATCH_VERSION := $(shell echo ${VERSION} | cut -d '.' -f 3)
ifeq (${PATCH_VERSION},)
PATCH_VERSION := 0
endif
## Generic flags
# Default CFLAGS that users should be able to override
ifeq ($(DEBUG),1)
# Extended debugging flags, macros shall be available in gcc
CFLAGS ?= -pipe -gdwarf-2 -g3
else
CFLAGS ?= -pipe -O2 -freorder-blocks-and-partition
endif
ifeq ($(ASAN),1)
CFLAGS += -fsanitize=address -DI3_ASAN_ENABLED
LDFLAGS += -fsanitize=address
endif
# Default LDFLAGS that users should be able to override
LDFLAGS ?= $(as_needed_LDFLAG)
# Common CFLAGS for all i3 related binaries
I3_CFLAGS = -std=c99
I3_CFLAGS += -Wall
# unused-function, unused-label, unused-variable are turned on by -Wall
# We dont want unused-parameter because of the use of many callbacks
I3_CFLAGS += -Wunused-value
I3_CFLAGS += -Iinclude
I3_CPPFLAGS = -DI3_VERSION=\"${I3_VERSION}\"
I3_CPPFLAGS += -DMAJOR_VERSION=${MAJOR_VERSION}
I3_CPPFLAGS += -DMINOR_VERSION=${MINOR_VERSION}
I3_CPPFLAGS += -DPATCH_VERSION=${PATCH_VERSION}
I3_CPPFLAGS += -DSYSCONFDIR=\"${SYSCONFDIR}\"
I3_CPPFLAGS += -DI3__FILE__=__FILE__
## Libraries flags
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null 1>/dev/null || echo 1),1)
$(error "pkg-config was not found")
endif
# An easier way to get CFLAGS and LDFLAGS falling back in case there's
# no pkg-config support for certain libraries.
#
# NOTE that you must not use a blank after comma when calling this:
# $(call ldflags_for_lib name, fallback) # bad
# $(call ldflags_for_lib name,fallback) # good
# Otherwise, the compiler will get -l foo instead of -lfoo
#
# We redirect stderr to /dev/null because pkg-config prints an error if support
# for gnome-config was enabled but gnome-config is not actually installed.
cflags_for_lib = $(shell $(PKG_CONFIG) --silence-errors --cflags $(1) 2>/dev/null)
ldflags_for_lib = $(shell $(PKG_CONFIG) --exists 2>/dev/null $(1) && $(PKG_CONFIG) --libs $(1) 2>/dev/null || echo -l$(2))
# XCB common stuff
XCB_CFLAGS := $(call cflags_for_lib, xcb)
XCB_CFLAGS += $(call cflags_for_lib, xcb-event)
XCB_LIBS := $(call ldflags_for_lib, xcb,xcb)
XCB_LIBS += $(call ldflags_for_lib, xcb-event,xcb-event)
ifeq ($(shell $(PKG_CONFIG) --exists xcb-util 2>/dev/null || echo 1),1)
XCB_CFLAGS += $(call cflags_for_lib, xcb-atom)
XCB_CFLAGS += $(call cflags_for_lib, xcb-aux)
XCB_LIBS += $(call ldflags_for_lib, xcb-atom,xcb-atom)
XCB_LIBS += $(call ldflags_for_lib, xcb-aux,xcb-aux)
XCB_CPPFLAGS+= -DXCB_COMPAT
else
XCB_CFLAGS += $(call cflags_for_lib, xcb-util)
XCB_LIBS += $(call ldflags_for_lib, xcb-util)
endif
XCB_XKB_LIBS := $(call ldflags_for_lib, xcb-xkb,xcb-xkb)
# XCB keyboard stuff
XCB_KBD_CFLAGS := $(call cflags_for_lib, xcb-keysyms)
XCB_KBD_LIBS := $(call ldflags_for_lib, xcb-keysyms,xcb-keysyms)
# XCB WM stuff
XCB_WM_CFLAGS := $(call cflags_for_lib, xcb-icccm)
XCB_WM_CFLAGS += $(call cflags_for_lib, xcb-xinerama)
XCB_WM_CFLAGS += $(call cflags_for_lib, xcb-randr)
XCB_WM_LIBS := $(call ldflags_for_lib, xcb-icccm,xcb-icccm)
XCB_WM_LIBS += $(call ldflags_for_lib, xcb-xinerama,xcb-xinerama)
XCB_WM_LIBS += $(call ldflags_for_lib, xcb-randr,xcb-randr)
# XCB cursor
XCB_CURSOR_CFLAGS := $(call cflags_for_lib, xcb-cursor)
XCB_CURSOR_LIBS := $(call ldflags_for_lib, xcb-cursor,xcb-cursor)
XKB_COMMON_CFLAGS := $(call cflags_for_lib, xkbcommon,xkbcommon)
XKB_COMMON_LIBS := $(call ldflags_for_lib, xkbcommon,xkbcommon)
XKB_COMMON_X11_CFLAGS := $(call cflags_for_lib, xkbcommon-x11,xkbcommon-x11)
XKB_COMMON_X11_LIBS := $(call ldflags_for_lib, xkbcommon-x11,xkbcommon-x11)
# yajl
YAJL_CFLAGS := $(call cflags_for_lib, yajl)
YAJL_LIBS := $(call ldflags_for_lib, yajl,yajl)
#libev
LIBEV_CFLAGS := $(call cflags_for_lib, libev)
LIBEV_LIBS := $(call ldflags_for_lib, libev,ev)
# libpcre
PCRE_CFLAGS := $(call cflags_for_lib, libpcre)
ifeq ($(shell $(PKG_CONFIG) --atleast-version=8.10 libpcre 2>/dev/null && echo 1),1)
I3_CPPFLAGS += -DPCRE_HAS_UCP=1
endif
PCRE_LIBS := $(call ldflags_for_lib, libpcre,pcre)
# startup-notification
LIBSN_CFLAGS := $(call cflags_for_lib, libstartup-notification-1.0)
LIBSN_LIBS := $(call ldflags_for_lib, libstartup-notification-1.0,startup-notification-1)
# Pango
PANGO_CFLAGS := $(call cflags_for_lib, cairo)
PANGO_CFLAGS += $(call cflags_for_lib, pangocairo)
I3_CPPFLAGS += -DPANGO_SUPPORT=1
ifeq ($(shell $(PKG_CONFIG) --atleast-version=1.14.4 cairo 2>/dev/null && echo 1),1)
I3_CPPFLAGS += -DCAIRO_SUPPORT=1
endif
PANGO_LIBS := $(call ldflags_for_lib, cairo)
PANGO_LIBS += $(call ldflags_for_lib, pangocairo)
# libi3
LIBS = -L$(TOPDIR) -li3 -lm
## Platform-specific flags
# Please test if -Wl,--as-needed works on your platform and send me a patch.
# it is known not to work on Darwin (Mac OS X)
ifneq (,$(filter Linux GNU GNU/%, $(UNAME)))
as_needed_LDFLAG = -Wl,--as-needed
endif
ifeq ($(UNAME),NetBSD)
# We need -idirafter instead of -I to prefer the systems iconv over GNU libiconv
I3_CFLAGS += -idirafter /usr/pkg/include
I3_LDFLAGS += -Wl,-rpath,/usr/local/lib -Wl,-rpath,/usr/pkg/lib
endif
ifeq ($(UNAME),OpenBSD)
I3_CFLAGS += -I${X11BASE}/include
LIBS += -liconv
I3_LDFLAGS += -L${X11BASE}/lib
endif
ifeq ($(UNAME),FreeBSD)
LIBS += -liconv
endif
ifeq ($(UNAME),Darwin)
LIBS += -liconv
else ifneq ($(UNAME),OpenBSD)
# Darwin (Mac OS X) and OpenBSD do not have librt
LIBS += -lrt
endif
ifeq ($(UNAME),SunOS)
LIBS += -lsocket -liconv -lgen
endif
ifneq (,$(filter Linux GNU GNU/%, $(UNAME)))
I3_CPPFLAGS += -D_GNU_SOURCE
endif
ifeq ($(COVERAGE),1)
I3_CFLAGS += -fprofile-arcs -ftest-coverage
LIBS += -lgcov
endif
V ?= 0
ifeq ($(V),0)
# Dont print command lines which are run
.SILENT:
# echo-ing vars
V_ASCIIDOC = echo ASCIIDOC $@;
V_POD2HTML = echo POD2HTML $@;
V_POD2MAN = echo POD2MAN $@;
V_A2X = echo A2X $@;
endif
# Always remake the following targets
.PHONY: install clean dist distclean

174
configure.ac Normal file
View File

@ -0,0 +1,174 @@
# -*- Autoconf -*-
# Run autoreconf -fi to generate a configure script from this file.
AC_PREREQ([2.69])
AC_INIT([i3], [4.13], [https://github.com/i3/i3/issues])
# For AX_EXTEND_SRCDIR
AX_ENABLE_BUILDDIR
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall no-dist-gzip dist-bzip2])
# Default to silent rules, use V=1 to get verbose compilation output.
AM_SILENT_RULES([yes])
# Make it possible to disable maintainer mode to disable re-generation of build
# system files.
AM_MAINTAINER_MODE([enable])
AC_CONFIG_SRCDIR([libi3/ipc_recv_message.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Verify we are using GNU make because we use '%'-style pattern rules in
# Makefile.am, which are a GNU make extension. Pull requests to replace
# '%'-style pattern rules with a more portable alternative are welcome.
AX_CHECK_GNU_MAKE
AS_VAR_IF([_cv_gnu_make_command], [""], [AC_MSG_ERROR([the i3 Makefile.am requires GNU make])])
AX_EXTEND_SRCDIR
AS_IF([test -d ${srcdir}/.git],
[
VERSION="$(git describe --tags --abbrev=0)"
I3_VERSION="$(git describe --tags --always) ($(git log --pretty=format:%cd --date=short -n1), branch \\\"$(git describe --tags --always --all | sed s:heads/::)\\\")"
# Mirrors what libi3/is_debug_build.c does:
is_release=$(test $(echo "${I3_VERSION}" | cut -d '(' -f 1 | wc -m) -lt 10 && echo yes || echo no)
],
[
VERSION="$(cut -d '-' -f 1 ${srcdir}/I3_VERSION | cut -d ' ' -f 1)"
I3_VERSION="$(sed -e 's/@<:@\"?\\@:>@/\\&/g' ${srcdir}/I3_VERSION)"
is_release="$(grep -q non-git ${srcdir}/I3_VERSION && echo no || echo yes)"
])
AC_SUBST([I3_VERSION], [$I3_VERSION])
MAJOR_VERSION="$(echo ${VERSION} | cut -d '.' -f 1)"
MINOR_VERSION="$(echo ${VERSION} | cut -d '.' -f 2)"
PATCH_VERSION="$(echo ${VERSION} | cut -d '.' -f 3)"
AS_IF([test "x${PATCH_VERSION}" = x], [PATCH_VERSION=0])
AC_DEFINE_UNQUOTED([I3_VERSION], ["${I3_VERSION}"], [i3 version])
AC_DEFINE_UNQUOTED([MAJOR_VERSION], [${MAJOR_VERSION}], [i3 major version])
AC_DEFINE_UNQUOTED([MINOR_VERSION], [${MINOR_VERSION}], [i3 minor version])
AC_DEFINE_UNQUOTED([PATCH_VERSION], [${PATCH_VERSION}], [i3 patch version])
AX_CODE_COVERAGE
dnl is_release must be lowercase because AX_CHECK_ENABLE_DEBUG calls m4_tolower
dnl on its fourth argument.
AX_CHECK_ENABLE_DEBUG([yes], , [UNUSED_NDEBUG], [$is_release])
AC_PROG_CC_C99
AC_DEFINE_UNQUOTED(SYSCONFDIR, "`eval echo $sysconfdir`", [Location of system configuration files])
# For strnlen() and vasprintf().
AC_USE_SYSTEM_EXTENSIONS
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
dnl The error message should include the specific type which could not be
dnl found, but I do not see a way to achieve that.
AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t], , [AC_MSG_FAILURE([cannot find required type])])
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_STRNLEN
AC_CHECK_FUNCS([atexit dup2 ftruncate getcwd gettimeofday localtime_r memchr memset mkdir rmdir setlocale socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr strtol strtoul], , [AC_MSG_FAILURE([cannot find the $ac_func function, which i3 requires])])
# Checks for libraries.
AC_SEARCH_LIBS([floor], [m], , [AC_MSG_FAILURE([cannot find the required floor() function despite trying to link with -lm])])
# libev does not ship with a pkg-config file :(.
AC_SEARCH_LIBS([ev_run], [ev], , [AC_MSG_FAILURE([cannot find the required ev_run() function despite trying to link with -lev])])
AC_SEARCH_LIBS([shm_open], [rt])
AX_PTHREAD
dnl Each prefix corresponds to a source tarball which users might have
dnl downloaded in a newer version and would like to overwrite.
PKG_CHECK_MODULES([LIBSN], [libstartup-notification-1.0])
PKG_CHECK_MODULES([XCB], [xcb xcb-xkb xcb-xinerama xcb-randr])
PKG_CHECK_MODULES([XCB_UTIL], [xcb-event xcb-util])
PKG_CHECK_MODULES([XCB_UTIL_CURSOR], [xcb-cursor])
PKG_CHECK_MODULES([XCB_UTIL_KEYSYMS], [xcb-keysyms])
PKG_CHECK_MODULES([XCB_UTIL_WM], [xcb-icccm])
PKG_CHECK_MODULES([XCB_UTIL_XRM], [xcb-xrm])
PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon xkbcommon-x11])
PKG_CHECK_MODULES([YAJL], [yajl])
PKG_CHECK_MODULES([LIBPCRE], [libpcre >= 8.10])
PKG_CHECK_MODULES([PANGOCAIRO], [cairo >= 1.14.4 pangocairo])
# Checks for programs.
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_LN_S
AC_PATH_PROG([PATH_ASCIIDOC], [asciidoc])
AC_PATH_PROG([PATH_XMLTO], [xmlto])
AC_PATH_PROG([PATH_POD2MAN], [pod2man])
AM_CONDITIONAL([BUILD_MANS], [test x$PATH_ASCIIDOC != x && test x$PATH_XMLTO != x && test x$PATH_POD2MAN != x])
AM_CONDITIONAL([BUILD_DOCS], [test x$PATH_ASCIIDOC != x])
AM_PROG_AR
AX_FLAGS_WARN_ALL
AX_CHECK_COMPILE_FLAG([-Wunused-value], [AX_APPEND_FLAG([-Wunused-value], [AM_CFLAGS])])
AC_SUBST(AM_CFLAGS)
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h float.h inttypes.h limits.h locale.h netinet/in.h paths.h stddef.h stdint.h stdlib.h string.h sys/param.h sys/socket.h sys/time.h unistd.h], , [AC_MSG_FAILURE([cannot find the $ac_header header, which i3 requires])])
AC_CONFIG_FILES([Makefile testcases/lib/i3test.pm man/asciidoc.conf])
AC_CONFIG_FILES([testcases/complete-run.pl], [chmod +x testcases/complete-run.pl])
# Enable address sanitizer for non-release builds. The performance hit is a
# 50% increase of wallclock time for the testsuite on my machine.
if test x$is_release = xyes; then
default_sanitizers=
else
default_sanitizers=address
fi
AX_SANITIZERS(, [$default_sanitizers], [AC_DEFINE([I3_ASAN_ENABLED], [], [Enable ASAN])])
AC_OUTPUT
if test -z "${BUILD_DOCS_TRUE}"; then
print_BUILD_DOCS=yes
else
print_BUILD_DOCS=no
fi
if test -z "${BUILD_MANS_TRUE}"; then
print_BUILD_MANS=yes
else
print_BUILD_MANS=no
fi
git_dir=`git rev-parse --git-dir 2>/dev/null`
if test -n "$git_dir"; then
srcdir=`dirname "$git_dir"`
exclude_dir=`pwd | sed "s,^$srcdir,,g"`
if ! grep -q "^$exclude_dir" "$git_dir/info/exclude"; then
echo "$exclude_dir" >> "$git_dir/info/exclude"
fi
fi
echo \
"--------------------------------------------------------------------------------
build configured:
AS_HELP_STRING([i3 version:], [`echo ${I3_VERSION} | sed 's,\\\\,,g'`])
AS_HELP_STRING([is release version:], [${is_release}])
AS_HELP_STRING([build manpages:], [${print_BUILD_MANS}])
AS_HELP_STRING([build docs:], [${print_BUILD_DOCS}])
AS_HELP_STRING([enable debug flags:], [${ax_enable_debug}])
AS_HELP_STRING([code coverage:], [${CODE_COVERAGE_ENABLED}])
AS_HELP_STRING([enabled sanitizers:], [${ax_enabled_sanitizers}])
To compile, run:
cd `pwd` && make -j8
--------------------------------------------------------------------------------"

18
debian/changelog vendored
View File

@ -1,9 +1,27 @@
i3-wm (4.12.1-1) unstable; urgency=medium
* New upstream release.
* Move to debhelper 9
* Bump Standards-Version to 3.9.7 (no changes necessary)
* debian/watch: verify signature, use https
-- Michael Stapelberg <stapelberg@debian.org> Fri, 01 Apr 2016 16:34:35 +0200
i3-wm (4.12-2) unstable; urgency=medium
* Override lintian warning desktop-entry-contains-unknown-key for
DesktopNames, gdm needs that key.
* Remove i3-wm.menu to conform to the tech-ctte decision on #741573.
-- Michael Stapelberg <stapelberg@debian.org> Fri, 01 Apr 2016 15:51:23 +0200
i3-wm (4.12-1) unstable; urgency=medium
* New upstream release.
* Move to debhelper 9
* Bump Standards-Version to 3.9.7 (no changes necessary)
* debian/watch: verify signature, use https
* Enable full hardening
-- Michael Stapelberg <stapelberg@debian.org> Sun, 06 Mar 2016 14:20:38 +0100

8
debian/control vendored
View File

@ -3,6 +3,7 @@ Section: x11
Priority: extra
Maintainer: Michael Stapelberg <stapelberg@debian.org>
Build-Depends: debhelper (>= 9),
dh-autoreconf,
libx11-dev,
libxcb-util0-dev (>= 0.3.8),
libxcb-keysyms1-dev,
@ -10,6 +11,7 @@ Build-Depends: debhelper (>= 9),
libxcb-randr0-dev,
libxcb-icccm4-dev,
libxcb-cursor-dev,
libxcb-xrm-dev,
libxcb-xkb-dev,
libxkbcommon-dev (>= 0.4.0),
libxkbcommon-x11-dev (>= 0.4.0),
@ -19,12 +21,12 @@ Build-Depends: debhelper (>= 9),
pkg-config,
libev-dev (>= 1:4.04),
libyajl-dev (>= 2.0.4),
libpcre3-dev,
libpcre3-dev (>= 1:8.10),
libstartup-notification0-dev (>= 0.10),
libcairo2-dev,
libcairo2-dev (>= 1.14.4),
libpango1.0-dev,
libpod-simple-perl
Standards-Version: 3.9.7
Standards-Version: 3.9.8
Homepage: http://i3wm.org/
Package: i3

View File

@ -1,2 +1,2 @@
etc
usr
debian/tmp/etc
debian/tmp/usr

5
debian/i3-wm.menu vendored
View File

@ -1,5 +0,0 @@
?package(i3-wm): \
needs="wm" \
section="Window Managers" \
title="i3" \
command="/usr/bin/i3"

12
debian/rules vendored
View File

@ -4,14 +4,18 @@
export V:=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
override_dh_auto_build:
dh_auto_build -- all docs mans
override_dh_installchangelogs:
dh_installchangelogs RELEASE-NOTES-*
override_dh_strip:
dh_strip --dbg-package=i3-wm-dbg
override_dh_auto_test:
# TODO: enable tests
override_dh_auto_configure:
# The default is /usr/share/doc/i3
dh_auto_configure -- --docdir=/usr/share/doc/i3-wm
%:
dh $@ --parallel
dh $@ --parallel --builddirectory=build --with=autoreconf

View File

@ -1,7 +0,0 @@
all:
$(MAKE) -C .. docs
clean:
$(MAKE) -C .. clean-docs
.PHONY: all clean

View File

@ -1,46 +0,0 @@
DISTCLEAN_TARGETS += clean-docs
# To pass additional parameters for asciidoc
ASCIIDOC = asciidoc
I3POD2HTML = ./docs/i3-pod2html
ASCIIDOC_NOTOC_TARGETS = \
docs/debugging.html
ASCIIDOC_TOC_TARGETS = \
docs/hacking-howto.html \
docs/userguide.html \
docs/ipc.html \
docs/multi-monitor.html \
docs/wsbar.html \
docs/testsuite.html \
docs/i3bar-protocol.html \
docs/layout-saving.html
ASCIIDOC_TARGETS = \
$(ASCIIDOC_TOC_TARGETS) \
$(ASCIIDOC_NOTOC_TARGETS)
ASCIIDOC_CALL = $(V_ASCIIDOC)$(ASCIIDOC) -n $(ASCIIDOC_FLAGS) -o $@ $<
ASCIIDOC_TOC_CALL = $(V_ASCIIDOC)$(ASCIIDOC) -a toc -n $(ASCIIDOC_FLAGS) -o $@ $<
POD2HTML_TARGETS = \
docs/lib-i3test.html \
docs/lib-i3test-test.html
docs/lib-i3test.html: testcases/lib/i3test.pm
$(V_POD2HTML)$(I3POD2HTML) $< $@
docs/lib-i3test-test.html: testcases/lib/i3test/Test.pm
$(V_POD2HTML)$(I3POD2HTML) $< $@
docs: $(ASCIIDOC_TARGETS) $(POD2HTML_TARGETS)
$(ASCIIDOC_TOC_TARGETS): docs/%.html: docs/%
$(ASCIIDOC_TOC_CALL)
$(ASCIIDOC_NOTOC_TARGETS): docs/%.html: docs/%
$(ASCIIDOC_CALL)
clean-docs:
rm -f $(ASCIIDOC_TARGETS) $(POD2HTML_TARGETS)

View File

@ -187,7 +187,7 @@ cleanup ("flatten") the tree. See also +src/move.c+ for another similar
function, which was moved into its own file because it is so long.
src/util.c::
Contains useful functions which are not really dependant on anything.
Contains useful functions which are not really dependent on anything.
src/window.c::
Handlers to update X11 window properties like +WM_CLASS+, +_NET_WM_NAME+,
@ -593,7 +593,7 @@ optimize this and call +x_push_node+ on the appropriate con directly.
itself for the containers children. This function actually pushes the
state, see the next paragraph.
4. If the pointer needs to be warped to a different position (for example when
changing focus to a differnt output), it will be warped now.
changing focus to a different output), it will be warped now.
5. The eventmask is restored for all mapped windows.
6. Window decorations will be rendered by calling +x_deco_recurse+ on the root
container, which then recursively calls itself for the children.
@ -850,7 +850,7 @@ empty.
Afterwards, +con_focus+ will be called to fix the focus stack and the tree will
be flattened.
=== Case 3: Moving to non-existant top/bottom
=== Case 3: Moving to non-existent top/bottom
Like in case 1, the reference layout for this case is a single workspace in
horizontal orientation with two containers on it. Focus is on the left
@ -877,7 +877,7 @@ container and the container above/below the current one (on the level of
Now, +con_focus+ will be called to fix the focus stack and the tree will be
flattened.
=== Case 4: Moving to existant top/bottom
=== Case 4: Moving to existent top/bottom
The reference layout for this case is a vertical workspace with two containers.
The bottom one is a h-split containing two containers (1 and 2). Focus is on

View File

@ -6,7 +6,7 @@ August 2012
This document explains the protocol in which i3bar expects its input. It
provides support for colors, urgency, shortening and easy manipulation.
== Rationale for chosing JSON
== Rationale for choosing JSON
Before describing the protocol, lets cover why JSON is a building block of
this protocol.
@ -111,7 +111,7 @@ cont_signal::
processing.
The default value (if none is specified) is SIGCONT.
click_events::
If specified and true i3bar will write a infinite array (same as above)
If specified and true i3bar will write an infinite array (same as above)
to your stdin.
=== Blocks in detail
@ -233,7 +233,7 @@ name::
instance::
Instance of the block, if set
x, y::
X11 root window coordinates where the click occured
X11 root window coordinates where the click occurred
button::
X11 button ID (for example 1 to 3 for left/middle/right mouse button)

View File

@ -80,6 +80,8 @@ GET_BAR_CONFIG (6)::
GET_VERSION (7)::
Gets the version of i3. The reply will be a JSON-encoded dictionary
with the major, minor, patch and human-readable version.
GET_BINDING_MODES (8)::
Gets a list of currently configured binding modes.
So, a typical message could look like this:
--------------------------------------------------
@ -137,6 +139,8 @@ BAR_CONFIG (6)::
Reply to the GET_BAR_CONFIG message.
VERSION (7)::
Reply to the GET_VERSION message.
BINDING_MODES (8)::
Reply to the GET_BINDING_MODES message.
=== COMMAND reply
@ -285,7 +289,7 @@ type (string)::
Type of this container. Can be one of "root", "output", "con",
"floating_con", "workspace" or "dockarea".
border (string)::
Can be either "normal", "none" or "1pixel", dependending on the
Can be either "normal", "none" or "pixel", depending on the
containers border style.
current_border_width (integer)::
Number of pixels of the border width.
@ -604,6 +608,15 @@ loaded_config_file_name (string)::
}
-------------------
=== BINDING_MODES reply
The reply consists of an array of all currently configured binding modes.
*Example:*
---------------------
["default", "resize"]
---------------------
== Events
[[events]]
@ -741,14 +754,15 @@ defines whether pango markup shall be used for displaying this mode.
This event consists of a single serialized map containing a property
+change (string)+ which indicates the type of the change
* +new+ - the window has become managed by i3
* +close+ - the window has closed
* +focus+ - the window has received input focus
* +title+ - the window's title has changed
* +fullscreen_mode+ - the window has entered or exited fullscreen mode
* +move+ - the window has changed its position in the tree
* +floating+ - the window has transitioned to or from floating
* +urgent+ - the window has become urgent or lost its urgent status
* +new+ the window has become managed by i3
* +close+ the window has closed
* +focus+ the window has received input focus
* +title+ the window's title has changed
* +fullscreen_mode+ the window has entered or exited fullscreen mode
* +move+ the window has changed its position in the tree
* +floating+ the window has transitioned to or from floating
* +urgent+ the window has become urgent or lost its urgent status
* +mark+ a mark has been added to or removed from the window
Additionally a +container (object)+ field will be present, which consists
of the window's parent container. Be aware that for the "new" event, the

View File

@ -109,7 +109,7 @@ run the tests on a separate X server instance (using Xephyr).
Xephyr will open a window where you can inspect the running test. You can run
the tests without an X session with Xvfb, such as with +xvfb-run
./complete-run+. This will also speed up the tests signficantly especially on
./complete-run+. This will also speed up the tests significantly especially on
machines without a powerful video card.
.Example invocation of complete-run.pl+
@ -450,7 +450,7 @@ cmd 'focus left';
is($x->input_focus, $left->id, 'left window focused');
----------
However, the test fails. Sometimes. Apparantly, there is a race condition in
However, the test fails. Sometimes. Apparently, there is a race condition in
your test. If you think about it, this is because you are using two different
pieces of software: You tell i3 to update focus, i3 confirms that, and then you
ask X11 to give you the current focus. There is a certain time i3 needs to
@ -614,7 +614,7 @@ activation, we decreased the total amount of time necessary to run all tests
it significantly more attractive to run the test suite more often (or at all)
during development.
An alternative approach to using socket activation is polling for the existance
An alternative approach to using socket activation is polling for the existence
of the IPC socket and connecting to it. While this might be slightly easier to
implement, it wastes CPU time and is considerably uglier than this solution
:). After all, +lib/SocketActivation.pm+ contains only 54 SLOC.

View File

@ -152,7 +152,7 @@ and move it to the wanted size.
You can also use <<binding_modes>> to define a mode for resizing via the
keyboard. To see an example for this, look at the
https://github.com/i3/i3/blob/next/i3.config.keycodes[default config] provided
https://github.com/i3/i3/blob/next/etc/config.keycodes[default config] provided
by i3.
=== Restarting i3 inplace
@ -181,7 +181,7 @@ can also do that by using the <<floating_modifier>>. Another way to resize
floating windows using the mouse is to right-click on the titlebar and drag.
For resizing floating windows with your keyboard, see the resizing binding mode
provided by the i3 https://github.com/i3/i3/blob/next/i3.config.keycodes[default config].
provided by the i3 https://github.com/i3/i3/blob/next/etc/config.keycodes[default config].
Floating windows are always on top of tiling windows.
@ -610,11 +610,13 @@ new_window pixel 3
You can hide container borders adjacent to the screen edges using
+hide_edge_borders+. This is useful if you are using scrollbars, or do not want
to waste even two pixels in displayspace. Default is none.
to waste even two pixels in displayspace. The "smart" setting hides borders on
workspaces with only one window visible, but keeps them on workspaces with
multiple windows visible. Default is none.
*Syntax*:
-----------------------------------------------
hide_edge_borders none|vertical|horizontal|both
hide_edge_borders none|vertical|horizontal|both|smart
-----------------------------------------------
*Example*:
@ -700,6 +702,38 @@ absolutely no plans to change this. If you need a more dynamic configuration
you should create a little script which generates a configuration file and run
it before starting i3 (for example in your +~/.xsession+ file).
Also see <<xresources>> to learn how to create variables based on resources
loaded from the X resource database.
[[xresources]]
=== X resources
<<variables>> can also be created using a value configured in the X resource
database. This is useful, for example, to avoid configuring color values within
the i3 configuration. Instead, the values can be configured, once, in the X
resource database to achieve an easily maintainable, consistent color theme
across many X applications.
Defining a resource will load this resource from the resource database and
assign its value to the specified variable. A fallback must be specified in
case the resource cannot be loaded from the database.
*Syntax*:
----------------------------------------------------
set_from_resource $<name> <resource_name> <fallback>
----------------------------------------------------
*Example*:
----------------------------------------------------------------------------
# The ~/.Xresources should contain a line such as
# *color0: #121212
# and must be loaded properly, e.g., by using
# xrdb ~/.Xresources
# This value is picked up on by other applications (e.g., the URxvt terminal
# emulator) and can be used in i3 like this:
set_from_resource $black i3wm.color0 #000000
----------------------------------------------------------------------------
[[assign_workspace]]
=== Automatically putting clients on specific workspaces
@ -1115,11 +1149,15 @@ show_marks yes
Config files support line continuation, meaning when you end a line in a
backslash character (`\`), the line-break will be ignored by the parser. This
feature can be used to create more readable configuration files.
Commented lines are not continued.
*Examples*:
-------------------
bindsym Mod1+f \
fullscreen toggle
# this line is not continued \
bindsym Mod1+F fullscreen toggle
-------------------
== Configuring i3bar
@ -1372,7 +1410,7 @@ NetworkManager, VLC, Pidgin, etc. can place little icons.
You can configure on which output (monitor) the icons should be displayed or
you can turn off the functionality entirely.
You can use mutliple +tray_output+ directives in your config to specify a list
You can use multiple +tray_output+ directives in your config to specify a list
of outputs on which you want the tray to appear. The first available output in
that list as defined by the order of the directives will be used for the tray
output.
@ -1641,6 +1679,9 @@ bindsym $mod+x [class="Firefox" window_role="About"] kill
# enable floating mode and move container to workspace 4
for_window [class="^evil-app$"] floating enable, move container to workspace 4
# move all floating windows to the scratchpad
bindsym $mod+x [floating] move scratchpad
------------------------------------
The criteria which are currently implemented are:
@ -1683,6 +1724,10 @@ con_id::
Compares the i3-internal container ID, which you can get via the IPC
interface. Handy for scripting. Use the special value +\_\_focused__+
to match only the currently focused window.
floating::
Only matches floating windows. This criterion requires no value.
tiling::
Only matches tiling windows. This criterion requires no value.
The criteria +class+, +instance+, +role+, +title+, +workspace+ and +mark+ are
actually regular expressions (PCRE). See +pcresyntax(3)+ or +perldoc perlre+ for
@ -2050,6 +2095,7 @@ See <<move_to_outputs>> for how to move a container/workspace to a different
RandR output.
[[move_to_outputs]]
[[_moving_containers_workspaces_to_randr_outputs]]
=== Moving containers/workspaces to RandR outputs
To move a container to another RandR output (addressed by names like +LVDS1+ or
@ -2057,10 +2103,10 @@ To move a container to another RandR output (addressed by names like +LVDS1+ or
+right+, +up+ or +down+), there are two commands:
*Syntax*:
----------------------------------------------------
move container to output left|right|down|up|<output>
move workspace to output left|right|down|up|<output>
----------------------------------------------------
------------------------------------------------------------
move container to output left|right|down|up|current|<output>
move workspace to output left|right|down|up|current|<output>
------------------------------------------------------------
*Examples*:
--------------------------------------------------------
@ -2115,7 +2161,7 @@ floating containers.
It is recommended to define bindings for resizing in a dedicated binding mode.
See <<binding_modes>> and the example in the i3
https://github.com/i3/i3/blob/next/i3.config.keycodes[default config] for more
https://github.com/i3/i3/blob/next/etc/config.keycodes[default config] for more
context.
*Example*:
@ -2204,7 +2250,7 @@ bindsym $mod+g exec i3-input -p 'goto ' -l 1 -P 'Goto: '
---------------------------------------
Alternatively, if you do not want to mess with +i3-input+, you could create
seperate bindings for a specific set of labels and then only use those labels.
separate bindings for a specific set of labels and then only use those labels.
///////////////////////////////////////////////////////////////////
[[pango_markup]]
@ -2534,7 +2580,7 @@ have more than one monitor:
track of which window you put where. Thus, you can use vim-like marks to
quickly switch between windows. See <<vim_like_marks>>.
4. For information on how to move existing workspaces between monitors,
see <<_moving_containers_workspaces_to_randr_outputs>>.
see <<move_to_outputs>>.
== i3 and the rest of your software world

View File

@ -1,10 +0,0 @@
all:
$(MAKE) -C .. i3-config-wizard/i3-config-wizard
install:
$(MAKE) -C .. install-i3-config-wizard
clean:
$(MAKE) -C .. clean-i3-config-wizard
.PHONY: all install clean

View File

@ -1,28 +0,0 @@
ALL_TARGETS += i3-config-wizard/i3-config-wizard
INSTALL_TARGETS += install-i3-config-wizard
CLEAN_TARGETS += clean-i3-config-wizard
i3_config_wizard_SOURCES := $(wildcard i3-config-wizard/*.c)
i3_config_wizard_HEADERS := $(wildcard i3-config-wizard/*.h)
i3_config_wizard_CFLAGS = $(XCB_CFLAGS) $(XCB_KBD_CFLAGS) $(PANGO_CFLAGS) $(XKB_COMMON_CFLAGS) $(XKB_COMMON_X11_CFLAGS)
i3_config_wizard_LIBS = $(XCB_LIBS) $(XCB_KBD_LIBS) $(PANGO_LIBS) $(XKB_COMMON_LIBS) $(XKB_COMMON_X11_LIBS)
i3_config_wizard_OBJECTS := $(i3_config_wizard_SOURCES:.c=.o)
i3-config-wizard/%.o: i3-config-wizard/%.c $(i3_config_wizard_HEADERS) i3-config-parser.stamp
echo "[i3-config-wizard] CC $<"
$(CC) $(I3_CPPFLAGS) $(XCB_CPPFLAGS) $(CPPFLAGS) $(i3_config_wizard_CFLAGS) $(I3_CFLAGS) $(CFLAGS) -c -o $@ $<
i3-config-wizard/i3-config-wizard: libi3.a $(i3_config_wizard_OBJECTS)
echo "[i3-config-wizard] Link i3-config-wizard"
$(CC) $(I3_LDFLAGS) $(LDFLAGS) -o $@ $(filter-out libi3.a,$^) $(LIBS) $(i3_config_wizard_LIBS)
install-i3-config-wizard: i3-config-wizard/i3-config-wizard
echo "[i3-config-wizard] Install"
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
$(INSTALL) -m 0755 i3-config-wizard/i3-config-wizard $(DESTDIR)$(EXEC_PREFIX)/bin/
clean-i3-config-wizard:
echo "[i3-config-wizard] Clean"
rm -f $(i3_config_wizard_OBJECTS) $(i3_config_wizard_SOURCES_GENERATED) i3-config-wizard/i3-config-wizard i3-config-wizard/cfgparse.*

View File

@ -8,6 +8,8 @@
* keysyms.
*
*/
#include <config.h>
#if defined(__FreeBSD__)
#include <sys/param.h>
#endif

View File

@ -25,7 +25,11 @@ binmode STDERR, ':utf8';
# reads in a whole file
sub slurp {
my ($filename) = @_;
open(my $fh, '<', $filename) or die "$!";
my $fh;
if (!open($fh, '<', $filename)) {
warn "Could not open $filename: $!";
return undef;
}
local $/;
my $result;
eval {

View File

@ -1,10 +0,0 @@
all:
$(MAKE) -C .. i3-dump-log/i3-dump-log
install:
$(MAKE) -C .. install-i3-dump-log
clean:
$(MAKE) -C .. clean-i3-dump-log
.PHONY: all install clean

View File

@ -1,28 +0,0 @@
ALL_TARGETS += i3-dump-log/i3-dump-log
INSTALL_TARGETS += install-i3-dump-log
CLEAN_TARGETS += clean-i3-dump-log
i3_dump_log_SOURCES := $(wildcard i3-dump-log/*.c)
i3_dump_log_HEADERS := $(wildcard i3-dump-log/*.h)
i3_dump_log_CFLAGS = $(XCB_CFLAGS) $(PANGO_CFLAGS)
i3_dump_log_LIBS = $(XCB_LIBS)
i3_dump_log_OBJECTS := $(i3_dump_log_SOURCES:.c=.o)
i3-dump-log/%.o: i3-dump-log/%.c $(i3_dump_log_HEADERS)
echo "[i3-dump-log] CC $<"
$(CC) $(I3_CPPFLAGS) $(XCB_CPPFLAGS) $(CPPFLAGS) $(i3_dump_log_CFLAGS) $(I3_CFLAGS) $(CFLAGS) -c -o $@ $<
i3-dump-log/i3-dump-log: libi3.a $(i3_dump_log_OBJECTS)
echo "[i3-dump-log] Link i3-dump-log"
$(CC) $(I3_LDFLAGS) $(LDFLAGS) -o $@ $(filter-out libi3.a,$^) $(LIBS) $(i3_dump_log_LIBS)
install-i3-dump-log: i3-dump-log/i3-dump-log
echo "[i3-dump-log] Install"
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
$(INSTALL) -m 0755 i3-dump-log/i3-dump-log $(DESTDIR)$(EXEC_PREFIX)/bin/
clean-i3-dump-log:
echo "[i3-dump-log] Clean"
rm -f $(i3_dump_log_OBJECTS) i3-dump-log/i3-dump-log

View File

@ -7,6 +7,8 @@
* i3-dump-log/main.c: Dumps the i3 SHM log to stdout.
*
*/
#include <config.h>
#include <stdio.h>
#include <stdbool.h>
#include <sys/types.h>
@ -28,8 +30,10 @@
#include "shmlog.h"
#include <i3/ipc.h>
static uint32_t offset_next_write,
wrap_count;
#if !defined(__OpenBSD__)
static uint32_t offset_next_write;
#endif
static uint32_t wrap_count;
static i3_shmlog_header *header;
static char *logbuffer,
@ -57,17 +61,26 @@ static void print_till_end(void) {
int main(int argc, char *argv[]) {
int o, option_index = 0;
bool verbose = false,
follow = false;
bool verbose = false;
#if !defined(__OpenBSD__)
bool follow = false;
#endif
static struct option long_options[] = {
{"version", no_argument, 0, 'v'},
{"verbose", no_argument, 0, 'V'},
#if !defined(__OpenBSD__)
{"follow", no_argument, 0, 'f'},
#endif
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}};
{0, 0, 0, 0}
};
#if !defined(__OpenBSD__)
char *options_string = "s:vfVh";
#else
char *options_string = "vVh";
#endif
while ((o = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) {
if (o == 'v') {
@ -75,11 +88,17 @@ int main(int argc, char *argv[]) {
return 0;
} else if (o == 'V') {
verbose = true;
#if !defined(__OpenBSD__)
} else if (o == 'f') {
follow = true;
#endif
} else if (o == 'h') {
printf("i3-dump-log " I3_VERSION "\n");
printf("i3-dump-log [-f] [-s <socket>]\n");
#if !defined(__OpenBSD__)
printf("i3-dump-log [-fhVv]\n");
#else
printf("i3-dump-log [-hVv]\n");
#endif
return 0;
}
}
@ -162,6 +181,7 @@ int main(int argc, char *argv[]) {
walk = logbuffer + sizeof(i3_shmlog_header);
print_till_end();
#if !defined(__OpenBSD__)
if (follow) {
/* Since pthread_cond_wait() expects a mutex, we need to provide one.
* To not lock i3 (thats bad, mhkay?) we just define one outside of
@ -177,6 +197,7 @@ int main(int argc, char *argv[]) {
}
}
}
#endif
return 0;
}

View File

@ -1,10 +0,0 @@
all:
$(MAKE) -C .. i3-input/i3-input
install:
$(MAKE) -C .. install-i3-input
clean:
$(MAKE) -C .. clean-i3-input
.PHONY: all install clean

View File

@ -1,5 +1,7 @@
#pragma once
#include <config.h>
#include <err.h>
#define die(...) errx(EXIT_FAILURE, __VA_ARGS__);

View File

@ -1,28 +0,0 @@
ALL_TARGETS += i3-input/i3-input
INSTALL_TARGETS += install-i3-input
CLEAN_TARGETS += clean-i3-input
i3_input_SOURCES := $(wildcard i3-input/*.c)
i3_input_HEADERS := $(wildcard i3-input/*.h)
i3_input_CFLAGS = $(XCB_CFLAGS) $(XCB_KBD_CFLAGS) $(PANGO_CFLAGS)
i3_input_LIBS = $(XCB_LIBS) $(XCB_KBD_LIBS) $(PANGO_LIBS)
i3_input_OBJECTS := $(i3_input_SOURCES:.c=.o)
i3-input/%.o: i3-input/%.c $(i3_input_HEADERS)
echo "[i3-input] CC $<"
$(CC) $(I3_CPPFLAGS) $(XCB_CPPFLAGS) $(CPPFLAGS) $(i3_input_CFLAGS) $(I3_CFLAGS) $(CFLAGS) -c -o $@ $<
i3-input/i3-input: libi3.a $(i3_input_OBJECTS)
echo "[i3-input] Link i3-input"
$(CC) $(I3_LDFLAGS) $(LDFLAGS) -o $@ $(filter-out libi3.a,$^) $(LIBS) $(i3_input_LIBS)
install-i3-input: i3-input/i3-input
echo "[i3-input] Install"
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
$(INSTALL) -m 0755 i3-input/i3-input $(DESTDIR)$(EXEC_PREFIX)/bin/
clean-i3-input:
echo "[i3-input] Clean"
rm -f $(i3_input_OBJECTS) i3-input/i3-input

View File

@ -1,7 +1,7 @@
# This list can be used to convert X11 Keysyms to Unicode 2.1 character.
# The list is not checked for correctness by Unicode officials. Use it
# at your own risk and the creator is not responsable for any damage that
# occured due to using this list.
# occurred due to using this list.
#
# The list is created by looking at the Keysym names and the Unicode data
# file. Other mapping tables were used as a reference where needed.

View File

@ -8,6 +8,8 @@
* to i3.
*
*/
#include "libi3.h"
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
@ -31,8 +33,6 @@
#include "i3-input.h"
#include "libi3.h"
/* IPC format string. %s will be replaced with what the user entered, then
* the command will be sent to i3 */
static char *format;
@ -80,7 +80,7 @@ void debuglog(char *fmt, ...) {
}
/*
* Restores the X11 input focus to whereever it was before.
* Restores the X11 input focus to wherever it was before.
* This is necessary because i3-inputs window has override_redirect=1
* ( unmanaged by the window manager) and thus i3-input changes focus itself.
* This function is called on exit().
@ -216,10 +216,6 @@ static void finish_input() {
free(full);
#if 0
free(command);
return 1;
#endif
exit(0);
}
@ -317,10 +313,31 @@ static int handle_key_press(void *ignored, xcb_connection_t *conn, xcb_key_press
static xcb_rectangle_t get_window_position(void) {
xcb_rectangle_t result = (xcb_rectangle_t){logical_px(50), logical_px(50), logical_px(500), font.height + logical_px(8)};
xcb_get_property_reply_t *supporting_wm_reply = NULL;
xcb_get_input_focus_reply_t *input_focus = NULL;
xcb_get_geometry_reply_t *geometry = NULL;
xcb_get_property_reply_t *wm_class = NULL;
xcb_translate_coordinates_reply_t *coordinates = NULL;
xcb_atom_t A__NET_SUPPORTING_WM_CHECK;
xcb_intern_atom_cookie_t nswc_cookie = xcb_intern_atom(conn, 0, strlen("_NET_SUPPORTING_WM_CHECK"), "_NET_SUPPORTING_WM_CHECK");
xcb_intern_atom_reply_t *nswc_reply = xcb_intern_atom_reply(conn, nswc_cookie, NULL);
if (nswc_reply == NULL) {
ELOG("Could not intern atom _NET_SUPPORTING_WM_CHECK\n");
exit(-1);
}
A__NET_SUPPORTING_WM_CHECK = nswc_reply->atom;
free(nswc_reply);
supporting_wm_reply = xcb_get_property_reply(
conn, xcb_get_property(conn, false, root, A__NET_SUPPORTING_WM_CHECK, XCB_ATOM_WINDOW, 0, 32), NULL);
xcb_window_t *supporting_wm_win = NULL;
if (supporting_wm_reply == NULL || xcb_get_property_value_length(supporting_wm_reply) == 0) {
DLOG("Could not determine EWMH support window.\n");
} else {
supporting_wm_win = xcb_get_property_value(supporting_wm_reply);
}
/* In rare cases, the window holding the input focus might disappear while we are figuring out its
* position. To avoid this, we grab the server in the meantime. */
xcb_grab_server(conn);
@ -331,12 +348,23 @@ static xcb_rectangle_t get_window_position(void) {
goto free_resources;
}
/* We need to ignore the EWMH support window to which the focus can be set if there's no suitable window to focus. */
if (supporting_wm_win != NULL && input_focus->focus == *supporting_wm_win) {
DLOG("Input focus is on the EWMH support window, ignoring.\n");
goto free_resources;
}
geometry = xcb_get_geometry_reply(conn, xcb_get_geometry(conn, input_focus->focus), NULL);
if (geometry == NULL) {
DLOG("Failed to received window geometry.\n");
goto free_resources;
}
wm_class = xcb_get_property_reply(
conn, xcb_get_property(conn, false, input_focus->focus, XCB_ATOM_WM_CLASS, XCB_GET_PROPERTY_TYPE_ANY, 0, 32), NULL);
/* We need to find out whether the input focus is on an i3 frame window. If it is, we must not translate the coordinates. */
if (wm_class == NULL || xcb_get_property_value_length(wm_class) == 0 || strcmp(xcb_get_property_value(wm_class), "i3-frame") != 0) {
coordinates = xcb_translate_coordinates_reply(
conn, xcb_translate_coordinates(conn, input_focus->focus, root, geometry->x, geometry->y), NULL);
if (coordinates == NULL) {
@ -347,13 +375,20 @@ static xcb_rectangle_t get_window_position(void) {
DLOG("Determined coordinates of window with input focus at x = %i / y = %i.\n", coordinates->dst_x, coordinates->dst_y);
result.x += coordinates->dst_x;
result.y += coordinates->dst_y;
} else {
DLOG("Determined coordinates of window with input focus at x = %i / y = %i.\n", geometry->x, geometry->y);
result.x += geometry->x;
result.y += geometry->y;
}
free_resources:
xcb_ungrab_server(conn);
xcb_flush(conn);
FREE(supporting_wm_reply);
FREE(input_focus);
FREE(geometry);
FREE(wm_class);
FREE(coordinates);
return result;
}

View File

@ -1,10 +0,0 @@
all:
$(MAKE) -C .. i3-msg/i3-msg
install:
$(MAKE) -C .. install-i3-msg
clean:
$(MAKE) -C .. clean-i3-msg
.PHONY: all install clean

View File

@ -1,28 +0,0 @@
ALL_TARGETS += i3-msg/i3-msg
INSTALL_TARGETS += install-i3-msg
CLEAN_TARGETS += clean-i3-msg
i3_msg_SOURCES := $(wildcard i3-msg/*.c)
i3_msg_HEADERS := $(wildcard i3-msg/*.h)
i3_msg_CFLAGS = $(XCB_CFLAGS) $(PANGO_CFLAGS) $(YAJL_CFLAGS)
i3_msg_LIBS = $(XCB_LIBS) $(YAJL_LIBS)
i3_msg_OBJECTS := $(i3_msg_SOURCES:.c=.o)
i3-msg/%.o: i3-msg/%.c $(i3_msg_HEADERS)
echo "[i3-msg] CC $<"
$(CC) $(I3_CPPFLAGS) $(XCB_CPPFLAGS) $(CPPFLAGS) $(i3_msg_CFLAGS) $(I3_CFLAGS) $(CFLAGS) -c -o $@ $<
i3-msg/i3-msg: libi3.a $(i3_msg_OBJECTS)
echo "[i3-msg] Link i3-msg"
$(CC) $(I3_LDFLAGS) $(LDFLAGS) -o $@ $(filter-out libi3.a,$^) $(LIBS) $(i3_msg_LIBS)
install-i3-msg: i3-msg/i3-msg
echo "[i3-msg] Install"
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
$(INSTALL) -m 0755 i3-msg/i3-msg $(DESTDIR)$(EXEC_PREFIX)/bin/
clean-i3-msg:
echo "[i3-msg] Clean"
rm -f $(i3_msg_OBJECTS) i3-msg/i3-msg

View File

@ -14,6 +14,8 @@
* Additionally, its even useful sometimes :-).
*
*/
#include "libi3.h"
#include <stdio.h>
#include <stdbool.h>
#include <sys/types.h>
@ -34,7 +36,6 @@
#include <xcb/xcb.h>
#include <xcb/xcb_aux.h>
#include "libi3.h"
#include <i3/ipc.h>
static char *socket_path;
@ -161,11 +162,13 @@ int main(int argc, char *argv[]) {
message_type = I3_IPC_MESSAGE_TYPE_GET_MARKS;
else if (strcasecmp(optarg, "get_bar_config") == 0)
message_type = I3_IPC_MESSAGE_TYPE_GET_BAR_CONFIG;
else if (strcasecmp(optarg, "get_binding_modes") == 0)
message_type = I3_IPC_MESSAGE_TYPE_GET_BINDING_MODES;
else if (strcasecmp(optarg, "get_version") == 0)
message_type = I3_IPC_MESSAGE_TYPE_GET_VERSION;
else {
printf("Unknown message type\n");
printf("Known types: command, get_workspaces, get_outputs, get_tree, get_marks, get_bar_config, get_version\n");
printf("Known types: command, get_workspaces, get_outputs, get_tree, get_marks, get_bar_config, get_binding_modes, get_version\n");
exit(EXIT_FAILURE);
}
} else if (o == 'q') {
@ -203,7 +206,7 @@ int main(int argc, char *argv[]) {
}
if (!payload)
payload = "";
payload = sstrdup("");
int sockfd = socket(AF_LOCAL, SOCK_STREAM, 0);
if (sockfd == -1)
@ -218,6 +221,7 @@ int main(int argc, char *argv[]) {
if (ipc_send_message(sockfd, strlen(payload), message_type, (uint8_t *)payload) == -1)
err(EXIT_FAILURE, "IPC: write()");
free(payload);
if (quiet)
return 0;
@ -236,9 +240,10 @@ int main(int argc, char *argv[]) {
/* For the reply of commands, have a look if that command was successful.
* If not, nicely format the error message. */
if (reply_type == I3_IPC_MESSAGE_TYPE_COMMAND) {
yajl_handle handle;
handle = yajl_alloc(&reply_callbacks, NULL, NULL);
yajl_handle handle = yajl_alloc(&reply_callbacks, NULL, NULL);
yajl_status state = yajl_parse(handle, (const unsigned char *)reply, reply_length);
yajl_free(handle);
switch (state) {
case yajl_status_ok:
break;

View File

@ -1,10 +0,0 @@
all:
$(MAKE) -C .. i3-nagbar/i3-nagbar
install:
$(MAKE) -C .. install-i3-nagbar
clean:
$(MAKE) -C .. clean-i3-nagbar
.PHONY: all install clean

View File

@ -1,5 +1,7 @@
#pragma once
#include <config.h>
#include <err.h>
#define die(...) errx(EXIT_FAILURE, __VA_ARGS__);

View File

@ -1,28 +0,0 @@
ALL_TARGETS += i3-nagbar/i3-nagbar
INSTALL_TARGETS += install-i3-nagbar
CLEAN_TARGETS += clean-i3-nagbar
i3_nagbar_SOURCES := $(wildcard i3-nagbar/*.c)
i3_nagbar_HEADERS := $(wildcard i3-nagbar/*.h)
i3_nagbar_CFLAGS = $(XCB_CFLAGS) $(XCB_CURSOR_CFLAGS) $(XCB_WM_CFLAGS) $(PANGO_CFLAGS)
i3_nagbar_LIBS = $(XCB_LIBS) $(XCB_CURSOR_LIBS) $(XCB_WM_LIBS) $(PANGO_LIBS)
i3_nagbar_OBJECTS := $(i3_nagbar_SOURCES:.c=.o)
i3-nagbar/%.o: i3-nagbar/%.c $(i3_nagbar_HEADERS)
echo "[i3-nagbar] CC $<"
$(CC) $(I3_CPPFLAGS) $(XCB_CPPFLAGS) $(CPPFLAGS) $(i3_nagbar_CFLAGS) $(I3_CFLAGS) $(CFLAGS) -c -o $@ $<
i3-nagbar/i3-nagbar: libi3.a $(i3_nagbar_OBJECTS)
echo "[i3-nagbar] Link i3-nagbar"
$(CC) $(I3_LDFLAGS) $(LDFLAGS) -o $@ $(filter-out libi3.a,$^) $(LIBS) $(i3_nagbar_LIBS)
install-i3-nagbar: i3-nagbar/i3-nagbar
echo "[i3-nagbar] Install"
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
$(INSTALL) -m 0755 i3-nagbar/i3-nagbar $(DESTDIR)$(EXEC_PREFIX)/bin/
clean-i3-nagbar:
echo "[i3-nagbar] Clean"
rm -f $(i3_nagbar_OBJECTS) i3-nagbar/i3-nagbar

View File

@ -8,6 +8,8 @@
* when the user has an error in their configuration file.
*
*/
#include "libi3.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -30,7 +32,6 @@
#include <xcb/randr.h>
#include <xcb/xcb_cursor.h>
#include "libi3.h"
#include "i3-nagbar.h"
/** This is the equivalent of XC_left_ptr. Im not sure why xcb doesnt have a

View File

@ -98,7 +98,7 @@ my %allowed_keys = map { ($_, 1) } qw(
name
geometry
window_properties
mark
marks
rect
);

View File

@ -8,7 +8,7 @@
# We welcome patches that add distribution-specific mechanisms to find the
# preferred terminal emulator. On Debian, there is the x-terminal-emulator
# symlink for example.
for terminal in "$TERMINAL" x-terminal-emulator urxvt rxvt termit terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal termite lxterminal mate-terminal terminology st; do
for terminal in "$TERMINAL" x-terminal-emulator urxvt rxvt termit terminator Eterm aterm uxterm xterm gnome-terminal roxterm xfce4-terminal termite lxterminal mate-terminal terminology st qterminal; do
if command -v "$terminal" > /dev/null 2>&1; then
exec "$terminal" "$@"
fi

View File

@ -1,30 +0,0 @@
v0.7
=====
- Make i3bar compatible with i3-4.0
- Implement disabling the workspace buttons
- Add Color for focused ws
- Add support for I3_SOCKET_PATH-atom
- Implement different dock-positions
- Hide-on-modifier is now the default behavior
- Change default socketpath to /tmp/i3-ipc.sock
- Use I3SOCK environment-variable
- Bugfix: Stop the reconn-timer before starting it again, else it's running twice
- Bugfix: Don't SIGSTOP child in dockmode
- Bugfix: If hide-on-modifier is set, stop the child after starting
- Bugfix: Recover from closed socket
- Some minor bugfixes
v0.6
=====
- Add manpage
- Implement hide-on-modifier
- Custom colors can be set from the commandline
- Use double-buffering
- Bugfix: Correctly render long text
- Bugfix: Don't segfault on SIGCHILD
- Bugfix: Double-fork() to avoid zombies
- Some minor bugfixes
v0.5
=====
- Initial release

View File

@ -1,4 +1,4 @@
Copyright (c) 2010-2011, Axel Wagner
Copyright © 2010 Axel Wagner
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@ -1,10 +0,0 @@
all:
$(MAKE) -C .. i3bar/i3bar
install:
$(MAKE) -C .. install-i3bar
clean:
$(MAKE) -C .. clean-i3bar
.PHONY: all install clean

View File

@ -1,28 +0,0 @@
ALL_TARGETS += i3bar/i3bar
INSTALL_TARGETS += install-i3bar
CLEAN_TARGETS += clean-i3bar
i3bar_SOURCES := $(wildcard i3bar/src/*.c)
i3bar_HEADERS := $(wildcard i3bar/include/*.h)
i3bar_CFLAGS = $(XCB_CFLAGS) $(XCB_CURSOR_CFLAGS) $(PANGO_CFLAGS) $(YAJL_CFLAGS) $(LIBEV_CFLAGS)
i3bar_LIBS = $(XCB_LIBS) $(XCB_CURSOR_LIBS) $(PANGO_LIBS) $(YAJL_LIBS) $(LIBEV_LIBS) $(XCB_XKB_LIBS)
i3bar_OBJECTS := $(i3bar_SOURCES:.c=.o)
i3bar/src/%.o: i3bar/src/%.c $(i3bar_HEADERS)
echo "[i3bar] CC $<"
$(CC) $(I3_CPPFLAGS) $(XCB_CPPFLAGS) $(CPPFLAGS) $(i3bar_CFLAGS) $(I3_CFLAGS) $(CFLAGS) -Ii3bar/include -c -o $@ $<
i3bar/i3bar: libi3.a $(i3bar_OBJECTS)
echo "[i3bar] Link i3bar"
$(CC) $(I3_LDFLAGS) $(LDFLAGS) -o $@ $(filter-out libi3.a,$^) $(LIBS) $(i3bar_LIBS)
install-i3bar: i3bar/i3bar
echo "[i3bar] Install"
$(INSTALL) -d -m 0755 $(DESTDIR)$(EXEC_PREFIX)/bin
$(INSTALL) -m 0755 i3bar/i3bar $(DESTDIR)$(EXEC_PREFIX)/bin/
clean-i3bar:
echo "[i3bar] Clean"
rm -f $(i3bar_OBJECTS) i3bar/i3bar

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <stdbool.h>
#define STDIN_CHUNK_SIZE 1024

View File

@ -7,6 +7,8 @@
*/
#pragma once
#include <config.h>
#include <stdbool.h>
#include <xcb/xcb.h>
#include <xcb/xproto.h>
@ -85,6 +87,6 @@ TAILQ_HEAD(statusline_head, status_block) statusline_head;
#include "mode.h"
#include "trayclients.h"
#include "xcb.h"
#include "config.h"
#include "configuration.h"
#include "libi3.h"
#include "parse_json_header.h"

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include "common.h"
typedef enum {

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <stdint.h>
/*

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <xcb/xproto.h>
#include "common.h"

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <xcb/xcb.h>
#include <cairo/cairo-xcb.h>

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
#include <stdint.h>
/**

View File

@ -7,6 +7,8 @@
*/
#pragma once
#include <config.h>
#include "queue.h"
/* Get the maximum/minimum of x and y */

View File

@ -9,10 +9,10 @@
*/
#pragma once
#include <xcb/xproto.h>
#include "common.h"
#include <xcb/xproto.h>
typedef struct i3_ws i3_ws;
TAILQ_HEAD(ws_head, i3_ws);

View File

@ -9,13 +9,11 @@
*/
#pragma once
#include <config.h>
#include <stdint.h>
//#include "outputs.h"
#ifdef XCB_COMPAT
#define XCB_ATOM_CARDINAL CARDINAL
#endif
#define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0
#define _NET_SYSTEM_TRAY_ORIENTATION_VERT 1
#define SYSTEM_TRAY_REQUEST_DOCK 0

View File

@ -7,6 +7,8 @@
* child.c: Getting input for the statusline
*
*/
#include "common.h"
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
@ -25,8 +27,6 @@
#include <yajl/yajl_gen.h>
#include <paths.h>
#include "common.h"
/* Global variables for child_*() */
i3bar_child child;
@ -105,7 +105,9 @@ __attribute__((format(printf, 1, 2))) static void set_statusline_error(const cha
char *message;
va_list args;
va_start(args, format);
(void)vasprintf(&message, format, args);
if (vasprintf(&message, format, args) == -1) {
return;
}
struct status_block *err_block = scalloc(1, sizeof(struct status_block));
err_block->full_text = i3string_from_utf8("Error: ");
@ -359,11 +361,13 @@ static void read_flat_input(char *buffer, int length) {
I3STRING_FREE(first->full_text);
/* Remove the trailing newline and terminate the string at the same
* time. */
if (buffer[length - 1] == '\n' || buffer[length - 1] == '\r')
if (buffer[length - 1] == '\n' || buffer[length - 1] == '\r') {
buffer[length - 1] = '\0';
else
} else {
buffer[length] = '\0';
first->full_text = i3string_from_markup(buffer);
}
first->full_text = i3string_from_utf8(buffer);
}
static bool read_json_input(unsigned char *input, int length) {

View File

@ -7,6 +7,8 @@
* config.c: Parses the configuration (received from i3).
*
*/
#include "common.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@ -17,8 +19,6 @@
#include <X11/Xlib.h>
#include "common.h"
static char *cur_key;
static bool parsing_bindings;
static bool parsing_tray_outputs;

View File

@ -7,6 +7,8 @@
* ipc.c: Communicating with i3
*
*/
#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@ -21,8 +23,6 @@
#include <sanitizer/lsan_interface.h>
#endif
#include "common.h"
ev_io *i3_connection;
const char *sock_path;

View File

@ -5,6 +5,8 @@
* © 2010 Axel Wagner and contributors (see also: LICENSE)
*
*/
#include "common.h"
#include <stdio.h>
#include <i3/ipc.h>
#include <string.h>
@ -15,8 +17,6 @@
#include <getopt.h>
#include <glob.h>
#include "common.h"
/*
* Having verboselog(), errorlog() and debuglog() is necessary when using libi3.
*
@ -93,6 +93,9 @@ int main(int argc, char **argv) {
int opt;
int option_index = 0;
char *socket_path = getenv("I3SOCK");
if (socket_path != NULL) {
socket_path = sstrdup(socket_path);
}
char *i3_default_sock_path = "/tmp/i3-ipc.sock";
/* Initialize the standard config to use 0 as default */

View File

@ -7,6 +7,8 @@
* mode.c: Handle mode event and show current binding mode in the bar
*
*/
#include "common.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@ -14,8 +16,6 @@
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include "common.h"
/* A datatype to pass through the callbacks to save the state */
struct mode_json_params {
char *json;
@ -119,7 +119,7 @@ void parse_mode_json(char *json) {
state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
/* FIXME: Propper error handling for JSON parsing */
/* FIXME: Proper error handling for JSON parsing */
switch (state) {
case yajl_status_ok:
break;

View File

@ -7,6 +7,8 @@
* outputs.c: Maintaining the outputs list
*
*/
#include "common.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@ -15,8 +17,6 @@
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include "common.h"
/* A datatype to pass through the callbacks to save the state */
struct outputs_json_params {
struct outputs_head *outputs;
@ -271,7 +271,7 @@ void parse_outputs_json(char *json) {
state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
/* FIXME: Propper errorhandling for JSON-parsing */
/* FIXME: Proper errorhandling for JSON-parsing */
switch (state) {
case yajl_status_ok:
break;

View File

@ -8,6 +8,8 @@
* protocol version and features.
*
*/
#include "common.h"
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
@ -25,8 +27,6 @@
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include "common.h"
static enum {
KEY_VERSION,
KEY_STOP_SIGNAL,

View File

@ -7,6 +7,8 @@
* workspaces.c: Maintaining the workspace lists
*
*/
#include "common.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@ -14,8 +16,6 @@
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
#include "common.h"
/* A datatype to pass through the callbacks to save the state */
struct workspaces_json_params {
struct ws_head *workspaces;
@ -233,7 +233,7 @@ void parse_workspaces_json(char *json) {
state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
/* FIXME: Propper error handling for JSON parsing */
/* FIXME: Proper error handling for JSON parsing */
switch (state) {
case yajl_status_ok:
break;

View File

@ -7,16 +7,14 @@
* xcb.c: Communicating with X
*
*/
#include "common.h"
#include <xcb/xcb.h>
#include <xcb/xkb.h>
#include <xcb/xproto.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_cursor.h>
#ifdef XCB_COMPAT
#include "xcb_compat.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@ -36,7 +34,6 @@
#include <sanitizer/lsan_interface.h>
#endif
#include "common.h"
#include "libi3.h"
/** This is the equivalent of XC_left_ptr. Im not sure why xcb doesnt have a
@ -445,7 +442,7 @@ void init_colors(const struct xcb_color_strings_t *new_colors) {
/*
* Handle a button press event (i.e. a mouse click on one of our bars).
* We determine, whether the click occured on a workspace button or if the scroll-
* We determine, whether the click occurred on a workspace button or if the scroll-
* wheel was used and change the workspace appropriately
*
*/
@ -689,15 +686,17 @@ static void handle_client_message(xcb_client_message_event_t *event) {
if (op == SYSTEM_TRAY_REQUEST_DOCK) {
xcb_window_t client = event->data.data32[2];
/* Listen for PropertyNotify events to get the most recent value of
* the XEMBED_MAPPED atom, also listen for UnmapNotify events */
mask = XCB_CW_EVENT_MASK;
values[0] = XCB_EVENT_MASK_PROPERTY_CHANGE |
XCB_EVENT_MASK_STRUCTURE_NOTIFY;
xcb_change_window_attributes(xcb_connection,
client,
mask,
values);
/* Needed to get the most recent value of XEMBED_MAPPED. */
values[0] = XCB_EVENT_MASK_PROPERTY_CHANGE;
/* Needed for UnmapNotify events. */
values[0] |= XCB_EVENT_MASK_STRUCTURE_NOTIFY;
/* Needed because some tray applications (e.g., VLC) use
* override_redirect which causes no ConfigureRequest to be sent. */
values[0] |= XCB_EVENT_MASK_RESIZE_REDIRECT;
xcb_change_window_attributes(xcb_connection, client, mask, values);
/* Request the _XEMBED_INFO property. The XEMBED specification
* (which is referred by the tray specification) says this *has* to
@ -1008,13 +1007,11 @@ static void handle_property_notify(xcb_property_notify_event_t *event) {
}
/*
* Handle ConfigureRequests by denying them and sending the client a
* ConfigureNotify with its actual size.
* If a tray client attempts to change its size we deny the request and respond
* by telling it its actual size.
*
*/
static void handle_configure_request(xcb_configure_request_event_t *event) {
DLOG("ConfigureRequest for window = %08x\n", event->window);
static void handle_configuration_change(xcb_window_t window) {
trayclient *trayclient;
i3_output *output;
SLIST_FOREACH(output, outputs, slist) {
@ -1027,7 +1024,7 @@ static void handle_configure_request(xcb_configure_request_event_t *event) {
continue;
clients++;
if (trayclient->win != event->window)
if (trayclient->win != window)
continue;
xcb_rectangle_t rect;
@ -1037,7 +1034,7 @@ static void handle_configure_request(xcb_configure_request_event_t *event) {
rect.height = icon_size;
DLOG("This is a tray window. x = %d\n", rect.x);
fake_configure_notify(xcb_connection, rect, event->window, 0);
fake_configure_notify(xcb_connection, rect, window, 0);
return;
}
}
@ -1045,6 +1042,16 @@ static void handle_configure_request(xcb_configure_request_event_t *event) {
DLOG("WARNING: Could not find corresponding tray window.\n");
}
static void handle_configure_request(xcb_configure_request_event_t *event) {
DLOG("ConfigureRequest for window = %08x\n", event->window);
handle_configuration_change(event->window);
}
static void handle_resize_request(xcb_resize_request_event_t *event) {
DLOG("ResizeRequest for window = %08x\n", event->window);
handle_configuration_change(event->window);
}
/*
* This function is called immediately before the main loop locks. We flush xcb
* then (and only then)
@ -1170,6 +1177,9 @@ void xcb_chk_cb(struct ev_loop *loop, ev_check *watcher, int revents) {
case XCB_CONFIGURE_REQUEST:
/* ConfigureRequest, sent by a tray child */
handle_configure_request((xcb_configure_request_event_t *)event);
case XCB_RESIZE_REQUEST:
/* ResizeRequest sent by a tray child using override_redirect. */
handle_resize_request((xcb_resize_request_event_t *)event);
break;
}
free(event);

View File

@ -10,8 +10,9 @@
* compile-time.
*
*/
#ifndef I3_ALL_H
#define I3_ALL_H
#pragma once
#include <config.h>
#include <assert.h>
#include <stdbool.h>
@ -38,11 +39,6 @@
#include <yajl/yajl_gen.h>
#include <yajl/yajl_version.h>
/* Contains compatibility definitions for old libxcb versions */
#ifdef XCB_COMPAT
#include "xcb_compat.h"
#endif
#include "data.h"
#include "util.h"
#include "ipc.h"
@ -56,7 +52,7 @@
#include "click.h"
#include "key_press.h"
#include "floating.h"
#include "config.h"
#include "configuration.h"
#include "handlers.h"
#include "randr.h"
#include "xinerama.h"
@ -86,5 +82,3 @@
#include "display_version.h"
#include "restore_layout.h"
#include "main.h"
#endif

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Checks the list of assignments for the given window and runs all matching
* ones (unless they have already been run for this specific window).

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
extern pid_t command_error_nagbar_pid;
/**
@ -104,10 +106,10 @@ CommandResult *run_binding(Binding *bind, Con *con);
bool load_keymap(void);
/**
* Returns true if the current config has any binding to a scroll wheel button
* (4 or 5) which is a whole-window binding.
* We need this to figure out whether we should grab all buttons or just 1-3
* when managing a window. See #2049.
*
* Returns a list of buttons that should be grabbed on a window.
* This list will always contain 13, all higher buttons will only be returned
* if there is a whole-window binding for it on some window in the current
* config.
* The list is terminated by a 0.
*/
bool bindings_should_grab_scrollwheel_buttons(void);
int *bindings_get_buttons_to_grab(void);

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* The button press X callback. This function determines whether the floating
* modifier is pressed and where the user clicked (decoration, border, inside

View File

@ -9,4 +9,6 @@
*/
#pragma once
#include <config.h>
char *parse_cmd(const char *new);

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include "commands_parser.h"
/** The beginning of the prototype for every cmd_ function. */

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <yajl/yajl_gen.h>
/*

View File

@ -11,6 +11,8 @@
*/
#pragma once
#include <config.h>
/**
* Create a new container (and attach it to the given parent, if not NULL).
* This function only initializes the data structures.
@ -200,6 +202,19 @@ Con *con_for_window(Con *con, i3Window *window, Match **store_match);
*/
int con_num_children(Con *con);
/**
* Returns the number of visible non-floating children of this container.
* For example, if the container contains a hsplit which has two children,
* this will return 2 instead of 1.
*/
int con_num_visible_children(Con *con);
/**
* Count the number of windows (i.e., leaf containers).
*
*/
int con_num_windows(Con *con);
/**
* Attaches the given container to the given parent. This happens when moving
* a container or when inserting a new container at a specific place in the
@ -268,6 +283,13 @@ void con_disable_fullscreen(Con *con);
void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates,
bool dont_warp, bool ignore_focus);
/**
* Moves the given container to the currently focused container on the
* visible workspace on the given output.
*
*/
void con_move_to_output(Con *con, Output *output);
/**
* Moves the given container to the given mark.
*

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include "config_parser.h"
/**

View File

@ -9,8 +9,11 @@
*/
#pragma once
#include <config.h>
#include <yajl/yajl_gen.h>
SLIST_HEAD(variables_head, Variable);
extern pid_t config_error_nagbar_pid;
/*

View File

@ -4,7 +4,7 @@
* i3 - an improved dynamic tiling window manager
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
*
* include/config.h: Contains all structs/variables for the configurable
* include/configuration.h: Contains all structs/variables for the configurable
* part of i3 as well as functions handling the configuration file (calling
* the parser (src/config_parse.c) with the correct path, switching key
* bindings mode).
@ -12,10 +12,11 @@
*/
#pragma once
#include "libi3.h"
#include <stdbool.h>
#include "queue.h"
#include "i3.h"
#include "libi3.h"
typedef struct Config Config;
typedef struct Barconfig Barconfig;
@ -125,7 +126,7 @@ struct Config {
* This is useful if you are reaching scrollbar on the edge of the
* screen or do not want to waste a single pixel of displayspace.
* By default, this is disabled. */
adjacent_t hide_edge_borders;
hide_edge_borders_mode_t hide_edge_borders;
/** By default, a workspace bar is drawn at the bottom of the screen.
* If you want to have a more fancy bar, it is recommended to replace

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include "libi3.h"
#define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launcher.h>
@ -17,7 +19,6 @@
#include <pcre.h>
#include <sys/time.h>
#include "libi3.h"
#include "queue.h"
/*
@ -75,6 +76,12 @@ typedef enum { ADJ_NONE = 0,
ADJ_UPPER_SCREEN_EDGE = (1 << 2),
ADJ_LOWER_SCREEN_EDGE = (1 << 4) } adjacent_t;
typedef enum { HEBM_NONE = ADJ_NONE,
HEBM_VERTICAL = ADJ_LEFT_SCREEN_EDGE | ADJ_RIGHT_SCREEN_EDGE,
HEBM_HORIZONTAL = ADJ_UPPER_SCREEN_EDGE | ADJ_LOWER_SCREEN_EDGE,
HEBM_BOTH = HEBM_VERTICAL | HEBM_HORIZONTAL,
HEBM_SMART = (1 << 5) } hide_edge_borders_mode_t;
typedef enum { MM_REPLACE,
MM_ADD } mark_mode_t;
@ -237,6 +244,17 @@ struct regex {
pcre_extra *extra;
};
/**
* Stores a resolved keycode (from a keysym), including the modifier mask. Will
* be passed to xcb_grab_key().
*
*/
struct Binding_Keycode {
xcb_keycode_t keycode;
i3_event_state_mask_t modifiers;
TAILQ_ENTRY(Binding_Keycode) keycodes;
};
/******************************************************************************
* Major types
*****************************************************************************/
@ -275,8 +293,6 @@ struct Binding {
* title bar (default). */
bool whole_window;
uint32_t number_keycodes;
/** Keycode to bind */
uint32_t keycode;
@ -290,12 +306,10 @@ struct Binding {
* if the keyboard mapping changes (using Xmodmap for example) */
char *symbol;
/** Only in use if symbol != NULL. Gets set to the value to which the
* symbol got translated when binding. Useful for unbinding and
* checking which binding was used when a key press event comes in.
*
* This is an array of number_keycodes size. */
xcb_keycode_t *translated_to;
/** Only in use if symbol != NULL. Contains keycodes which generate the
* specified symbol. Useful for unbinding and checking which binding was
* used when a key press event comes in. */
TAILQ_HEAD(keycodes_head, Binding_Keycode) keycodes_head;
/** Command, like in command mode */
char *command;
@ -461,9 +475,9 @@ struct Match {
M_DOCK_BOTTOM = 3
} dock;
xcb_window_t id;
enum { M_ANY = 0,
M_TILING,
M_FLOATING } floating;
enum { WM_ANY = 0,
WM_TILING,
WM_FLOATING } window_mode;
Con *con_id;
/* Where the window looking for a match should be inserted:
@ -686,4 +700,7 @@ struct Con {
/* Depth of the container window */
uint16_t depth;
/* The colormap for this con if a custom one is used. */
xcb_colormap_t colormap;
};

View File

@ -10,4 +10,6 @@
*/
#pragma once
#include <config.h>
int handle_event(void *ignored, xcb_connection_t *c, xcb_generic_event_t *e);

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Connects to i3 to find out the currently running version. Useful since it
* might be different from the version compiled into this binary (maybe the

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Updates _NET_CURRENT_DESKTOP with the current desktop number.
*

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
/**
* Creates outputs according to the given specification.
* The specification must be in the format wxh+x+y, for example 1024x768+0+0,

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include "tree.h"
/** Callback for dragging */
@ -76,25 +78,6 @@ void floating_center(Con *con, Rect rect);
*/
void floating_move_to_pointer(Con *con);
#if 0
/**
* Removes the floating client from its workspace and attaches it to the new
* workspace. This is centralized here because it may happen if you move it
* via keyboard and if you move it using your mouse.
*
*/
void floating_assign_to_workspace(Client *client, Workspace *new_workspace);
/**
* Called whenever the user clicks on a border (not the titlebar!) of a
* floating window. Determines on which border the user clicked and launches
* the drag_pointer function with the resize_callback.
*
*/
int floating_border_click(xcb_connection_t *conn, Client *client,
xcb_button_press_event_t *event);
#endif
/**
* Called when the user clicked on the titlebar of a floating window.
* Calls the drag_pointer function with the drag_window callback
@ -118,32 +101,6 @@ void floating_resize_window(Con *con, const bool proportional, const xcb_button_
*/
void floating_check_size(Con *floating_con);
#if 0
/**
* Changes focus in the given direction for floating clients.
*
* Changing to the left/right means going to the previous/next floating client,
* changing to top/bottom means cycling through the Z-index.
*
*/
void floating_focus_direction(xcb_connection_t *conn, Client *currently_focused,
direction_t direction);
/**
* Moves the client 10px to the specified direction.
*
*/
void floating_move(xcb_connection_t *conn, Client *currently_focused,
direction_t direction);
/**
* Hides all floating clients (or show them if they are currently hidden) on
* the specified workspace.
*
*/
void floating_toggle_hide(xcb_connection_t *conn, Workspace *workspace);
#endif
/**
* This is the return value of a drag operation like drag_pointer.
*

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
#include <xcb/randr.h>
extern int randr_base;

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <sys/time.h>
#include <sys/resource.h>

View File

@ -51,34 +51,22 @@ typedef struct i3_ipc_header {
/** Request the i3 version */
#define I3_IPC_MESSAGE_TYPE_GET_VERSION 7
/** Request a list of configured binding modes. */
#define I3_IPC_MESSAGE_TYPE_GET_BINDING_MODES 8
/*
* Messages from i3 to clients
*
*/
/** Command reply type */
#define I3_IPC_REPLY_TYPE_COMMAND 0
/** Workspaces reply type */
#define I3_IPC_REPLY_TYPE_WORKSPACES 1
/** Subscription reply type */
#define I3_IPC_REPLY_TYPE_SUBSCRIBE 2
/** Outputs reply type */
#define I3_IPC_REPLY_TYPE_OUTPUTS 3
/** Tree reply type */
#define I3_IPC_REPLY_TYPE_TREE 4
/** Marks reply type */
#define I3_IPC_REPLY_TYPE_MARKS 5
/** Bar config reply type */
#define I3_IPC_REPLY_TYPE_BAR_CONFIG 6
/** i3 version reply type */
#define I3_IPC_REPLY_TYPE_VERSION 7
#define I3_IPC_REPLY_TYPE_BINDING_MODES 8
/*
* Events from i3 to clients. Events have the first bit set high.

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <ev.h>
#include <stdbool.h>
#include <yajl/yajl_gen.h>
@ -16,7 +18,7 @@
#include "data.h"
#include "tree.h"
#include "config.h"
#include "configuration.h"
#include "i3/ipc.h"

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* There was a key press. We compare this key code with our bindings table and pass
* the bound action to parse_command().

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
#include <stdbool.h>
#include <stdarg.h>
#include <stdio.h>
@ -17,12 +19,8 @@
#include <xcb/xproto.h>
#include <xcb/xcb_keysyms.h>
#if PANGO_SUPPORT
#include <pango/pango.h>
#endif
#ifdef CAIRO_SUPPORT
#include <cairo/cairo-xcb.h>
#endif
#define DEFAULT_DIR_MODE (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
@ -73,10 +71,8 @@ struct Font {
xcb_charinfo_t *table;
} xcb;
#if PANGO_SUPPORT
/** The pango font description */
PangoFontDescription *pango_desc;
#endif
} specific;
};
@ -95,7 +91,7 @@ void errorlog(char *fmt, ...)
#if !defined(DLOG)
void debuglog(char *fmt, ...)
__attribute__((format(printf, 1, 2)));
#define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, I3__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
#define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, STRIPPED__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
#endif
/**
@ -470,6 +466,13 @@ char *get_process_filename(const char *prefix);
*/
char *get_exe_path(const char *argv0);
/**
* Initialize the DPI setting.
* This will use the 'Xft.dpi' X resource if available and fall back to
* guessing the correct value otherwise.
*/
void init_dpi(void);
/**
* Convert a logical amount of pixels (e.g. 2 pixels on a standard 96 DPI
* screen) to a corresponding amount of physical pixels on a standard or retina
@ -518,7 +521,6 @@ typedef struct placeholder_t {
*/
char *format_placeholders(char *format, placeholder_t *placeholders, int num);
#ifdef CAIRO_SUPPORT
/* We need to flush cairo surfaces twice to avoid an assertion bug. See #1989
* and https://bugs.freedesktop.org/show_bug.cgi?id=92455. */
#define CAIRO_SURFACE_FLUSH(surface) \
@ -526,7 +528,6 @@ char *format_placeholders(char *format, placeholder_t *placeholders, int num);
cairo_surface_flush(surface); \
cairo_surface_flush(surface); \
} while (0)
#endif
/* A wrapper grouping an XCB drawable and both a graphics context
* and the corresponding cairo objects representing it. */
@ -542,14 +543,12 @@ typedef struct surface_t {
int width;
int height;
#ifdef CAIRO_SUPPORT
/* A cairo surface representing the drawable. */
cairo_surface_t *surface;
/* The cairo object representing the drawable. In general,
* this is what one should use for any drawing operation. */
cairo_t *cr;
#endif
} surface_t;
/**

View File

@ -10,6 +10,8 @@
*/
#pragma once
#include <config.h>
typedef enum {
// We could not determine the content of the JSON file. This typically
// means its unreadable or contains garbage.

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include <stdarg.h>
#include <stdbool.h>
@ -27,7 +29,7 @@
is, delete the preceding comma */
#define LOG(fmt, ...) verboselog(fmt, ##__VA_ARGS__)
#define ELOG(fmt, ...) errorlog("ERROR: " fmt, ##__VA_ARGS__)
#define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, I3__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
#define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, STRIPPED__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
extern char *errorfilename;
extern char *shmlogname;

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Enable or disable the main X11 event handling function.
* This is used by drag_pointer() which has its own, modal event handler, which

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
#include "data.h"
/**
@ -35,19 +37,3 @@ void restore_geometry(void);
void manage_window(xcb_window_t window,
xcb_get_window_attributes_cookie_t cookie,
bool needs_to_be_mapped);
#if 0
/**
* reparent_window() gets called when a new window was opened and becomes a
* child of the root window, or it gets called by us when we manage the
* already existing windows at startup.
*
* Essentially, this is the point where we take over control.
*
*/
void reparent_window(xcb_connection_t *conn, xcb_window_t child,
xcb_visualid_t visual, xcb_window_t root, uint8_t depth,
int16_t x, int16_t y, uint16_t width, uint16_t height,
uint32_t border_width);
#endif

View File

@ -13,6 +13,8 @@
*/
#pragma once
#include <config.h>
/*
* Initializes the Match data structure. This function is necessary because the
* members representing boolean values (like dock) need to be initialized with

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Moves the given container in the given direction (TOK_LEFT, TOK_RIGHT,
* TOK_UP, TOK_DOWN from cmdparse.l)

View File

@ -9,6 +9,8 @@
*/
#pragma once
#include <config.h>
/**
* Returns the output container below the given output container.
*
@ -22,6 +24,12 @@ Con *output_get_content(Con *output);
*/
Output *get_output_from_string(Output *current_output, const char *output_str);
/**
* Returns the output for the given con.
*
*/
Output *get_output_for_con(Con *con);
/**
* Iterates over all outputs and pushes sticky windows to the currently visible
* workspace on that output.

View File

@ -11,6 +11,8 @@
*/
#pragma once
#include <config.h>
#include "data.h"
#include <xcb/randr.h>
@ -60,6 +62,12 @@ void init_ws_for_output(Output *output, Con *content);
*/
void randr_query_outputs(void);
/**
* Disables the output and moves its content.
*
*/
void randr_disable_output(Output *output);
/**
* Returns the first output which is active.
*
@ -79,6 +87,13 @@ Output *get_output_by_name(const char *name);
*/
Output *get_output_containing(unsigned int x, unsigned int y);
/**
* Returns the active output which spans exactly the area specified by
* rect or NULL if there is no output like this.
*
*/
Output *get_output_with_dimensions(Rect rect);
/*
* In contained_by_output, we check if any active output contains part of the container.
* We do this by checking if the output rect is intersected by the Rect.

Some files were not shown because too many files have changed in this diff Show More