Compare commits

..

No commits in common. "efd2dd8f348257af8deb7b3ff93067005a899b69" and "5e236b2d3d28fbdb43a7c4283ff5948bf7eb8bc6" have entirely different histories.

9 changed files with 13 additions and 21 deletions

2
Cargo.lock generated
View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -8,7 +8,8 @@ mod logger;
pub mod prelude {
pub(crate) use crate::colour;
pub use crate::{error::*, CONFIG};
pub use crate::error::*;
pub use crate::CONFIG;
}
use prelude::*;
@ -164,17 +165,12 @@ async fn autosplit(
) -> Res<()> {
if node.node_type == swayipc_async::NodeType::Con {
let (width, height) = (node.window_rect.width, node.window_rect.height);
// 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() {
if width == 0 || height == 0 {
return Ok(());
}
if tree
.find_as_ref(|n| n.focus.contains(&node.id))
.is_some_and(|parent| {
parent.layout != swayipc_async::NodeLayout::SplitH
&& parent.layout != swayipc_async::NodeLayout::SplitV
})
.is_some_and(|parent| parent.node_type != swayipc_async::NodeType::Workspace)
{
return Ok(());
}