From e4f1872a43870aa8b35064c41e0515dc9cfdadb2 Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Wed, 19 Jun 2019 14:21:10 +0200 Subject: [PATCH] anvil: properly document logind support --- README.md | 11 +++++++++-- anvil/build.rs | 10 ++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 anvil/build.rs diff --git a/README.md b/README.md index e64b643..2f49a8c 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,9 @@ Like others, Smithay as a compositor library has its own sample compositor: anvi You can run it with cargo after having cloned this repository: ``` -cargo run -p anvil -- --{backend} +cd anvil; + +cargo run -- --{backend} ``` The currently available backends are: @@ -41,4 +43,9 @@ The currently available backends are: inside of an other X11 or Wayland session. - `--tty-udev`: start anvil in a tty with udev support. This is the "traditional" launch of a Wayland compositor. Note that this requires you to start anvil as root if your system does not have logind - available ([consolekit support is planned](https://github.com/Smithay/smithay/issues/95)). + available ([consolekit support is planned](https://github.com/Smithay/smithay/issues/95)). To use logind, + you need to activate the associated cargo feature: + + ``` + cargo run --features logind -- --tty-udev + ``` diff --git a/anvil/build.rs b/anvil/build.rs new file mode 100644 index 0000000..5270b19 --- /dev/null +++ b/anvil/build.rs @@ -0,0 +1,10 @@ +use std::env::var; + +fn main() { + if !var("CARGO_FEATURE_LOGIND").ok().is_some() { + println!("cargo:warning=You are compiling anvil without logind support."); + println!("cargo:warning=This means that you'll likely need to run it as root if you want to launch it from a tty."); + println!("cargo:warning=To enable logind support add `--feature logind` to your cargo invocation:"); + println!("cargo:warning=$ cd anvil; cargo run --feature logind"); + } +}