leftwm_core/
command.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
pub use crate::handlers::command_handler::ReleaseScratchPadOption;
use crate::models::{Handle, ScratchPadName, TagId, WindowHandle};
use leftwm_layouts::geometry::Direction as FocusDirection;
use serde::{Deserialize, Serialize};

/// Command represents a command received from the command pipe.
/// It will be handled in the main event loop.
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
pub enum Command<H: Handle> {
    CloseWindow,
    SwapScreens,
    SoftReload,
    HardReload,
    AttachScratchPad {
        #[serde(bound = "")]
        window: Option<WindowHandle<H>>,
        scratchpad: ScratchPadName,
    },
    ReleaseScratchPad {
        #[serde(bound = "")]
        window: ReleaseScratchPadOption<H>,
        tag: Option<TagId>,
    },
    PrevScratchPadWindow {
        scratchpad: ScratchPadName,
    },
    NextScratchPadWindow {
        scratchpad: ScratchPadName,
    },
    ToggleScratchPad(ScratchPadName),
    ToggleFullScreen,
    ToggleMaximized,
    ToggleSticky,
    ToggleAbove,
    GoToTag {
        tag: TagId,
        swap: bool,
    },
    ReturnToLastTag,
    FloatingToTile,
    TileToFloating,
    ToggleFloating,
    MoveWindowUp,
    MoveWindowDown,
    MoveWindowTop {
        swap: bool,
    },
    MoveWindowAt(FocusDirection),
    SwapWindowTop {
        swap: bool,
    },
    FocusNextTag {
        behavior: FocusDeltaBehavior,
    },
    FocusPreviousTag {
        behavior: FocusDeltaBehavior,
    },
    FocusWindow(String),
    FocusWindowUp,
    FocusWindowDown,
    FocusWindowTop {
        swap: bool,
    },
    FocusWindowAt(FocusDirection),
    FocusWorkspaceNext,
    FocusWorkspacePrevious,
    SendWindowToTag {
        #[serde(bound = "")]
        window: Option<WindowHandle<H>>,
        tag: TagId,
    },
    MoveWindowToNextTag {
        follow: bool,
    },
    MoveWindowToPreviousTag {
        follow: bool,
    },
    MoveWindowToLastWorkspace,
    MoveWindowToNextWorkspace,
    MoveWindowToPreviousWorkspace,
    NextLayout,
    PreviousLayout,
    SetLayout(String),
    RotateTag,
    IncreaseMainWidth(i32), // deprecated: use IncreaseMainSize instead
    DecreaseMainWidth(i32), // deprecated: use DecreaseMainSize instead
    IncreaseMainSize(i32),
    DecreaseMainSize(i32),
    IncreaseMainCount(),
    DecreaseMainCount(),
    SetMarginMultiplier(f32),
    SendWorkspaceToTag(usize, usize),
    CloseAllOtherWindows,
    Other(String),
}

#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Debug)]
pub enum FocusDeltaBehavior {
    Default,
    IgnoreUsed,
    IgnoreEmpty,
}