1
0
Fork 0
forked from wry/wry

config: allow disabling window titles

This commit is contained in:
Sean Day 2025-10-16 17:48:47 +02:00 committed by Julian Orth
parent 796269d31e
commit daafb98336
19 changed files with 222 additions and 74 deletions

View file

@ -79,6 +79,8 @@ pub enum SimpleCommand {
KillClient,
ShowBar(bool),
ToggleBar,
ShowTitles(bool),
ToggleTitles,
FocusHistory(Timeline),
FocusLayerRel(LayerDirection),
FocusTiles,
@ -525,6 +527,7 @@ pub struct Config {
pub pointer_revert_key: Option<KeySym>,
pub use_hardware_cursor: Option<bool>,
pub show_bar: Option<bool>,
pub show_titles: Option<bool>,
pub focus_history: Option<FocusHistory>,
pub middle_click_paste: Option<bool>,
pub input_modes: AHashMap<String, InputMode>,

View file

@ -146,6 +146,9 @@ impl ActionParser<'_> {
"show-bar" => ShowBar(true),
"hide-bar" => ShowBar(false),
"toggle-bar" => ToggleBar,
"show-titles" => ShowTitles(true),
"hide-titles" => ShowTitles(false),
"toggle-titles" => ToggleTitles,
"focus-prev" => FocusHistory(Timeline::Older),
"focus-next" => FocusHistory(Timeline::Newer),
"focus-below" => FocusLayerRel(LayerDirection::Below),

View file

@ -146,6 +146,7 @@ impl Parser for ConfigParser<'_> {
workspace_display_order_val,
auto_reload,
simple_im_val,
show_titles,
),
) = ext.extract((
(
@ -202,6 +203,7 @@ impl Parser for ConfigParser<'_> {
opt(val("workspace-display-order")),
recover(opt(bol("auto-reload"))),
opt(val("simple-im")),
recover(opt(bol("show-titles"))),
),
))?;
let mut keymap = None;
@ -562,6 +564,7 @@ impl Parser for ConfigParser<'_> {
pointer_revert_key,
use_hardware_cursor: use_hardware_cursor.despan(),
show_bar: show_bar.despan(),
show_titles: show_titles.despan(),
focus_history,
middle_click_paste: middle_click_paste.despan(),
input_modes,

View file

@ -39,12 +39,12 @@ use {
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_middle_click_paste_enabled, set_show_bar,
set_show_float_pin_icon, set_ui_drag_enabled, set_ui_drag_threshold,
set_show_float_pin_icon, set_show_titles, set_ui_drag_enabled, set_ui_drag_threshold,
status::{set_i3bar_separator, set_status, set_status_command, unset_status_command},
switch_to_vt,
tasks::{self, JoinHandle},
theme::{reset_colors, reset_font, reset_sizes, set_bar_font, set_font, set_title_font},
toggle_float_above_fullscreen, toggle_show_bar,
toggle_float_above_fullscreen, toggle_show_bar, toggle_show_titles,
video::{
ColorSpace, Connector, DrmDevice, Eotf, connectors, drm_devices,
on_connector_connected, on_connector_disconnected, on_graphics_initialized,
@ -200,6 +200,8 @@ impl Action {
SimpleCommand::KillClient => client_action!(c, c.kill()),
SimpleCommand::ShowBar(show) => b.new(move || set_show_bar(show)),
SimpleCommand::ToggleBar => b.new(toggle_show_bar),
SimpleCommand::ShowTitles(show) => b.new(move || set_show_titles(show)),
SimpleCommand::ToggleTitles => b.new(toggle_show_titles),
SimpleCommand::FocusHistory(timeline) => {
let persistent = state.persistent.clone();
b.new(move || persistent.seat.focus_history(timeline))
@ -1561,6 +1563,9 @@ fn load_config(initial_load: bool, auto_reload: bool, persistent: &Rc<Persistent
if let Some(v) = config.show_bar {
set_show_bar(v);
}
if let Some(v) = config.show_titles {
set_show_titles(v);
}
if let Some(v) = config.focus_history {
if let Some(v) = v.only_visible {
persistent.seat.focus_history_set_only_visible(v);