Commit Graph

112 Commits (c3a18104cd6889e36a077b23cf385b98d0a4c526)

Author SHA1 Message Date
Michael Stapelberg 6420b2b102 Introduce the i3-sensible-{pager,editor,terminal} scripts
The former two provide fallbacks in case $PAGER or $EDITOR is not set (which
might be more common than you think, because they have to be set in
~/.xsession, not in the shell configuration!) while the latter tries to launch
a terminal emulator. The scripts are most prominently used in i3-nagbar, which
alerts the user when the configuration is broken for some reason. Also,
i3-sensible-terminal is used in the default configuration.

This commit does not rely on the shell supporting ${PAGER:-less} anymore, which
is not the case for 'fish'.
2011-09-25 18:46:37 +01:00
Michael Stapelberg 143663f031 Merge branch 'master' into next 2011-09-20 22:37:08 +01:00
Michael Stapelberg 77ae3cd8f7 Bugfix: use bufcopy instead of buf when boundary checking (Thanks thomasba)
Also replace the useless (bufcopy + (next - bufcopy)) with next
2011-09-20 22:36:23 +01:00
Michael Stapelberg de7c2841ed Merge branch 'master' into next 2011-09-20 21:42:51 +01:00
Michael Stapelberg cd6c3fedcb A bit more boundary-checking when replacing variables.
Makes valgrind happy
2011-09-20 21:42:26 +01:00
Michael Stapelberg e1949aa694 Bugfix: Correctly split key/value when parsing variables (Thanks xeen) 2011-09-20 21:42:09 +01:00
Michael Walle 5aa43d61f8 Add force_xinerama configuration option
The configuration option does the same as the commandline parameter, except
it can be easily set by the user (e.g. you are using KDM and can't start a
session through ~/.xsession).

Signed-off-by: Michael Walle <michael@walle.cc>
2011-09-19 23:10:38 +01:00
Michael Stapelberg b3adaa2983 Implement the window_role criterion (checks WM_WINDOW_ROLE)
Closes: #446

This is handy for matching specific windows of a multi-window application, for
example only Pidgin’s buddy list window.
2011-09-18 16:05:10 +01:00
Michael Stapelberg fe35c80741 Also make compilation possible on systems with libev 3
From the source:

    We need ev >= 4 for the following code. Since it is not *that* important
    (it only makes sure that there are no i3-nagbar instances left behind) we
    still support old systems with libev 3.
2011-09-17 17:55:36 +01:00
Michael Stapelberg 2c7148c46e Same bugfix as 2a215fd, but for assignments with invalid criteria 2011-09-11 22:54:41 +01:00
Michael Stapelberg 717ae819c5 Merge branch 'master' into next 2011-09-11 22:52:44 +01:00
Michael Stapelberg 2a215fd7e2 Bugfix: Ignore for_window commands with empty (invalid) criteria (+test) (Thanks aksr) 2011-09-11 22:52:33 +01:00
Michael Stapelberg d82698efa7 make the old assign syntax trigger an i3-nagbar warning (it’s deprecated), adjust test 2011-09-11 22:01:36 +01:00
Michael Stapelberg e47e100819 Introduce a new syntax for the 'assign' command:
Instead of using a quoted string to specify the class / title, the assign
command now uses criteria, just like the for_window command or the command
scopes.

An example comes here:

    # Assign all Chromium windows (including popups) to workspace 1: www
    assign [class="^Chromium$"] → 1: www

    # Make the main browser window borderless
    for_window [class="^Chromium$" title=" - Chromium$"] border none

This gives you more control over the matching process due to various reasons:

1) Criteria work case-sensitive by default. Use the (?i) option if you want a
   case-insensitive match, like this:
   assign [class="(?i)^ChroMIUM$"] → 1

2) class and instance of WM_CLASS can now be matched separately. For example,
   when starting urxvt -name irssi, xprop will report this:
   WM_CLASS(STRING) = "irssi", "URxvt"
   The first part of this is the instance ("irssi"), the second part is the
   class ("URxvt").
   An appropriate assignment looks like this:
   assign [class="^URxvt$" instance="irssi"] → 2

3) You can now freely use a forward slash (/) in all strings since that is no
   longer used to separate class from title (in-band signaling is bad, mhkay?).
2011-09-11 21:54:13 +01:00
Michael Stapelberg d03dffe012 Kill left-over i3-nagbar processes on 'exit' 2011-09-11 21:49:35 +01:00
Michael Stapelberg b3e1fb1f3b Make the old 'assign' case-insensitive again (+test) (Thanks aksr) 2011-09-11 21:16:45 +01:00
Michael Stapelberg 2fc54aadf1 Implement support for PCRE regular expressions for all criteria (for_window, commands, assignments) 2011-09-10 23:53:11 +01:00
Michael Stapelberg b4809e9ba7 Merge branch 'master' into next 2011-08-31 14:45:14 +02:00
Michael Stapelberg e1631d6320 properly free memory/close fd upon errors (Thanks xeen)
Found with the static analyzer cppcheck
2011-08-31 14:44:48 +02:00
Michael Stapelberg afff328c59 Merge branch 'master' into next 2011-08-26 12:37:04 +02:00
Michael Stapelberg 12e15609ef Bugfix: Correctly recognize duplicate workspace assignments (Thanks Moredread)
Example of a faulty config:

    workspace 5 VGA1
    workspace 5 LVDS1

Fixes #498, #499
2011-08-26 12:35:42 +02:00
Michael Stapelberg 4984b81282 Merge branch 'master' into next 2011-08-25 21:59:19 +02:00
Michael Stapelberg f06059ec94 Bugfix: Accept '\t' in the 'set' command, don’t die but ELOG in case of errors (Thanks atsutane) 2011-08-25 21:58:03 +02:00
Mateusz Poszwa 42db9de7ec Add new_float config option.
This option sets the default border style for containers automatically put into floating mode.

Fixes #264
2011-08-09 09:29:53 +02:00
Michael Stapelberg 4253aa4ba2 Merge branch 'master' into next 2011-08-09 09:27:55 +02:00
Peter Bui 5e06b1b21d Fix some potential memory leaks 2011-08-09 09:27:15 +02:00
Michael Stapelberg ecc2cae3f7 Bugfix: use ELOG to actually get the error message into the logfile shown by i3-nagbar 2011-08-04 21:43:55 +02:00
Michael Stapelberg 4e350664ae Bugfix: Check that ->symbol != NULL before using strcasecmp() 2011-08-04 21:38:13 +02:00
Michael Stapelberg 787dd4059f little style fixes for the previous patch 2011-08-04 21:25:47 +02:00
Radek Tříška 9d101d8473 check_for_duplicate_bindings 2011-08-04 20:37:01 +02:00
Mateusz Poszwa 1913bf0e5c Add "instance" to matching criteria 2011-08-04 20:10:31 +02:00
Michael Stapelberg c883e7050a Include <limits.h> in all.h 2011-08-04 00:10:04 +02:00
Michael Stapelberg 92481b133c docs/userguide: the correct command is 'floating enable', not 'mode floating' (Thanks Sander)
Fixes: #453
2011-08-03 20:48:28 +02:00
Michael Stapelberg 554a43ca4a Bugfix: Make the criteria rules recursive in src/cfgparse.y, too (Thanks f8l) 2011-08-02 19:46:14 +02:00
Michael Stapelberg 3204caa98d i3-migrate-config-to-v4: drop the .pl suffix
As lintian (a Debian package checker) mentions, it is more clever to install it
without the extension, since the implementation language might change.
2011-07-31 23:11:05 +02:00
Michael Stapelberg cbfcf5bd8b Bugfix: free font string after using it 2011-07-31 17:54:53 +02:00
Michael Stapelberg ee83df9684 Bugfix: cfgparse: correctly free parser/lexer 2011-07-31 17:50:54 +02:00
Michael Stapelberg 797ba5f7c8 remove unnecessary close, because fclose already closes the file descriptor 2011-07-24 18:42:46 +02:00
Michael Stapelberg 370715d1a8 Bugfix: Don’t leak file descriptor 2011-07-23 22:11:01 +02:00
Michael Stapelberg 8c1a242f5f reload the config after editing it through i3-nagbar 2011-07-13 18:47:08 +02:00
Claudio Marforio cc24a96e96 patch to allow exec_always in configure file
fixed indentation, updated docs
2011-07-12 18:23:14 +02:00
Michael Stapelberg 897b53f1c2 Bugfix: run nagbar commands through sh(1) (Thanks Tucos) 2011-07-11 16:51:57 +02:00
Michael Stapelberg 429d310011 nagbar: use less / vi as fallbacks for PAGER / EDITOR 2011-07-11 16:40:10 +02:00
Michael Stapelberg c55abca115 add i3-nagbar. tells you about config file errors (for example) 2011-07-10 14:33:19 +02:00
Michael Stapelberg 0ca229ceb3 migrate-config: also make force_focus_wrapping a v4-only statement 2011-07-08 00:17:48 +02:00
Michael Stapelberg ac335fcffa Automatically call the migration script when the config does not look like v4 2011-07-06 20:43:00 +02:00
Michael Stapelberg e5c811248f Bugfix: Fix floating assignments, extend test for the assign command (Thanks Tucos) 2011-06-13 17:42:59 +02:00
Michael Stapelberg d641e1da3b Don’t force wrapping when focusing in a direction would work (+test)
Think of the following layout:

 -------------
 | tab |     |
 | con | win |
 |     |     |
 -------------

The tabbed container on the left has two children. Assume you have focused the
second/right child in the tabbed container. i3 used to focus the first/left
container of the tabbed container when using 'focus right' (it wrapped focus).

With this commit, the default behaviour is to instead focus the window on the
right of the screen.

The intention is to make focus switching more intuitive, especially with tabbed
containers supporting 'focus left'/'focus right' in tree. You should end up
using less 'focus parent' :).

You can force the old behaviour with 'force_focus_wrapping true' in your
config.

Code coverage is 62.5% with this commit.
2011-06-12 12:56:50 +02:00
Michael Stapelberg 2c68c234ea Implement assignments for (named) workspaces, with '~' compatibility (floating) 2011-05-23 18:41:17 +02:00
Michael Stapelberg 1d6447187c cleanup cfgparse lexer/parser (ignore whitespace, solves conflicts) 2011-05-22 21:48:25 +02:00