1
0
mirror of https://github.com/emersion/kanshi synced 2024-11-23 00:02:16 +01:00
Commit Graph

108 Commits

Author SHA1 Message Date
Simon Ser
0faad75443
Update README.md 2021-09-15 10:33:30 +02:00
Simon Ser
992c1954a6 readme: finish migration to SourceHut 2021-09-15 10:32:14 +02:00
Oğuz Ersen
635d988a3e man: fix wrong section headers 2021-08-22 20:55:26 +02:00
Érico Nogueira
92a5a327d5 Add CI step to test build without varlink. 2021-07-24 08:34:35 +02:00
Jason Francis
68f39b9790 Add kanshictl utility.
It can talk to kanshi via the varlink interface. The only command
currently supported is to reload the config.

Co-authored-by: Érico Nogueira <erico.erc@gmail.com>
2021-07-24 08:34:35 +02:00
Jason Francis
afab6397ed Add optional varlink interface.
We don't want to fallback to libwayland's defaults, so WAYLAND_DISPLAY
needs to be set in env. Since IPC in the future is going to use
XDG_RUNTIME_DIR, we also require it.

Because these functions will be used in other parts of the code as well,
we rework the build system slightly to accommodate it.

Co-authored-by: Érico Nogueira <erico.erc@gmail.com>
2021-07-24 08:34:35 +02:00
Jason Francis
123a2f43f3 Add signal handlers to reload the config.
Signaling kanshi with SIGHUP will now reload the config.

Co-authored-by: Érico Nogueira <erico.erc@gmail.com>
2021-07-24 08:34:35 +02:00
Jason Francis
bec47f49e3 Factor out event loop.
This rework is necessary because it will allow us to add signal handlers
via signalfd and a varlink interface for IPC.

Co-authored-by: Érico Nogueira <erico.erc@gmail.com>
2021-07-24 08:34:35 +02:00
Mayeul Cantan
fd565f4415 parser: support single quotation marks
See https://github.com/emersion/kanshi/pull/96

Includes a simplification suggested by:

Co-authored-by: Érico Nogueira Rolim <34201958+ericonr@users.noreply.github.com>
2021-07-09 14:29:49 +02:00
Simon Ser
a3061857d6 readme: fix mailing list link 2021-07-04 18:24:52 +02:00
Simon Ser
0d5f091b97 readme: add links to SourceHut 2021-07-04 18:23:37 +02:00
Érico Nogueira
dd3f91fbd3 Clean up exec_command.
Rename pid_t variables "pid", "child" to "child" and "grandchild", since
we were using "child" in comments to refer to the PID stored in "pid".

Use _exit(2) whenever exiting from a forked child; calling exit(3)
should't be done in such a context.

Add missing new lines to error messages. Arguably using stdio in this
context isn't safe either, but we aren't a threaded program and stderr
is always flushed when this function is called, so it won't ouput
previous buffer contents or deadlock.

Fix one _exit(2) call to return 1 as status code, since it should be
indicating a failure.

Add error message in case waitpid(2) fails.
2021-06-30 22:23:08 +02:00
Érico Nogueira
b6613c2eac Don't strdup command line arguments.
They live forever, so there's no need to manage them with dynamic
memory.
2021-06-30 22:23:08 +02:00
Simon Ser
2c66d57ed0 build: bump version to 1.2.0 v1.2.0 2021-06-24 08:49:00 +02:00
Antonin Décimo
a21c9cf83d parser: print errno when failing to open the config file 2021-06-23 17:16:58 +02:00
Nicolas Cornu
c5fd774040
readme: move to Libera Chat
Co-authored-by: Steven Guikal <void@fluix.one>
2021-05-21 16:08:09 +02:00
Érico Rolim
dabd7a2917 parser: use abort() instead of assert(0).
assert(0) has no effect on NDEBUG builds, and means the program will
continue running in an unexpected state.
2021-02-02 21:25:22 +01:00
Ariadne Conill
f88ba3a1dd parser: explicitly initialize key (kanshi_output_field) to 0
This warning is tripped by GCC 10.
2020-12-17 13:30:20 +01:00
Kenny Levinsen
9731ff9c79 Add 'include' directive to read additional configs 2020-10-13 14:42:03 +02:00
Kenny Levinsen
7095bedd25 Accept user-specified config path
Adds a -c,--config command line option that allows the user to specify
an arbitrary config path.
2020-10-08 19:31:03 +02:00
Guillaume Maudoux
acfad026c5
Properly reap children to avoid zombies 2020-09-14 15:29:15 +02:00
Diego Rabatone Oliveira
e55b5847a0 [man 5] Add blockquotes to ensure line break
Without it the final render is both statements in one line.
2020-08-05 16:50:47 +02:00
Nenad Stojanovikj
dc5e556a38 Add the 'profile' directive in kanshi(5) examples 2020-07-20 22:54:23 +02:00
Jan Beich
846b725637 Add missing header after 5a30abdf0b3b
../main.c:82:3: error: use of undeclared identifier 'sigset_t'
                sigset_t set;
                ^
../main.c:83:3: error: implicit declaration of function 'sigemptyset' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                sigemptyset(&set);
                ^
../main.c:83:16: error: use of undeclared identifier 'set'
                sigemptyset(&set);
                             ^
../main.c:84:3: error: implicit declaration of function 'sigprocmask' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                sigprocmask(SIG_SETMASK, &set, NULL);
                ^
../main.c:84:15: error: use of undeclared identifier 'SIG_SETMASK'
                sigprocmask(SIG_SETMASK, &set, NULL);
                            ^
../main.c:84:29: error: use of undeclared identifier 'set'
                sigprocmask(SIG_SETMASK, &set, NULL);
                                          ^
2020-04-02 23:22:55 +02:00
Simon Ser
57c135f203
readme: switch to new profile syntax 2020-04-02 11:05:06 +02:00
Simon Ser
b221460388
Bump to v1.1.0 v1.1.0 2020-04-02 11:03:08 +02:00
Simon Ser
ef4c7f083d
Require profiles with a name to have a profile directive
Also make the syntax without a "profile" directive legacy by removing
docs for it.

Closes: https://github.com/emersion/kanshi/issues/75
2020-03-30 15:45:31 +02:00
Rikard Falkeborn
dc9f4c8fc3 Fix parser_next_token return value
Returning a negative value in a function with bool as return value
is the same as returning true. Fix this by returning false to indicate
failure.
2020-02-22 21:24:07 +01:00
James Walmsley
86d6aff25f Select highest refresh rate for selected mode when none is specified. 2020-01-13 22:41:20 +01:00
James Walmsley
3d6b62ff0d Be tolerant to matching refresh rates that are a few points off. 2020-01-11 10:11:53 +01:00
Martin Michlmayr
c92aa4af0c Use correct formatting for variable in man page 2019-12-09 11:15:03 +01:00
Martin Michlmayr
199788c331 Fix typo in man page 2019-12-06 10:50:10 +01:00
Bartosz Taczała
c848893b23 Add support for comments in configuration file
Supported comments are:

    # here
    {
        # or here
        output eDP-1 mode 1920x1080 # or here
    }

Co-authored-by: Simon Ser <contact@emersion.fr>
2019-11-29 19:09:58 +01:00
Guillaume Maudoux
5a30abdf0b Add exec to execute commands when a configuration is matched 2019-09-20 12:59:04 +03:00
Guillaume Maudoux
15029bd28b Allow names to distinguish configurations 2019-09-20 12:59:04 +03:00
Michael Aquilina
823cdb0f6f Specify correct version in meson.build
kanshi 1.0.0 has been released to github but meson.build was not updated
to reflect this yet.
2019-09-06 20:20:23 +03:00
Simon Ser
e4da814a60
readme: drop mention of sway
sway 1.2 has been released. No need for the latest Git commit anymore.
v1.0.0
2019-08-27 09:07:51 +03:00
danieljampen
d4a3c5ba15 convert refresh rate from Hz to mHz after parsing 2019-08-13 08:00:03 +02:00
Simon Ser
33e39a444e
Add missing LICENSE
Closes: https://github.com/emersion/kanshi/issues/45
2019-08-12 11:45:55 +03:00
Ben Widawsky
76e9f4151f Fix the path for installed man pages. 2019-06-07 23:15:40 +03:00
Simon Ser
38d27474b6 Fix head matches indexing
The `matches` array contained heads *and* was indexed by head. This didn't
make a lot of sense.

Instead, make it contain profile outputs and indexed by head.
2019-06-07 23:03:16 +03:00
Simon Ser
32666e0f58
Fix index in apply_profile loop
Closes: https://github.com/emersion/kanshi/issues/32
2019-06-06 08:35:47 +03:00
Simon Ser
72498b95dc
Fix index in match_profile 2019-06-06 08:33:58 +03:00
Simon Ser
46d1b9feb8
Make match_profile_output more strict
If "DP-1" is specified in the config, it could match a connected "eDP-1" head.
2019-06-06 08:29:28 +03:00
Simon Ser
a348c8e875
Print profile output <-> head matching 2019-06-06 08:26:54 +03:00
Simon Ser
725d7881b3
readme: add a note about required sway version 2019-06-03 07:55:45 +03:00
Simon Ser
be33c6699c
ci: add .build.yml 2019-06-01 13:33:46 +03:00
Simon Ser
530805c3b5 Showcase output identifiers in docs 2019-06-01 13:25:09 +03:00
Simon Ser
ab89b56785 Parse quoted strings 2019-06-01 13:25:09 +03:00
Simon Ser
689c989b92 Generate man pages 2019-06-01 13:25:09 +03:00