Commit Graph

52 Commits (0b621292246f2736eeed82ef106f64749c058f68)

Author SHA1 Message Date
Orestis Floros 0b62129224
Remove unused headers
With help from
https://github.com/include-what-you-use/include-what-you-use/
2020-04-20 04:25:06 +02:00
Orestis Floros 3c522d9f2f
Sort includes in *.c files
Not enabling in .clang-format because it breaks headers files.

Used:
    IncludeCategories:
      - Regex:           '^<config'
        Priority:        0
      - Regex:           '^".*"'
        Priority:        1
      - Regex:           '^<(xcb|xkb|yajl|X11)'
        Priority:        3
      - Regex:           '.*'
        Priority:        2
2020-04-19 09:58:25 +02:00
Albert Safin 83c7aff089 Limit workspace numbers within 0..INT32_MAX
Before this commit, large workspace numbers treated oddly:

   $ i3-msg 'rename workspace to 1234567890'
   # displayed in i3bar as `0`

   $ i3-msg 'rename workspace to 4294967200'
   $ i3-msg -t get_workspaces | jq '.[]|select(.focused).num'
   -96 # int32_t overflow

   $ i3-msg 'rename workspace to 99999999999999999999'
   $ i3-msg -t get_workspaces | jq '.[]|select(.focused).num'
   -1 # treated as unnumbered

This commit puts a consistent limit on workspace numbers.  Now
workspaces with numbers beyond INT32_MAX are treated as unnumbered.
2020-02-21 02:07:04 +00:00
xzfc 1f0c628cde
clang-format: bring back ForeachMacros (#3948)
* clang-format: bring back ForeachMacros

ForeachMacros was disabled in 4211274fcd
due to the breakage of include/queue.h. The currently used version,
clang-format-6.0 doesn't break it.

* Add curly braces

Co-authored-by: Orestis Floros <orestisflo@gmail.com>
2020-02-19 11:31:09 +01:00
Iskustvo 5835bbc385 Added workspace ID in GET_WORKSPACES response. 2020-01-08 09:07:53 +01:00
hwangcc23 2269b2e795 Add strip_workspace_name
See the issue #3163 (https://github.com/i3/i3/issues/3163).

Add strip_workspace_name to strip off the workspace name.
2018-03-11 12:17:42 +08:00
Michael Stapelberg f354f53435 Ensure all *.[ch] files include config.h
Including config.h is necessary to get e.g. the _GNU_SOURCE define and
any other definitions that autoconf declares. Hence, config.h needs to
be included as the first header in each file.

This is done either via:
1. Including "common.h" (i3bar)
2. Including "libi3.h"
3. Including "all.h" (i3)
4. Including <config.h> directly

Also remove now-unused I3__FILE__, add copyright/license statement
where missing and switch include/all.h to #pragma once.
2016-10-23 21:09:24 +02:00
Eric Engeström 66d9c983e4 Fix spelling mistakes 2016-04-04 09:33:59 +02:00
Ingo Bürk 0750b450b2 Use sasprintf() instead of alloc'ing and strncpy() in i3bar.
resolves #1995
2015-10-17 22:14:48 +02:00
Michael Hofmann 0319bda1d4 Introduce sstrndup wrapper. 2015-05-06 16:33:15 +02:00
Deiz 884214f14f Update copyright notices and get rid of ranges
The script used to make these changes can be found at:

   https://gist.github.com/Deiz/32322020f76d23e2bf8f
2015-04-20 17:50:21 -04:00
shdown 6922a820a6 i3bar: spelling fixes (2) 2015-03-24 15:41:16 +03:00
shdown e8704bb33b i3bar: spelling fixes 2015-03-23 22:56:49 +03:00
Tony Crisci e18e2b9f98 i3bar: use Pango markup
Parse text within workspace buttons and the i3bar statusline as Pango
markup. This lets people specify things like font weight, text color,
background color, font size, and font family in the text of i3bar.

fixes #1468
2015-02-12 14:45:34 -05:00
Michael Stapelberg 4c06e7a573 clang-format-3.5 **/*.h **/*.c
This should be the last commit that formats a big bunch of files. From
here on, whenever I merge patches, I’ll run clang-format like described
in the title.
2014-06-19 11:20:32 +02:00
Michael Stapelberg 9200094203 format **/*.c with clang-format-3.5
This has multiple effects:

1) The i3 codebase is now consistently formatted. clang-format uncovered
   plenty of places where inconsistent code made it into our code base.

2) When writing code, you don’t need to think or worry about our coding
   style. Write it in yours, then run clang-format-3.5

3) When submitting patches, we don’t need to argue about coding style.

The basic idea is that we don’t want to care about _how_ we write the
code, but _what_ it does :). The coding style that we use is defined in
the .clang-format config file and is based on the google style, but
adapted in such a way that the number of modifications to the i3 code
base is minimal.
2014-06-15 19:07:02 +02:00
Michael Stapelberg e41b11fa0a use size_t for strspn() return value 2014-05-16 18:03:31 +02:00
Tony Crisci e707e0a5fa i3bar: implement custom workspace numbers config
Implement the configuration option within the bar config directive for
custom workspace numbers with the directive `strip_workspace_numbers
yes`.

This directive strips the workspace name of the number prefix and
delimiter. When the workspace name consists only of the number, it will
default to show the number.

For example:

* "2:5" -> "5"
* "4:$" -> "$"
* "8" -> "8"

This allows customization of i3bar for alternate ordering of workspaces
which has a legitimate use for alternate keyboard layouts such as
Dvorak.

fixes #1131
2014-05-16 17:55:30 +02:00
Tony Crisci 13db562551 Remove yajl major version conditionals
Yajl version ≥ 2 is required.

fixes #1156
2014-05-04 22:52:37 +02:00
Alexander Kedrik de3901bb29 use designated initializers for yajl_callbacks struct 2014-01-06 22:12:14 +01:00
Michael Stapelberg 2fea5ef82b Revert "use designated initializers for yajl_callbacks struct"
This reverts commit 705b43294a.

This commit broke i3bar for some users.
2014-01-05 13:05:31 +01:00
Alexander Kedrik 705b43294a use designated initializers for yajl_callbacks struct 2014-01-04 20:46:46 +01:00
eeemsi b9255f51f8 Use (void) instead of () for functions without args 2012-08-23 19:34:37 +02:00
Quentin Glidic 210fc6dfed libi3: Rework predict_text_width
predict_text_width now takes an i3String as argument
2012-08-13 11:37:23 +02:00
Quentin Glidic bbd1b16043 i3bar: Port to i3String 2012-08-13 11:30:05 +02:00
Michael Stapelberg 561cf3719f little style fixes 2011-11-21 21:48:24 +00:00
Fernando Tarlá Cardoso Lemos 5c2088c87e Enhance libi3 and use it in i3bar.
Abstracted draw_text and predict_text_width into libi3. Use
predict_text_width from libi3 in i3 too. This required tracking
xcb_connection in a xcb_connection_t *conn variable that libi3
expects to be available in i3bar.
2011-11-21 20:52:26 +00:00
Michael Stapelberg 726f2a1e5a normalize file headers across **/*.{h,c} 2011-10-25 21:19:38 +01:00
Michael Stapelberg 15f021b4fc i3bar: Implement the output option 2011-10-21 22:17:41 +01:00
Michael Stapelberg d71db710dd i3bar: use safewrappers from libi3 2011-10-21 19:30:46 +01:00
Michael Stapelberg 64a7017c32 i3bar: add modelines to all files 2011-10-09 14:28:20 +01:00
Michael Stapelberg 737cd10bdf i3bar: properly handle the _XEMBED_INFO property 2011-08-24 01:18:27 +02:00
Michael Stapelberg dddce72bd7 little comment spelling fixes 2011-08-12 23:09:59 +02:00
Axel Wagner 8d09ed7bf5 Update changelog and copyright, bump version and more 2011-07-31 16:16:17 +02:00
Axel Wagner 08d454b25e Apply ugly yajl-compatibility-fix (thx sECuRE) 2011-04-28 20:24:32 +02:00
Axel Wagner 9bcc6216c8 Bugfix: Also free() the head of slist/tailq (Thx dothebart) 2011-01-26 02:00:55 +01:00
Axel Wagner 31863efc04 Bugfix: free() workspace-names seperately (thx dothebart) 2011-01-26 02:00:29 +01:00
Axel Wagner 18e6caf0a9 Bugfix: Test for outputs == NULL 2011-01-26 02:00:20 +01:00
Axel Wagner 2aeea30cc7 Use strerror() for more usefull errormessages 2011-01-01 16:54:40 +01:00
Axel Wagner 920721bb93 Use DLOG/ELOG-macros, provide --verbose-option 2010-09-17 06:49:28 +02:00
Axel Wagner 7fda48aa9f We don't need get_string_width anymore 2010-09-17 03:11:49 +02:00
Axel Wagner 60da522e13 Add licensing information 2010-08-07 18:05:16 +02:00
Axel Wagner cee972280d Add comments 2010-08-07 02:10:05 +02:00
Axel Wagner b1a8ddd9d7 We don't need a callback for null-values 2010-08-07 01:57:00 +02:00
Axel Wagner 1daa395a77 Added Unicode-Support 2010-08-06 03:32:05 +02:00
Axel Wagner 7d7867acce Be more strict with encapsulation
I.e. move the xcb-event-handling into xcb.c and the
child-process-communications into newly created child.c.
Also change some includes.
2010-08-05 05:09:59 +02:00
Axel Wagner 8595d3bb48 Change the indention-style 2010-08-03 21:20:11 +02:00
Axel Wagner 43c057f19a Migrate to queue.h 2010-07-30 03:11:54 +02:00
Axel Wagner 654b51fef1 Correctly parse the urgent-hint 2010-07-29 20:19:59 +02:00
Axel Wagner ff2ee04e0d Use font-size to correctly determine the size of the bars and buttons. 2010-07-27 02:16:49 +02:00