1
0
mirror of https://github.com/emersion/kanshi synced 2024-09-18 09:51:36 +02:00
Dynamic display configuration
Go to file
É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
include Add exec to execute commands when a configuration is matched 2019-09-20 12:59:04 +03:00
protocol Listen to output-management events 2019-06-01 13:25:09 +03:00
.build.yml ci: add .build.yml 2019-06-01 13:33:46 +03:00
.gitignore Add basic parser 2019-06-01 13:25:09 +03:00
kanshi.1.scd Accept user-specified config path 2020-10-08 19:31:03 +02:00
kanshi.5.scd Add 'include' directive to read additional configs 2020-10-13 14:42:03 +02:00
LICENSE Add missing LICENSE 2019-08-12 11:45:55 +03:00
main.c Clean up exec_command. 2021-06-30 22:23:08 +02:00
meson_options.txt Generate man pages 2019-06-01 13:25:09 +03:00
meson.build build: bump version to 1.2.0 2021-06-24 08:49:00 +02:00
parser.c parser: print errno when failing to open the config file 2021-06-23 17:16:58 +02:00
README.md readme: move to Libera Chat 2021-05-21 16:08:09 +02:00

kanshi

kanshi allows you to define output profiles that are automatically enabled and disabled on hotplug. For instance, this can be used to turn a laptop's internal screen off when docked.

This is a Wayland equivalent for tools like autorandr. kanshi can be used on Wayland compositors supporting the wlr-output-management protocol.

Join the IRC channel: #emersion on Libera Chat.

Building

Dependencies:

  • wayland-client
  • scdoc (optional, for man pages)
meson build
ninja -C build

Usage

mkdir -p ~/.config/kanshi && touch ~/.config/kanshi/config
kanshi

Configuration file

Each output profile is delimited by brackets. It contains several output directives (whose syntax is similar to sway-output(5)). A profile will be enabled if all of the listed outputs are connected.

profile {
	output LVDS-1 disable
	output "Some Company ASDF 4242" mode 1600x900 position 0,0
}

profile {
	output LVDS-1 enable scale 2
}

License

MIT