Compare commits
No commits in common. "efd2dd8f348257af8deb7b3ff93067005a899b69" and "5e236b2d3d28fbdb43a7c4283ff5948bf7eb8bc6" have entirely different histories.
efd2dd8f34
...
5e236b2d3d
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1041,7 +1041,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sway-flash-indicator"
|
name = "sway-flash-indicator"
|
||||||
version = "0.6.4"
|
version = "0.6.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"directories",
|
"directories",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "sway-flash-indicator"
|
name = "sway-flash-indicator"
|
||||||
version = "0.6.4"
|
version = "0.6.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
@ -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
|
pkgver=0.6.3
|
||||||
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')
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
[toolchain]
|
|
||||||
channel = "nightly"
|
|
|
@ -1,5 +0,0 @@
|
||||||
wrap_comments = true
|
|
||||||
imports_granularity = "Crate"
|
|
||||||
group_imports = "One"
|
|
||||||
newline_style = "Unix"
|
|
||||||
use_field_init_shorthand = true
|
|
|
@ -1,6 +1,7 @@
|
||||||
use crate::prelude::*;
|
|
||||||
use palette::FromColor;
|
use palette::FromColor;
|
||||||
|
|
||||||
|
use crate::prelude::*;
|
||||||
|
|
||||||
pub type Format = palette::Oklab;
|
pub type Format = palette::Oklab;
|
||||||
pub type RgbFormat = palette::Srgb<u8>;
|
pub type RgbFormat = palette::Srgb<u8>;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use crate::prelude::*;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::prelude::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use crate::prelude::*;
|
|
||||||
use log::LevelFilter;
|
use log::LevelFilter;
|
||||||
use log4rs::{
|
use log4rs::{
|
||||||
append::{
|
append::{
|
||||||
|
@ -13,6 +12,8 @@ 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)
|
||||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -8,7 +8,8 @@ mod logger;
|
||||||
|
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
pub(crate) use crate::colour;
|
pub(crate) use crate::colour;
|
||||||
pub use crate::{error::*, CONFIG};
|
pub use crate::error::*;
|
||||||
|
pub use crate::CONFIG;
|
||||||
}
|
}
|
||||||
|
|
||||||
use prelude::*;
|
use prelude::*;
|
||||||
|
@ -164,17 +165,12 @@ 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);
|
||||||
// we don't want to split zero-sized windows, but containers are also zero-sized
|
if width == 0 || height == 0 {
|
||||||
// - 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| {
|
.is_some_and(|parent| parent.node_type != swayipc_async::NodeType::Workspace)
|
||||||
parent.layout != swayipc_async::NodeLayout::SplitH
|
|
||||||
&& parent.layout != swayipc_async::NodeLayout::SplitV
|
|
||||||
})
|
|
||||||
{
|
{
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue