diff --git a/RELEASE-NOTES-4.1 b/RELEASE-NOTES-4.1
new file mode 100644
index 00000000..de06c3ab
--- /dev/null
+++ b/RELEASE-NOTES-4.1
@@ -0,0 +1,100 @@
+
+ ┌────────────────────────────┐
+ │ Release notes for i3 v4.1 │
+ └────────────────────────────┘
+
+This is the second release of the new major version of i3, v4.1. It brings some
+new (and long-awaited) features, the most prominent being tray support in i3bar
+(for NetworkManager, Skype, etc.).
+
+The assign syntax has changed to support criteria now. Also, criteria support
+regular expressions (using PCRE) now. Check the userguide for the new syntax.
+i3-nagbar will automatically display a warning when you use the old syntax.
+
+i3 now supports startup notifications, meaning that during an application
+starts up, the mouse cursor will change to 'watch' on the root window. Also,
+the application window will appear on the workspace on which it was launched
+(not on the currently focused workspace). Some applications don’t support
+startup notifications. If the cursor change bothers you, turn it off by using
+the --no-startup-id flag (see the userguide).
+
+This release has been in use by many users and is considered stable. Please
+upgrade.
+
+
+ ┌────────────────────────────┐
+ │ New features │
+ └────────────────────────────┘
+
+ • Switch to dpkg-source 3.0 (quilt) and compat level 7
+ • Implement system tray support in i3bar (for NetworkManager, Skype, …)
+ • i3bar is now configurable in the i3 configfile
+ • Implement support for PCRE regular expressions in criteria
+ • Implement a new assign syntax which uses criteria
+ • Sort named workspaces whose name starts with a number accordingly
+ • Warn on duplicate bindings for the same key
+ • Restrict 'resize' command to left/right for horizontal containers, up/down
+ for vertical containers
+ • Implement support for startup notifications (cursor will change to 'watch',
+ started applications show up on the workspace they have been launched on)
+ • Implement the GET_MARKS IPC request to get all marks
+ • Implement the new_float config option (border style for floating windows)
+ • Implement passing IPC sockets to i3 (systemd-style socket activation)
+ • Implement the 'move output' command to move containers to a specific output
+ • Implement focus switching for floating windows
+ • Implement the window_role criterion (for matching multi-window apps)
+ • Implement a force_xinerama configuration directive
+ • Implement the --get-socketpath, useful for scripts using the IPC interface
+ • Implement the 'move workspace next' and 'move workspace prev' commands
+ • Implement the 'workspace back_and_forth' command and related configuration
+ option
+ • Implement the move command for floating windows
+ • i3 will now handle arbitrary text arguments by sending them as an IPC
+ command, like i3-msg: 'i3 reload' or 'i3 move workspace 3'
+ • Introduce the i3-sensible-{pager,editor,terminal} scripts to execute
+ $PAGER, $EDITOR or an available terminal emulator
+ • i3-input: implement -F (format) option
+
+
+ ┌────────────────────────────┐
+ │ Bugfixes │
+ └────────────────────────────┘
+
+ • Bugfix: Preserve marks when restarting
+ • Bugfix: Correctly free old assignments when reloading
+ • Bugfix: Fix flickering when moving floating windows between monitors
+ • Bugfix: Correctly handle ConfigureRequests for floating windows in a
+ multi-monitor environment.
+ • Bugfix: Fix size of floating windows with X11 borders
+ • Bugfix: Always adjust floating window position when moving to another
+ output
+ • Bugfix: Avoid out-of-bounds coordinates when moving floating windows
+ • Bugfix: Don’t steal focus when a window gets destroyed
+ • Bugfix: Correctly split key/value when parsing variables
+ • Bugfix: Correctly revert focus to other floating windows when closing a
+ floating window
+ • Bugfix: Don’t leak the error logfile file descriptor
+ • Bugfix: Don’t steal focus when a window opens on an invisible workspace due
+ to assignments
+ • Bugfix: Fix handling of Mode_switch in i3-input
+ • Bugfix: Close invisible workspaces when they become empty
+ • Bugfix: Don’t invoke interactive resizing when clicking on the decoration
+ of a split container with more than one child (switch focus instead)
+ • Bugfix: Make named workspace assignments work again
+ • Bugfix: RandR: Correctly keep focus on the focused workspace when an output
+ disappears
+ • Bugfix: Insert container at the correct position on workspace level when
+ workspace_layout == default
+
+
+ ┌────────────────────────────┐
+ │ Thanks! │
+ └────────────────────────────┘
+
+Thanks for testing, bugfixes, discussions and everything I forgot go out to:
+
+ aksr, alexanderb, atsutane, bacardi55, bjonnh, brian, cls, don, donald,
+ eeemsi, f8l, fernandotcl, isolnchip, julien, motif, mw, mxf, phnom, pl,
+ pnutzh4x0r, raphael, sardemff7, stfn, thomasba, xeen
+
+-- Michael Stapelberg, 2011-11-11
diff --git a/debian/changelog b/debian/changelog
index 2e006168..be459af5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
i3-wm (4.1-1) unstable; urgency=low
+ * Switch to dpkg-source 3.0 (quilt) and compat level 7
* Implement system tray support in i3bar (for NetworkManager, Skype, …)
* i3bar is now configurable in the i3 configfile
* Implement support for PCRE regular expressions in criteria
diff --git a/debian/i3-wm.docs b/debian/i3-wm.docs
index baef7cdb..e5896855 100644
--- a/debian/i3-wm.docs
+++ b/debian/i3-wm.docs
@@ -15,3 +15,5 @@ docs/wsbar.png
docs/keyboard-layer1.png
docs/keyboard-layer2.png
docs/testsuite.html
+docs/i3-sync-working.png
+docs/i3-sync.png
diff --git a/debian/i3-wm.manpages b/debian/i3-wm.manpages
index 828a26d7..2de3a995 100644
--- a/debian/i3-wm.manpages
+++ b/debian/i3-wm.manpages
@@ -4,4 +4,7 @@ man/i3-input.1
man/i3-nagbar.1
man/i3-config-wizard.1
man/i3-migrate-config-to-v4.1
+man/i3-sensible-pager.1
+man/i3-sensible-editor.1
+man/i3-sensible-terminal.1
i3bar/doc/i3bar.1
diff --git a/debian/patches/manpage-x-terminal-emulator.patch b/debian/patches/manpage-x-terminal-emulator.patch
new file mode 100644
index 00000000..61ff0160
--- /dev/null
+++ b/debian/patches/manpage-x-terminal-emulator.patch
@@ -0,0 +1,14 @@
+## Description: Document Debian-specific x-terminal-emulator in the manpage.
+## Origin/Author: Michael Stapelberg
+Index: i3-4.1/man/i3-sensible-terminal.man
+===================================================================
+--- i3-4.1.orig/man/i3-sensible-terminal.man 2011-11-11 22:38:06.508025537 +0000
++++ i3-4.1/man/i3-sensible-terminal.man 2011-11-11 22:38:04.752994892 +0000
+@@ -22,6 +22,7 @@
+ It tries to start one of the following (in that order):
+
+ * $TERMINAL (this is a non-standard variable)
++* x-terminal-emulator (only on Debian)
+ * xterm
+ * urxvt
+ * rxvt
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 00000000..08d60ae0
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+use-x-terminal-emulator.patch
+manpage-x-terminal-emulator.patch
diff --git a/debian/patches/use-x-terminal-emulator.patch b/debian/patches/use-x-terminal-emulator.patch
new file mode 100644
index 00000000..fd515c16
--- /dev/null
+++ b/debian/patches/use-x-terminal-emulator.patch
@@ -0,0 +1,21 @@
+## Description: Use Debian-specific x-terminal-emulator in i3-sensible-terminal
+## Origin/Author: Michael Stapelberg
+--- a/i3-sensible-terminal.O 2011-11-11 22:03:52.414218386 +0000
++++ b/i3-sensible-terminal 2011-11-11 22:04:38.372020210 +0000
+@@ -1,13 +1,11 @@
+ #!/bin/sh
+ # This script tries to exec a terminal emulator by trying some known terminal
+ # emulators.
+-#
+-# Distributions/packagers should enhance this script with a
+-# distribution-specific mechanism to find the preferred terminal emulator. On
+-# Debian, there is the x-terminal-emulator symlink for example.
+-# Please don't touch the first line, though:
+ which $TERMINAL >/dev/null && exec $TERMINAL "$@"
+
++# Debian-specific: use x-terminal-emulator
++which x-terminal-emulator >/dev/null && exec x-terminal-emulator "$@"
++
+ # Hopefully one of these is installed:
+ which xterm >/dev/null && exec xterm "$@"
+ which urxvt >/dev/null && exec urxvt "$@"
diff --git a/man/Makefile b/man/Makefile
index facea287..44b2df6e 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -1,6 +1,6 @@
A2M:=a2x -f manpage --asciidoc-opts="-f asciidoc.conf"
-all: i3.1 i3-msg.1 i3-input.1 i3-nagbar.1 i3-wsbar.1 i3-config-wizard.1 i3-migrate-config-to-v4.1
+all: i3.1 i3-msg.1 i3-input.1 i3-nagbar.1 i3-wsbar.1 i3-config-wizard.1 i3-migrate-config-to-v4.1 i3-sensible-editor.1 i3-sensible-pager.1 i3-sensible-terminal.1
%.1: %.man asciidoc.conf
${A2M} $<
@@ -9,7 +9,7 @@ i3-wsbar.1: ../i3-wsbar
pod2man $^ > $@
clean:
- for file in $$(echo i3 i3-msg i3-input i3-nagbar i3-wsbar i3-config-wizard i3-migrate-config-to-v4); \
+ for file in $$(echo i3 i3-msg i3-input i3-nagbar i3-wsbar i3-config-wizard i3-migrate-config-to-v4 i3-sensible-editor i3-sensible-pager i3-sensible-terminal); \
do \
rm -f $${file}.1 $${file}.html $${file}.xml; \
done
diff --git a/man/asciidoc.conf b/man/asciidoc.conf
index cca0680b..ead3567f 100644
--- a/man/asciidoc.conf
+++ b/man/asciidoc.conf
@@ -7,7 +7,7 @@ template::[header-declarations]
{mantitle}
{manvolnum}
i3
-4.0.2
+4.1
i3 Manual
diff --git a/man/i3-sensible-editor.man b/man/i3-sensible-editor.man
new file mode 100644
index 00000000..86fbf840
--- /dev/null
+++ b/man/i3-sensible-editor.man
@@ -0,0 +1,36 @@
+i3-sensible-editor(1)
+===================
+Michael Stapelberg
+v4.1, November 2011
+
+== NAME
+
+i3-sensible-editor - launches $EDITOR with fallbacks
+
+== SYNOPSIS
+
+i3-sensible-editor [arguments]
+
+== DESCRIPTION
+
+i3-sensible-editor is used by i3-nagbar(1) when you click on the edit button.
+
+It tries to start one of the following (in that order):
+
+* $VISUAL
+* $EDITOR
+* nano
+* vim
+* vi
+* emacs
+
+Please don’t complain about the order: If the user has any preference, he will
+have $VISUAL or $EDITOR set.
+
+== SEE ALSO
+
+i3(1)
+
+== AUTHOR
+
+Michael Stapelberg and contributors
diff --git a/man/i3-sensible-pager.man b/man/i3-sensible-pager.man
new file mode 100644
index 00000000..73bd2fda
--- /dev/null
+++ b/man/i3-sensible-pager.man
@@ -0,0 +1,34 @@
+i3-sensible-pager(1)
+===================
+Michael Stapelberg
+v4.1, November 2011
+
+== NAME
+
+i3-sensible-pager - launches $PAGER with fallbacks
+
+== SYNOPSIS
+
+i3-sensible-pager [arguments]
+
+== DESCRIPTION
+
+i3-sensible-pager is used by i3-nagbar(1) when you click on the view button.
+
+It tries to start one of the following (in that order):
+
+* $PAGER
+* most
+* less
+* i3-sensible-editor(1)
+
+Please don’t complain about the order: If the user has any preference, he will
+have $PAGER set.
+
+== SEE ALSO
+
+i3(1)
+
+== AUTHOR
+
+Michael Stapelberg and contributors
diff --git a/man/i3-sensible-terminal.man b/man/i3-sensible-terminal.man
new file mode 100644
index 00000000..140e412b
--- /dev/null
+++ b/man/i3-sensible-terminal.man
@@ -0,0 +1,39 @@
+i3-sensible-terminal(1)
+=======================
+Michael Stapelberg
+v4.1, November 2011
+
+== NAME
+
+i3-sensible-terminal - launches $TERMINAL with fallbacks
+
+== SYNOPSIS
+
+i3-sensible-terminal [arguments]
+
+== DESCRIPTION
+
+i3-sensible-terminal is invoked in the i3 default config to start a terminal.
+This wrapper script is necessary since there is no distribution-independent
+terminal launcher (but for example Debian has x-terminal-emulator).
+Distribution packagers are responsible for shipping this script in a way which
+is appropriate for the distribution.
+
+It tries to start one of the following (in that order):
+
+* $TERMINAL (this is a non-standard variable)
+* xterm
+* urxvt
+* rxvt
+* roxterm
+
+Please don’t complain about the order: If the user has any preference, he will
+have $TERMINAL set or modified his i3 configuration file.
+
+== SEE ALSO
+
+i3(1)
+
+== AUTHOR
+
+Michael Stapelberg and contributors