Commit Graph

133 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
Ingo Bürk e2b2a28625
Merge pull request #4004 from orestisfl/i3bar-segfault
Fix SEGFAULT when i3bar receives invalid input
2020-04-10 14:00:51 +02:00
Orestis Floros 91ec14f2bc
Fix SEGFAULT when i3bar receives invalid input
Fixes #3844
2020-04-10 11:38:19 +02:00
Orestis Floros 40697a233c
i3bar: Add a macro to log child info
Mentioned in #3242
2020-04-10 03:22:34 +02:00
Jason 5024a13b8b
Remove comment referencing old source code
Behaviour was changed in f691a55923
2020-03-01 05:03:41 +09: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
Ingo Bürk ca82f95812 feat: added support for user-defined border widths in i3bar blocks (#3726)
This change introduces support for four new properties on the i3bar
protocol, namely "border_top", "border_right", "border_bottom"
and "border_left".

If a block is drawn with a border, these values define the width of
the corresponding edge in pixels. They all default to 1 if not
specified to preserve compatibility.

fixes #3722
2019-06-22 22:18:29 +02:00
Hamish Macdonald 5084a881af Do not assume STDIN_FILENO is available for input from child 2018-10-26 09:31:43 -04:00
Soumya 3745e6f484
Add "modifiers" to events sent by i3bar 2018-10-25 16:02:06 -07:00
Orestis Floros a65914f338
Fix missing prototypes
i3 will now compile with no warnings when -Wmissing-prototypes is used.
2018-10-13 21:10:10 +03:00
Pallav Agarwal 161db6f17d Add relative coordinates in JSON for i3bar click events (fixes #2767)
Add support for relative coordinates in i3bar click events

Rename {x,y}_rel to relative_{x,y}

Update i3bar-protocol doc to mention the added fields in click events
2017-12-20 22:51:14 +05:30
Orestis Floros a05663c59e i3bar: avoid possible va_args leak 2017-10-17 04:28:07 +03:00
Michael Stapelberg 55964fb3be i3bar: ensure get_buffer does not leak memory
This fixes an AddressSanitizer warning which recently popped up.

related to #2907
2017-09-09 06:56:50 +02:00
Tony Crisci 1c06f8b797 i3bar: change error block color to hex
Named colors are not supported by the i3bar protocol so give the error block
color in hex.
2017-07-12 17:53:15 -04:00
Michael Stapelberg f58dde2850 Merge pull request #2507 from stapelberg/autotools
Switch to autotools (GNU build system)
2016-10-25 08:56:12 +02: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
Michael Stapelberg 4d66841811 check vasprintf return code 2016-10-23 17:41:42 +02:00
Ingo Bürk 83452a3472 Disable pango markup for plain-text input in i3bar. (#2505)
fixes #2498
2016-10-18 07:29:31 +01:00
Ingo Bürk a0add1ba73 Added background and border keys to the i3bar protocol.
This patch adds two new status block keys, background and border, which
define the respective colors for the status block. If not specified, the
current behavior is kept, e.g., no background / border will be drawn.

If the status block is marked urgent, the urgent color is prioritized.

fixes #2022
2015-10-22 16:11:08 +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
Ingo Bürk fec61791e1 Rename is_markup to pango_markup. 2015-10-13 09:59:26 +02:00
shdown c85d16faa4 Use safe wrappers wherever possible 2015-08-03 12:50:50 +03:00
shdown bc52fae15c libi3: change scalloc() signature to match calloc() 2015-08-03 12:50:13 +03:00
shdown fe006f0f6a i3bar: fix freeing static strings
name and color fields of blocks are freed in clear_statusline, so they
need to be strdup'ed.
2015-06-02 23:29:24 +03: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
Ingo Bürk a952ae74f4 Use a reasonable default sep_block_width if a separator_symbol is given 2015-04-03 22:54:59 +02:00
Michael Stapelberg 93adcf8bdc Merge pull request #1575 from hwangcc23/next
Fix warnings
2015-03-29 16:53:14 +02:00
hwangcc 42515308e7 Add a safe wrapper for write and fix some warnings
1. Add a function writeall and make swrite wrap that function. Use either writeall or swrite, depending on whether we want to exit on errors or not.
2. Fix warnings when compiling with a higher optimisation level.
(CFLAGS ?= -pipe -O3 -march=native -mtune=native -freorder-blocks-and-partition)

Signed-off-by: hwangcc <hwangcc@csie.nctu.edu.tw>
2015-03-29 10:22:34 +08:00
Michael Stapelberg af71d3a2f1 Merge pull request #1590 from acrisci/bug/i3bar-no-markup-default
i3bar: don't parse markup on statusline by default
2015-03-28 10:08:41 +01:00
Tony Crisci beaf904943 i3bar: don't parse markup on statusline by default
fixes #1565
2015-03-27 19:00:32 -04:00
Ingo Bürk 6adc7e8bfb Return in child parsing as soon as the match was made.
As soon as we found the current key for which the value should be handled we can return
from the function to save some string comparisons.
2015-03-27 09:26:29 +01:00
Michael Stapelberg bbb035d975 Merge pull request #1583 from shdown/next
i3bar: spelling fixes (2)
2015-03-25 20:16:00 +01:00
shdown 6922a820a6 i3bar: spelling fixes (2) 2015-03-24 15:41:16 +03:00
Tony Crisci 177c03debd i3bar: check `short_text` for NULL on dump
Check `short_text` for NULL on statusline dump, since this value can be
NULL when not given. Fixes a segfault in that case.
2015-03-24 06:00:26 -04:00
Tony Crisci 0962c7f011 i3bar: check block text for NULL
Add a null check to `full_text` and `short_text` for a block before
setting the markup property to avoid a segfault.
2015-03-24 05:45:20 -04:00
Tony Crisci e681f34ec1 i3bar: set markup per block
Add `markup` to the i3bar protocol as a block member.

This is a string that determines how the block should be parsed as
markup. "pango" indicates the block should be parsed as Pango markup.
"none" indicates the block should not be parsed as markup.
2015-03-24 02:27:38 -04:00
Michael Stapelberg ff62a68c1e Merge pull request #1570 from shdown/next
i3bar: spelling fixes
2015-03-23 22:10:17 +01:00
shdown e8704bb33b i3bar: spelling fixes 2015-03-23 22:56:49 +03:00
Ingo Bürk dd488818a9 Introduce the short_text property on blocks and parse it according to the documentation. 2015-03-23 11:03:45 +01:00
Michael Stapelberg 1124041648 clang-format 2015-03-01 17:19:42 +01:00
Michael Stapelberg 91476e2c11 Merge branch 'defect-1480' of https://github.com/Airblader/i3-original into Airblader-defect-1480 2015-03-01 17:19:22 +01:00
Ingo Bürk 801dd06c6d free block->instance when cleaning up statusline 2015-02-18 20:29:11 +01:00
Ingo Bürk 296fbdde12 Introduce a statusline buffer.
A buffer is introduced for the statusline which will only be copied to the actual statusline
once an entire statusline is parsed. This avoids a race condition where incompletely parsed
statuslines were rendered, causing only some status blocks to be rendered which is visible to
the user as a flickering.

fixes #1480
2015-02-18 20:11:42 +01:00
Ingo Bürk 9ff230c375 remove unused statusline_buffer 2015-02-18 20:01:52 +01: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 db62b5a4df Merge branch 'master' into next 2015-02-11 21:08:00 +01:00
Ingo Bürk bf0e8c2862 Remove one level of indentation #1465 2015-02-11 20:34:19 +01:00
Ingo Bürk bfd60ec619 Improve error message when a full_text property is missing 2014-12-07 19:56:51 +01:00
Ingo Bürk bf1d0c9335 ensure align = left is the default and update documentation accordingly
fixes #1403
2014-12-03 08:12:04 +01:00