Skip to content

Commit 015c638

Browse files
authored
Merge pull request #355 from sashetophizika/groupdispatchers
feat: added missing group dispatchers
2 parents c8392c2 + 912f2b5 commit 015c638

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/dispatch.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ pub enum WindowSwitchDirection {
103103
Back,
104104
#[display("f")]
105105
Forward,
106+
#[display("{}", _0)]
107+
Index(i32),
106108
}
107109

108110
/// This enum is used for identifying monitors
@@ -560,10 +562,32 @@ pub enum DispatchType<'a> {
560562
ChangeGroupActive(WindowSwitchDirection),
561563
/// Locks the groups
562564
LockGroups(LockType),
565+
/// Locks the currently focused group
566+
LockActiveGroup(LockType),
563567
/// Moves the active window into a group in a specified direction
564568
MoveIntoGroup(Direction),
569+
/// Moves the active window into or out of a group in a specified direction
570+
MoveWindowOrGroup(Direction),
565571
/// Moves the active window out of a group.
566572
MoveOutOfGroup,
573+
/// Swaps the active window with the next or previous in a group
574+
MoveGroupWindow(WindowSwitchDirection),
575+
/// Prohibit the active window from becoming or being inserted into group
576+
DenyWindowFromGroup(BinaryState),
577+
/// Temporarily enable or disable ignore_group_lock
578+
SetIgnoreGroupLock(BinaryState),
579+
}
580+
581+
/// Enum used for options with a binary on/off state
582+
#[allow(missing_docs)]
583+
#[derive(Debug, Clone, Copy, Display, PartialEq, Eq, PartialOrd, Ord)]
584+
pub enum BinaryState {
585+
#[display("on")]
586+
On,
587+
#[display("off")]
588+
Off,
589+
#[display("toggle")]
590+
Toggle,
567591
}
568592

569593
/// Enum used with [DispatchType::LockGroups], to determine how to lock/unlock
@@ -753,8 +777,13 @@ pub(crate) fn gen_dispatch_str(cmd: DispatchType, dispatch: bool) -> crate::Resu
753777
ToggleGroup => "togglegroup".to_string(),
754778
ChangeGroupActive(dir) => format!("changegroupactive{sep}{dir}"),
755779
LockGroups(how) => format!("lockgroups{sep}{how}"),
780+
LockActiveGroup(how) => format!("lockactivegroups{sep}{how}"),
756781
MoveIntoGroup(dir) => format!("moveintogroup{sep}{dir}"),
782+
MoveWindowOrGroup(dir) => format!("movewindoworgroup{sep}{dir}"),
757783
MoveOutOfGroup => "moveoutofgroup".to_string(),
784+
MoveGroupWindow(dir) => format!("movegroupwindow{sep}{dir}"),
785+
DenyWindowFromGroup(state) => format!("denywindowfromgroup{sep}{state}"),
786+
SetIgnoreGroupLock(state) => format!("setignoregrouplock{sep}{state}"),
758787
};
759788

760789
if let SetCursor(_, _) = cmd {

0 commit comments

Comments
 (0)