hyprshell_core_lib/transfer/
structs.rs

1use crate::{ClientId, WorkspaceId};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Serialize, Deserialize)]
5pub enum TransferType {
6    /// send from the keybind to open the overview
7    OpenOverview,
8    /// send from the keybind to open the switch
9    OpenSwitch(OpenSwitch),
10    /// send from the keybinds like arrow keys or tab on overview
11    SwitchOverview(SwitchOverviewConfig),
12    /// send from the keybinds like arrow keys or tab on switch
13    SwitchSwitch(SwitchSwitchConfig),
14    /// send by pressing enter / ctrl + <n> / or from the gui itself to close the overview / switch
15    CloseOverview(CloseOverviewConfig),
16    /// send by pressing enter / ctrl + <n> / or from the gui itself to close the overview / switch
17    CloseSwitch,
18    /// send from the gui itself when typing the launcher
19    Type(String),
20    /// send from pressing ESC
21    Exit,
22    /// send from the app itself when new monitor / config changes detected
23    Restart,
24}
25#[derive(Debug, Serialize, Deserialize)]
26pub struct OpenSwitch {
27    pub reverse: bool,
28}
29
30#[derive(Debug, Serialize, Deserialize)]
31pub struct SwitchOverviewConfig {
32    pub direction: Direction,
33    pub workspace: bool,
34}
35
36#[derive(Debug, Serialize, Deserialize)]
37pub struct SwitchSwitchConfig {
38    pub reverse: bool,
39}
40
41#[derive(Debug, Serialize, Deserialize)]
42pub enum CloseOverviewConfig {
43    LauncherClick(Identifier),
44    LauncherPress(char),
45    Windows(WindowsOverride),
46    None,
47}
48
49#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
50pub enum PluginNames {
51    Applications,
52    Shell,
53    Terminal,
54    WebSearch,
55    Calc,
56}
57
58#[derive(Debug, Clone, Serialize, Deserialize)]
59pub struct Identifier {
60    pub plugin: PluginNames,
61    pub identifier: Option<Box<str>>,
62}
63
64#[derive(Debug, Serialize, Deserialize)]
65pub enum WindowsOverride {
66    ClientId(ClientId),
67    WorkspaceID(WorkspaceId),
68}
69
70#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
71pub enum Direction {
72    Right,
73    Left,
74    Up,
75    Down,
76}