Compare commits
3 commits
18814338da
...
b47d623a05
Author | SHA1 | Date | |
---|---|---|---|
Alex Janka | b47d623a05 | ||
Alex Janka | 5f1e1af97a | ||
Alex Janka | 98cb611cdd |
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.1"
|
version = "0.6.2"
|
||||||
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.1"
|
version = "0.6.2"
|
||||||
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.1
|
pkgver=0.6.2
|
||||||
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')
|
||||||
|
|
11
src/main.rs
11
src/main.rs
|
@ -86,7 +86,9 @@ async fn main() -> Res<()> {
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
if let Some(parent) = tree.find_as_ref(|n| n.focus.contains(&node.id)) {
|
if let Some(parent) = tree.find_as_ref(|n| n.focus.contains(&node.id)) {
|
||||||
if parent.layout != swayipc_async::NodeLayout::Tabbed {
|
if parent.layout == swayipc_async::NodeLayout::SplitH
|
||||||
|
|| parent.layout == swayipc_async::NodeLayout::SplitV
|
||||||
|
{
|
||||||
command_connection.run_command("splith").await?;
|
command_connection.run_command("splith").await?;
|
||||||
command_connection.run_command("layout tabbed").await?;
|
command_connection.run_command("layout tabbed").await?;
|
||||||
}
|
}
|
||||||
|
@ -190,7 +192,7 @@ async fn code_trigger<T: AsRef<str> + std::cmp::PartialEq<str>>(
|
||||||
if workspace.focused {
|
if workspace.focused {
|
||||||
let width = workspace.rect.width;
|
let width = workspace.rect.width;
|
||||||
|
|
||||||
let mut workspace = get_with_id(&tree, workspace.id)?;
|
let mut workspace = get_with_id(tree, workspace.id)?;
|
||||||
if workspace
|
if workspace
|
||||||
.output
|
.output
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
@ -213,8 +215,8 @@ async fn code_trigger<T: AsRef<str> + std::cmp::PartialEq<str>>(
|
||||||
&& workspace.focus.len() == 2
|
&& workspace.focus.len() == 2
|
||||||
{
|
{
|
||||||
let (code, other) = {
|
let (code, other) = {
|
||||||
let a = get_with_id(&tree, workspace.focus[0])?;
|
let a = get_with_id(tree, workspace.focus[0])?;
|
||||||
let b = get_with_id(&tree, workspace.focus[1])?;
|
let b = get_with_id(tree, workspace.focus[1])?;
|
||||||
if contains_child(a, id) {
|
if contains_child(a, id) {
|
||||||
(a, b)
|
(a, b)
|
||||||
} else {
|
} else {
|
||||||
|
@ -233,7 +235,6 @@ async fn code_trigger<T: AsRef<str> + std::cmp::PartialEq<str>>(
|
||||||
connection
|
connection
|
||||||
.run_command(format!("swap container with con_id {}", other.id))
|
.run_command(format!("swap container with con_id {}", other.id))
|
||||||
.await?;
|
.await?;
|
||||||
// tokio::time::sleep(std::time::Duration::from_millis(50)).await;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
connection
|
connection
|
||||||
|
|
Loading…
Reference in a new issue