Crate jay_config

Source
Expand description

This crate allows you to configure the Jay compositor.

A minimal example configuration looks as follows:

use jay_config::{config, quit, reload};
use jay_config::input::get_default_seat;
use jay_config::keyboard::mods::ALT;
use jay_config::keyboard::syms::{SYM_q, SYM_r};

fn configure() {
    let seat = get_default_seat();
    // Create a key binding to exit the compositor.
    seat.bind(ALT | SYM_q, || quit());
    // Reload the configuration.
    seat.bind(ALT | SYM_r, || reload());
}

config!(configure);

You should configure your crate to be compiled as a shared library:

[lib]
crate-type = ["cdylib"]

After compiling it, copy the shared library to $HOME/.config/jay/config.so and restart the compositor. It should then use your configuration file.

Note that you do not have to restart the compositor every time you want to reload your configuration afterwards. Instead, simply invoke the reload function via a shortcut.

Modules§

embedded
Tools to configure the compositor in embedded environments.
exec
Tools for spawning programs.
input
Tools for configuring input devices.
io
Tools for IO operations.
keyboard
Tools affecting the keyboard behavior.
logging
Tools for modifying the logging behavior of the compositor.
status
Knobs for changing the status text.
tasks
Tools for async task management.
theme
Tools for configuring the look of the compositor.
timer
Timers for one-time or repeated actions.
video
Tools for configuring graphics cards and monitors.
xwayland
Tools for configuring Xwayland.

Macros§

config
Declares the entry point of the configuration.

Structs§

PciId
A PCI ID.
Workspace
A workspace.

Enums§

Axis
A planar axis.
Direction
A planar direction.

Functions§

config_dir
Returns the Jay config directory.
get_default_workspace_capture
Returns whether new workspaces are captured by default.
get_workspace
Returns the workspace with the given name.
is_reload
Returns whether this execution of the configuration function is due to a reload.
on_devices_enumerated
Sets the callback to be called when all devices have been enumerated.
on_idle
Sets the callback to be called when the display goes idle.
quit
Exits the compositor.
reload
Reloads the configuration.
set_default_workspace_capture
Sets whether new workspaces are captured by default.
set_explicit_sync_enabled
Enables or disables explicit sync.
set_idle
Configures the idle timeout.
set_idle_grace_period
Configures the idle grace period.
set_ui_drag_enabled
Enables or disables dragging of tiles and workspaces.
set_ui_drag_threshold
Sets the distance at which ui dragging starts.
switch_to_vt
Switches to a different VT.
toggle_default_workspace_capture
Toggles whether new workspaces are captured by default.
workspaces
Returns all visible workspaces.