Compare commits

...

4 commits

Author SHA1 Message Date
Alex Janka efd2dd8f34 bump version: 0.6.4 2024-09-26 10:48:05 +10:00
Alex Janka 356b0c24a8 pkgbuild: set pkgver to 0 in version control
pkgver() will fix this
2024-09-26 10:45:13 +10:00
Alex Janka af1c013562 rustfmt.toml 2024-09-26 10:42:24 +10:00
Alex Janka d537999b8c autosplit: better skip logic 2024-09-26 10:41:13 +10:00
9 changed files with 21 additions and 13 deletions

2
Cargo.lock generated
View file

@ -1041,7 +1041,7 @@ dependencies = [
[[package]] [[package]]
name = "sway-flash-indicator" name = "sway-flash-indicator"
version = "0.6.3" version = "0.6.4"
dependencies = [ dependencies = [
"directories", "directories",
"futures-util", "futures-util",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "sway-flash-indicator" name = "sway-flash-indicator"
version = "0.6.3" version = "0.6.4"
edition = "2021" edition = "2021"
[dependencies] [dependencies]

View file

@ -1,7 +1,7 @@
# Maintainer: Alex Janka <alex@alexjanka.com> # Maintainer: Alex Janka <alex@alexjanka.com>
pkgname=sway-flash-indicator pkgname=sway-flash-indicator
pkgver=0.6.3 pkgver=0
pkgrel=1 pkgrel=1
pkgdesc="flashes sway indicator border rather than always showing it" pkgdesc="flashes sway indicator border rather than always showing it"
arch=('x86_64' 'aarch64') arch=('x86_64' 'aarch64')

2
rust-toolchain.toml Normal file
View file

@ -0,0 +1,2 @@
[toolchain]
channel = "nightly"

5
rustfmt.toml Normal file
View file

@ -0,0 +1,5 @@
wrap_comments = true
imports_granularity = "Crate"
group_imports = "One"
newline_style = "Unix"
use_field_init_shorthand = true

View file

@ -1,6 +1,5 @@
use palette::FromColor;
use crate::prelude::*; use crate::prelude::*;
use palette::FromColor;
pub type Format = palette::Oklab; pub type Format = palette::Oklab;
pub type RgbFormat = palette::Srgb<u8>; pub type RgbFormat = palette::Srgb<u8>;

View file

@ -1,6 +1,5 @@
use serde::{Deserialize, Serialize};
use crate::prelude::*; use crate::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(default)] #[serde(default)]

View file

@ -1,3 +1,4 @@
use crate::prelude::*;
use log::LevelFilter; use log::LevelFilter;
use log4rs::{ use log4rs::{
append::{ append::{
@ -12,8 +13,6 @@ use log4rs::{
Config, Config,
}; };
use crate::prelude::*;
pub async fn init_logger(file: bool) -> Res<()> { pub async fn init_logger(file: bool) -> Res<()> {
let stderr = ConsoleAppender::builder() let stderr = ConsoleAppender::builder()
.target(Target::Stderr) .target(Target::Stderr)

View file

@ -8,8 +8,7 @@ mod logger;
pub mod prelude { pub mod prelude {
pub(crate) use crate::colour; pub(crate) use crate::colour;
pub use crate::error::*; pub use crate::{error::*, CONFIG};
pub use crate::CONFIG;
} }
use prelude::*; use prelude::*;
@ -165,12 +164,17 @@ async fn autosplit(
) -> Res<()> { ) -> Res<()> {
if node.node_type == swayipc_async::NodeType::Con { if node.node_type == swayipc_async::NodeType::Con {
let (width, height) = (node.window_rect.width, node.window_rect.height); let (width, height) = (node.window_rect.width, node.window_rect.height);
if width == 0 || height == 0 { // we don't want to split zero-sized windows, but containers are also zero-sized
// - so only skip if size is 0 and we have no children
if (width == 0 || height == 0) && node.focus.is_empty() {
return Ok(()); return Ok(());
} }
if tree if tree
.find_as_ref(|n| n.focus.contains(&node.id)) .find_as_ref(|n| n.focus.contains(&node.id))
.is_some_and(|parent| parent.node_type != swayipc_async::NodeType::Workspace) .is_some_and(|parent| {
parent.layout != swayipc_async::NodeLayout::SplitH
&& parent.layout != swayipc_async::NodeLayout::SplitV
})
{ {
return Ok(()); return Ok(());
} }