1
0
Fork 0
forked from wry/wry

config: allow disabling the built-in bar

This commit is contained in:
Julian Orth 2025-07-17 22:31:16 +02:00
parent 224f5380fe
commit 08e7e01d0e
16 changed files with 156 additions and 14 deletions

View file

@ -68,6 +68,8 @@ pub enum SimpleCommand {
SetFloatPinned(bool),
ToggleFloatPinned,
KillClient,
ShowBar(bool),
ToggleBar,
}
#[derive(Debug, Clone)]
@ -483,6 +485,7 @@ pub struct Config {
pub window_rules: Vec<WindowRule>,
pub pointer_revert_key: Option<KeySym>,
pub use_hardware_cursor: Option<bool>,
pub show_bar: Option<bool>,
}
#[derive(Debug, Error)]

View file

@ -133,6 +133,9 @@ impl ActionParser<'_> {
"unpin-float" => SetFloatPinned(false),
"toggle-float-pinned" => ToggleFloatPinned,
"kill-client" => KillClient,
"show-bar" => ShowBar(true),
"hide-bar" => ShowBar(false),
"toggle-bar" => ToggleBar,
_ => {
return Err(
ActionParserError::UnknownSimpleAction(string.to_string()).spanned(span)

View file

@ -132,6 +132,7 @@ impl Parser for ConfigParser<'_> {
window_rules_val,
pointer_revert_key_str,
use_hardware_cursor,
show_bar,
),
) = ext.extract((
(
@ -179,6 +180,7 @@ impl Parser for ConfigParser<'_> {
opt(val("windows")),
recover(opt(str("pointer-revert-key"))),
recover(opt(bol("use-hardware-cursor"))),
recover(opt(bol("show-bar"))),
),
))?;
let mut keymap = None;
@ -494,6 +496,7 @@ impl Parser for ConfigParser<'_> {
window_rules,
pointer_revert_key,
use_hardware_cursor: use_hardware_cursor.despan(),
show_bar: show_bar.despan(),
})
}
}

View file

@ -35,12 +35,12 @@ use {
logging::set_log_level,
on_devices_enumerated, on_idle, on_unload, quit, reload, set_color_management_enabled,
set_default_workspace_capture, set_explicit_sync_enabled, set_float_above_fullscreen,
set_idle, set_idle_grace_period, set_show_float_pin_icon, set_ui_drag_enabled,
set_ui_drag_threshold,
set_idle, set_idle_grace_period, set_show_bar, set_show_float_pin_icon,
set_ui_drag_enabled, set_ui_drag_threshold,
status::{set_i3bar_separator, set_status, set_status_command, unset_status_command},
switch_to_vt,
theme::{reset_colors, reset_font, reset_sizes, set_font},
toggle_float_above_fullscreen,
toggle_float_above_fullscreen, toggle_show_bar,
video::{
ColorSpace, Connector, DrmDevice, TransferFunction, connectors, drm_devices,
on_connector_connected, on_connector_disconnected, on_graphics_initialized,
@ -154,6 +154,8 @@ impl Action {
}
SimpleCommand::ToggleFloatPinned => window_or_seat!(s, s.toggle_float_pinned()),
SimpleCommand::KillClient => client_action!(c, c.kill()),
SimpleCommand::ShowBar(show) => B::new(move || set_show_bar(show)),
SimpleCommand::ToggleBar => B::new(toggle_show_bar),
},
Action::Multi { actions } => {
let actions: Vec<_> = actions.into_iter().map(|a| a.into_fn(state)).collect();
@ -1247,6 +1249,9 @@ fn load_config(initial_load: bool, persistent: &Rc<PersistentState>) {
if let Some(v) = config.use_hardware_cursor {
persistent.seat.use_hardware_cursor(v);
}
if let Some(v) = config.show_bar {
set_show_bar(v);
}
}
fn create_command(exec: &Exec) -> Command {