Commit Graph

62 Commits (9571200baa387eb0b4b0e8afd9d540175a95adc5)

Author SHA1 Message Date
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
Thomas Anderson 196e1d0971 Respect EXEC_PREFIX and a users' choice of PKG_CONFIG.
The Makefiles should put binaries in $(EXEC_PREFIX) and
architecture-independent files in $(PREFIX). Also a user may have a
prefixed- pkg-config, as in the case of cross compiling on Exherbo
Linux, so respect the well-accepted $(PKG_CONFIG) variable for this
purpose.
2015-04-12 17:59:30 -07:00
Michael Stapelberg dfefb10d36 initialize variables to NULL to avoid invalid free() on error 2015-03-29 20:57:20 +02:00
Michael Stapelberg 6cba530946 Merge pull request #1593 from Airblader/feature-nagbar-primary-output
Display i3-nagbar on primary output
2015-03-29 19:54:32 +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
Ingo Bürk 0ad9268253 Open i3-nagbar on the primary screen
If a primary screen is set and the CRTC information can be retrieved,
i3-nagbar will now open on the primary screen. Otherwise, the old (fixed)
position will be used as a fallback.

fixes #1405
2015-03-28 19:35:59 +01:00
Ingo Bürk 43f65e1d2b Compile xcb-randr support into i3-nagbar 2015-03-27 08:44:00 +01:00
Michael Stapelberg ad31b13cb6 update default fonts for i3-{input,config-wizard,nagbar}
We’ve done this a while ago in i3.config itself, but the tools in
question aren’t hooked up to that setting, so we need to do it here as
well.
2015-03-26 10:03:30 +01:00
Michael Stapelberg d91bf5d491 make i3-nagbar work properly on hi-dpi displays 2015-03-26 09:44:46 +01:00
Diana Thayer 94b1e76af4 degendered terms 2015-03-11 21:41:43 -07:00
Michael Stapelberg 091f1db39a run clang-format (3.5.0)
Not quite sure why there are so many differences. Perhaps we’ve gotten
out of the habit of running clang-format after every change.

I guess it’d be best to have a travis hook that runs clang-format for us
and reports any problems on pull requests.
2015-03-01 17:16:03 +01: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
Arun Persaud 910875aea6 i3-nagbar: add missing newline when printing version information 2014-03-23 18:56:53 +01:00
Peter Boström f78c1ba053 Fix 'gcc -Wextra -Wno-unused-parameter'. 2014-01-04 20:43:30 +01:00
Peter Boström 9c15b9504e Fix clang -Wextra except -Wunused-parameter.
Cleared all warnings that occur when passing
CFLAGS="-Wall -Wextra -Wno-unused-parameter" to make using clang 3.3 on
Linux x86-64.
2014-01-02 22:15:33 +01:00
Alexander Kedrik e2ebe3e2ae Use #pragma once
#pragma once is safer and simpler. According to Wikipedia it's supported by all major compilers.
2014-01-01 15:06:57 +01:00
Michael Stapelberg 0883dfbe14 only LOG() the DPI when it changes, DLOG() it otherwise (Thanks lkraav)
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it’s actually
relevant (upon DPI changes).

fixes #1115
2013-12-24 10:35:56 +01:00
Lancelot SIX f22995393a Remove references to PATH_MAX macro
Since the macro PATH_MAX is not defined on every system (GNU/Hurd being
one of those who do not define it), we remove all references to this
macro. Instead, we use a buffer of arbitraty size and grow it when
needed to contain paths.
2013-11-24 13:50:29 +01:00
Baptiste Daroussin f691a55923 Use _PATH_BSHELL to ensure using a bourne shell
[Michael]
This commit should fix problems with people using a non-bourne shell as
login shell, e.g. fish or rc. AFAICT, $SHELL should only be used for
interactive shells, but we just want a bourne shell, not an interactive
shell.
2013-11-09 10:11:32 +01:00
Tony Crisci 8fe17407ff i3-nagbar: Set button inner-width to the width of the label
Use predict_text_width to find the width of the label and then account
for right padding when calculating the width of the button.
2013-10-13 18:02:39 +02:00
Michael Stapelberg 8677936f6c Merge branch 'master' into next 2013-06-28 00:14:30 +02:00
Michael Stapelberg 4765427f21 i3-nagbar: Bugfix: -m requires an argument (crashes if none specified) (Thanks Mayhem) 2013-06-28 00:14:09 +02:00
Michael Stapelberg d51173b2ba i3-nagbar: take our terminal execution kludge to the next level
Please read commit 2bf80528bd first.
Then read the comment within the code of this commit.
Then run in circles and cry loudly.

fixes #1002
fixes #1026
2013-06-10 22:55:39 +02:00
Michael Stapelberg 2bf80528bd i3-nagbar: kludge to run the command shell script when inside a noexec mount
See the comment inside the commit for more information on how this
works.

fixes #947
2013-02-07 15:30:40 +01:00
Michael Stapelberg 66b1dadc38 i3-nagbar: don’t quote the -e argument for i3-sensible-terminal
…not all terminals support it
2012-12-24 16:56:20 +01:00
Michael Stapelberg b3d7531947 refactor both i3-nagbar starts into src/util.c
With this change, libev >= 4 is a hard dependency. It should be present
in all major linux distributions (even the latest ubuntu LTS).
2012-12-24 16:53:20 +01:00
Michael Stapelberg a01bac13fe don’t use reserved identifiers for include guards (left-overs)
fixes #804
2012-09-22 13:31:08 +02:00
Oliver Kiddle f7d825062a remove superfluous ev.h include statements 2012-09-20 11:15:17 +02:00
Michael Stapelberg 4636eb840d fix compilation with older xcb-util with -DXCB_COMPAT (Thanks okraits) 2012-09-03 14:55:27 +02:00
Michael Stapelberg 2896ae8057 logging: make libi3 use verboselog()/errorlog(), provide it in each caller
While this is a bit ugly, it makes the log messages end up where they
are supposed to: in the shmlog/stdout in case of i3 and on stdout in
case of utilities such as i3-input
2012-08-13 13:27:16 +02:00
Fernando Tarlá Cardoso Lemos 6ff3f7abad libi3: Implement Pango rendering 2012-08-13 11:39:30 +02:00
Quentin Glidic 53365fa887 libi3: Rework draw_text
We now have two versions of draw_text
draw_text: Now takes an i3String
draw_text_ascii: Designed for static strings in plain ASCII
2012-08-13 11:37:21 +02:00
Quentin Glidic 50b7764ae4 i3-nagbar: Port to i3String 2012-08-13 11:30:08 +02:00
Quentin Glidic b01545b131 Makefile: Always link libi3 first 2012-08-13 02:00:01 +02:00
Michael Stapelberg 8a1c8115ca fix a few warnings/places where the clang static analyzer complains 2012-08-05 16:34:38 +02:00
Quentin Glidic 0b4ee7a1da common.mk: Split XCB common flags 2012-07-23 00:12:55 +02:00
Quentin Glidic c7029a5e21 common.mk: Introduce I3_*FLAGS
CPPFLGES, CFLAGS and LDFLAGS should be user variables
We now provide default flags but use I3_*FLAGS flags for our own needed
flags

Also reoder lib flags a bit
2012-07-22 23:53:49 +02:00
Quentin Glidic 3b1b72ecbb *.mk: Support passing specific CFLAGS/LIBS 2012-07-22 23:53:13 +02:00
Quentin Glidic e452acb30e Add stub Makefiles to allow subdir make calls 2012-07-22 19:57:48 +02:00
Quentin Glidic 8910a138ff Move i3-nagbar to the new Makefile layout 2012-07-22 19:57:22 +02:00
Michael Stapelberg 4cd5bf94cf i3-nagbar: add -t to the synopsis (Thanks gamo) 2011-12-07 18:19:11 +00:00
Fernando Tarlá Cardoso Lemos 344c04af12 Implement set_font_colors.
This paves the way for other font rendering backends. Fonts and
colors shouldn't be specified manually from now on.
2011-11-21 20:52:32 +00:00
Fernando Tarlá Cardoso Lemos eafc7af606 Make all programs use draw_text. 2011-11-21 20:52:29 +00:00
Fernando Tarlá Cardoso Lemos af335f0403 Don't call free on statically allocated strings.
Fixes segfault when the option -f is used. Also, don't leak prompt
strings. We either keep FREE to prevent leaking, or choose to leak
and avoid strdup. Another option would be using a flag to indicate
whether or not the strings are heap allocated, but it's overkill.
2011-11-07 19:57:25 +00:00
Michael Stapelberg 726f2a1e5a normalize file headers across **/*.{h,c} 2011-10-25 21:19:38 +01:00
Michael Stapelberg f4469eee0b get rid of xcb.c in all i3-* tools
open_input_window was slightly different for each of them, so it made no sense
to generalize it (then we would end up with a thin and useless wrapper).
2011-10-23 23:20:57 +01:00
Michael Stapelberg a58018cf66 Add libi3/load_font, use it everywhere
…except for i3bar, which needs slightly more information about the font
2011-10-23 22:37:11 +01:00
Michael Stapelberg 78fea8e1fb i3-nagbar: eliminate xcb_change_gc_single with C99 2011-10-23 17:55:58 +01:00