Skip to content

Commit 7665f08

Browse files
authored
Merge pull request #358 from sashetophizika/winident
feat: added missing param options
2 parents 015c638 + 2542232 commit 7665f08

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

src/dispatch.rs

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,21 @@ pub enum WindowIdentifier<'a> {
3333
/// The window title
3434
#[display("title:{_0}")]
3535
Title(&'a str),
36+
/// A window tag regex
37+
#[display("tag:{_0}")]
38+
Tag(&'a str),
3639
/// The window's process Id
3740
#[display("pid:{_0}")]
3841
ProcessId(u32),
42+
/// The active window
43+
#[display("activewindow")]
44+
ActiveWindow,
45+
/// The first floating window
46+
#[display("floating")]
47+
Floating,
48+
/// The first tiled window
49+
#[display("tiled")]
50+
Tiled,
3951
}
4052

4153
/// This enum holds the fullscreen types
@@ -67,22 +79,20 @@ pub enum Direction {
6779
}
6880

6981
/// This enum is used for resizing and moving windows precisely
70-
#[derive(Debug, Clone)]
82+
#[derive(Debug, Clone, Display)]
7183
pub enum Position {
72-
/// A delta
84+
/// A delta in pixels
85+
#[display("{_0} {_0}")]
7386
Delta(i16, i16),
74-
/// The exact size
87+
/// The exact size in pixels
88+
#[display("exact {_0} {_0}")]
7589
Exact(i16, i16),
76-
}
77-
78-
impl std::fmt::Display for Position {
79-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
80-
let out = match self {
81-
Position::Delta(x, y) => format!("{x} {y}"),
82-
Position::Exact(w, h) => format!("exact {w} {h}"),
83-
};
84-
write!(f, "{out}")
85-
}
90+
/// A delta in window fraction
91+
#[display("{_0}% {_0}%")]
92+
DeltaFraction(i16, i16),
93+
/// The exact size in screen fraction
94+
#[display("exact {_0}% {_0}%")]
95+
ExactFraction(i16, i16),
8696
}
8797

8898
/// This enum holds a direction for cycling

0 commit comments

Comments
 (0)