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    CloseOverview(CloseOverviewConfig),
15    CloseSwitch,
16    /// send from the gui itself when typing the launcher
17    Type(String),
18    /// send from pressing ESC
19    Exit,
20    /// send from the app itself when new monitor / config changes detected
21    Restart,
22}
23#[derive(Debug, Serialize, Deserialize)]
24pub struct OpenSwitch {
25    pub reverse: bool,
26}
27
28#[derive(Debug, Serialize, Deserialize)]
29pub struct SwitchOverviewConfig {
30    pub direction: Direction,
31    pub workspace: bool,
32}
33
34#[derive(Debug, Serialize, Deserialize)]
35pub struct SwitchSwitchConfig {
36    pub reverse: bool,
37}
38
39#[derive(Debug, Serialize, Deserialize)]
40pub enum CloseOverviewConfig {
41    LauncherClick(Identifier),
42    LauncherPress(char),
43    Windows(WindowsOverride),
44    None,
45}
46
47#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
48pub enum PluginNames {
49    Applications,
50    Shell,
51    Terminal,
52    WebSearch,
53    Calc,
54}
55
56#[derive(Debug, Clone, Serialize, Deserialize)]
57pub struct Identifier {
58    pub plugin: PluginNames,
59    pub identifier: Option<Box<str>>,
60}
61
62#[derive(Debug, Serialize, Deserialize)]
63pub enum WindowsOverride {
64    ClientId(ClientId),
65    WorkspaceID(WorkspaceId),
66}
67
68#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
69pub enum Direction {
70    Right,
71    Left,
72    Up,
73    Down,
74}