Skip to content

Commit

Permalink
feat: do not display icon of a sticky window
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Chovanec committed May 16, 2023
1 parent 8bde72d commit e9a3ef2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ serde_derive = "1.0"
lockfile = "0.3.0"
anyhow = "1.0"
indexmap = "1.8"
swayipc = { git = "https://github.com/pierrechevalier83/swayipc-rs.git", branch = "fix_crash_when_using_without_i3_or_sway" }
swayipc = { git = "https://github.com/chovanecadam/swayipc-rs.git", branch = "master" }


once_cell = "1.9"
Expand Down
15 changes: 13 additions & 2 deletions src/window_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use itertools::Itertools;
use std::collections::BTreeMap;
use std::sync::{mpsc, mpsc::Receiver};
use std::thread;
use swayipc::{Connection, EventStream, EventType, Node, NodeType};
use swayipc::{Connection, EventStream, EventType, Floating, Node, NodeType};

trait NodeExt {
fn is_workspace(&self) -> bool;
Expand Down Expand Up @@ -86,7 +86,18 @@ impl Window {
let name = node.name();
let app_id = node.app_id();
let window_properties_class = node.window_properties_class();
if name.is_some() || app_id.is_some() || window_properties_class.is_some() {

let sway_floating: bool = node.node_type == NodeType::FloatingCon;
let i3_floating: bool = match node.floating {
Some(Floating::UserOn) => true,
Some(Floating::AutoOn) => true,
Some(_) => false,
None => false,
};

if !(node.sticky && (sway_floating || i3_floating))
&& (name.is_some() || app_id.is_some() || window_properties_class.is_some())
{
Some(Self {
name,
app_id,
Expand Down

0 comments on commit e9a3ef2

Please sign in to comment.