Implement initial config loading
Config goes in $XDG_CONFIG_HOME/beansprout/config.kdl or
$HOME/.config/beansprout/config.kdl
Config is in the kdl format. Right now, the supported options are
```zig
/// Width of window borders in pixels
border_width: u8 = 2,
/// Color of focused window's border in 0xRRGGBBAA or 0xRRGGBB form
border_color_focused: RiverColor = utils.parseRgbaComptime("0x89b4fa"),
/// Color of uffocused windows' borders in 0xRRGGBBAA or 0xRRGGBB form
border_color_unfocused: RiverColor = utils.parseRgbaComptime("0x1e1e2e"),
/// Where a new window should attach, top or bottom of the stack
attach_mode: AttachMode = .top,
/// Should focus change when the cursor moves onto a new window
focus_follows_pointer: bool = true,
/// Should the pointer warp to the center of newly-focused windows
pointer_warp_on_focus_change: bool = true,
```
I plan to add Keybinds shortly. If parsing the configuration fails,
the default config will be used and the WM will continue loading.
This commit is contained in:
parent
726d346015
commit
43e3d268c9
8 changed files with 261 additions and 18 deletions
|
|
@ -19,7 +19,7 @@ wm: *WindowManager,
|
|||
xkb_bindings: *XkbBindings,
|
||||
|
||||
// WM Configuration
|
||||
config: Config,
|
||||
config: *Config,
|
||||
|
||||
pub fn create(
|
||||
wl_display: *wl.Display,
|
||||
|
|
@ -27,7 +27,7 @@ pub fn create(
|
|||
wl_compositor: *wl.Compositor,
|
||||
river_window_manager_v1: *river.WindowManagerV1,
|
||||
river_xkb_bindings_v1: *river.XkbBindingsV1,
|
||||
config: Config,
|
||||
config: *Config,
|
||||
) !*Context {
|
||||
const context = try utils.allocator.create(Context);
|
||||
errdefer context.destroy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue