Users with multiple GPUs that cannot be used simultaneously should pass
--no-all-gpus if they encounter problems or use --video-devices
explicitly. However, we cannot rely on PRIMARY flags being set for all
kinds of setups. Instead, default behavior should be using all available
GPUs unconditionally (except the safe DRM_BACKED and fbdev PRIMARY logic).
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Session management should be done with global keys. This allows us to use
the known "w", "t", "n" keys for "close", "new tab", "new window" etc.
functionality later.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If all the auto-detection logic of kmscon still does something you don't
want, you can now use this list to override all this logic with a
statically configured white-list.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This helper tests whether a string-list has only a single entry and
compares this with the given entry.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This was supported for backwards-compatibility, but is no longer
supported. Use the new /etc/kmscon/kmscon.conf files.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The old options were quite stupid and low-level. It doesn't make sense to
require users to understand "--dumb" (besides, it sounds wrong).
Therefore, two new options replace the old options:
--drm: Enabled by default. If true, kmscon uses primary DRM devices and
avoids primary fbdev devices. If false, kmscon uses no DRM devices
at all but uses primary fbdev devices now.
--hwaccel: Disabled by default. If true, kmscon tries to
hardware-accelerate any rendering if available. This can also
affect fbdev or other devices in the future.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This option now allows the user to change the XkbModel from the command
line or configuration file.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We really _want_ this so turn it on by default. Especially for fake-VTs,
this really should be turned on all the time.
Use --no-switchvt to disable it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
libxkbcommon has a configure option to set the default values for the
RMLVO's (if they are passed as NULL or "" - we use "" so it'd be safe to
print). If they are not specified there, it's just "us" like we currently
do have. But if they are specified, we should most likely defer to it.
We do the same for the model field, instead of hardcoding "evdev". The
rules field remains hardcoded to "evdev", because we rely on it when
doing the evdev scancode-to-keycode +8 mapping.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
By default, kmscon now only uses primary und auxiliary displays. All
uncategorized displays are ignored. This fixes problems with dual-GPU
systems.
--primary-gpu-only makes kmscon not use any auxiliary displays. --all-gpus
makes kmscon also use uncategorized displays.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We implement --login as special type now. This allows us to correctly
parse it in configuration files.
We also replace the default value by /bin/login.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of using "NULL, NULL, NULL, " in every macro, we now provide a
*_FULL variant which allows setting these. All other macros simply set
these to NULL by default.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need to call afterchecks after any parsing we do. To signal that there
are no extra-arguments, we pass argv==NULL.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The "file" callback is used to parse configuration files. If it is not
given, the string is parsed via "parse".
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We now have the ability to pass on local configurations so we no longer
need the global kmscon_conf.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We allow options to specify "aftercheck" callbacks but do not call them
during a copy. Therefore, we need a way to copy side-effects. As we cannot
do that generically, we now allow each option to specify such a callback.
We use it for the "all_seats" and "argv" parameters in kmscon.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Sorry for the huge commit, but this reworks the whole configuration
handler. We now provide conf_ctx contexts which contain a pointer to the
backing storage and the config-options that are used.
It is also possible to copy config-options now. So we can use the
main-config as default value for seat-configurations.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This allows changing the backing-memory of a kmscon-config object. This
way, we can parse the same options into a per-seat config object.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This drops all config-file support except for the new
/etc/kmscon/kmscon.conf. For backwards-compatibility, we still parse
/etc/kmscon.conf but this will be removed soon.
We want to add one kmscon-config for each seat so you can have different
configurations per seat. These will all be put into /etc/kmscon/ so we
need this directory.
We also drop ~/.kmscon.conf. This was never really useful as kmscon is a
system daemon and should not be used with user-configuration files.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This new helper allows easily parsing arbitrary filenames. It does the
same as conf_parse_file() but allows giving filenames in printf format.
The other parsers are slightly adjusted so they can be more easily reused
by other projects.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This just rearranges all options so they are logically grouped and in the
same order at all places. It also changes the internal variable for
"--fbdev" from "use_fbdev" to "fbdev" so all variables have the same name
as the option-names.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This parameter allows to limit the maximum number of sessions to a sane
limit. Otherwise, a user could DOS a systemd by opening as many session as
they want.
This can be set to 0 to drop that limit, however, this is not recommended.
Instead, if you want an ability to add more sessions than that limit, you
should implement a flag to register_session() that overwrites the limit.
This can then be used by a safe way to register new sessions.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
You can now use ctrl+alt+w to close the current session and
ctrl+alt+Return to start a new terminal (if it is built-in).
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds two new grabs to switch sessions within kmscon. They are set to
ctrl+alt+Left/Right by default.
To improve debugging, we also add some log-messages to session management.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We allow users to specify grabs on the command-line or in config-options.
We sometimes want multiple grabs to do the same. Therefore, this changes
the grab-parser and handlers to allow this.
Furthermore, this adds support for keysyms that are assembled of multiple
syms. This isn't needed by any keymap, yet, but might be used in the
future.
Last but not least, you can also specify modifiers only now. This might be
used by subsystems to use the default keysyms but let the user specify
what modifiers should be used.
However, be careful when specifying modifiers-only for normal grabs as
this means the grab is executed everytime the modifier is reported with
_any_ key.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Even though I really like the high repeat-rates, it might not be the best
default option. Hence, change it to some sane default.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Configuration handling is totally independent from kmscon_main.c so we
move it into a separate file to avoid cluttering up kmscon_main.c.
This also does some basic initialization in kmscon_conf.c which is solely
related to configuration handling and logging.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>