Compare commits
4 commits
5e236b2d3d
...
efd2dd8f34
Author | SHA1 | Date | |
---|---|---|---|
Alex Janka | efd2dd8f34 | ||
Alex Janka | 356b0c24a8 | ||
Alex Janka | af1c013562 | ||
Alex Janka | d537999b8c |
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.3"
|
version = "0.6.4"
|
||||||
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.3"
|
version = "0.6.4"
|
||||||
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.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
2
rust-toolchain.toml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[toolchain]
|
||||||
|
channel = "nightly"
|
5
rustfmt.toml
Normal file
5
rustfmt.toml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
wrap_comments = true
|
||||||
|
imports_granularity = "Crate"
|
||||||
|
group_imports = "One"
|
||||||
|
newline_style = "Unix"
|
||||||
|
use_field_init_shorthand = true
|
|
@ -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>;
|
||||||
|
|
|
@ -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)]
|
||||||
|
|
|
@ -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)
|
||||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -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(());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue