diff --git a/docs/Controlling Ironbar.md b/docs/Controlling Ironbar.md index b43d06b..1a8f7c0 100644 --- a/docs/Controlling Ironbar.md +++ b/docs/Controlling Ironbar.md @@ -148,7 +148,7 @@ Responds with `ok` if the popup exists, otherwise `error`. ```json { "type": "toggle_popup", - "bar_name": "DP-2-13", + "bar_name": "bar-123", "name": "clock" } ``` @@ -163,7 +163,7 @@ Responds with `ok` if the popup exists, otherwise `error`. ```json { "type": "open_popup", - "bar_name": "DP-2-13", + "bar_name": "bar-123", "name": "clock" } ``` @@ -176,8 +176,8 @@ Responds with `ok` if the popup exists, otherwise `error`. ```json { - "type": "toggle_popup", - "bar_name": "DP-2-13" + "type": "close_popup", + "bar_name": "bar-123" } ``` diff --git a/src/clients/wayland/wlr_data_control/mod.rs b/src/clients/wayland/wlr_data_control/mod.rs index afe1989..cc25360 100644 --- a/src/clients/wayland/wlr_data_control/mod.rs +++ b/src/clients/wayland/wlr_data_control/mod.rs @@ -315,22 +315,6 @@ impl DataControlSourceHandler for Environment { } } } - - // for chunk in bytes.chunks(pipe_size as usize) { - // trace!("Writing chunk"); - // file.write(chunk).expect("Failed to write chunk to buffer"); - // file.flush().expect("Failed to flush to file"); - // } - - // match file.write_vectored(&bytes.chunks(pipe_size as usize).map(IoSlice::new).collect::>()) { - // Ok(_) => debug!("Copied item"), - // Err(err) => error!("{err:?}"), - // } - - // match file.write_all(bytes) { - // Ok(_) => debug!("Copied item"), - // Err(err) => error!("{err:?}"), - // } } else { error!("Failed to find source"); } @@ -375,11 +359,14 @@ fn set_pipe_size(fd: RawFd, size: usize) -> io::Result { let new_size = if size > curr_size { trace!("Requesting pipe size increase to (at least): {size}"); + let res = fcntl(fd, F_SETPIPE_SZ(size as i32))?; trace!("New pipe size: {res}"); + if res < size as i32 { return Err(io::Error::last_os_error()); } + res } else { size as i32 diff --git a/src/config/mod.rs b/src/config/mod.rs index eedc6a4..cfb0485 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -123,9 +123,9 @@ impl Default for Config { } Self { - position: Default::default(), + position: BarPosition::default(), height: default_bar_height(), - margin: Default::default(), + margin: MarginConfig::default(), name: None, popup_gap: default_popup_gap(), icon_theme: None, diff --git a/src/modules/clock.rs b/src/modules/clock.rs index 1274002..7a78f88 100644 --- a/src/modules/clock.rs +++ b/src/modules/clock.rs @@ -59,8 +59,7 @@ fn default_popup_format() -> String { fn default_locale() -> String { env::var("LC_TIME") .or_else(|_| env::var("LANG")) - .map(strip_tail) - .unwrap_or_else(|_| "POSIX".to_string()) + .map_or_else(|_| "POSIX".to_string(), strip_tail) } fn strip_tail(string: String) -> String {