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(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(CloseSwitchConfig),
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 scale: f64,
28    pub items_per_row: u8,
29    pub filter_current_workspace: bool,
30    pub filter_current_monitor: bool,
31    pub filter_same_class: bool,
32    pub reverse: bool,
33}
34
35#[derive(Debug, Serialize, Deserialize)]
36pub struct OpenOverview {
37    pub hide_filtered: bool,
38    pub scale: f64,
39    pub items_per_row: u8,
40    pub filter_current_workspace: bool,
41    pub filter_current_monitor: bool,
42    pub filter_same_class: bool,
43}
44
45#[derive(Debug, Serialize, Deserialize)]
46pub struct SwitchOverviewConfig {
47    pub direction: Direction,
48    pub workspace: bool,
49}
50
51#[derive(Debug, Serialize, Deserialize)]
52pub struct SwitchSwitchConfig {
53    pub reverse: bool,
54}
55
56#[derive(Debug, Serialize, Deserialize)]
57pub enum CloseOverviewConfig {
58    LauncherClick(Identifier),
59    LauncherPress(char),
60    Windows(WindowsOverride),
61    None,
62}
63
64#[derive(Debug, Serialize, Deserialize)]
65pub enum CloseSwitchConfig {
66    Windows(ClientId),
67    None,
68}
69
70#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
71pub enum PluginNames {
72    Applications,
73    Shell,
74    Terminal,
75    WebSearch,
76    Calc,
77}
78
79#[derive(Debug, Clone, Serialize, Deserialize)]
80pub struct Identifier {
81    pub plugin: PluginNames,
82    pub identifier: Option<Box<str>>,
83}
84
85#[derive(Debug, Serialize, Deserialize)]
86pub enum WindowsOverride {
87    ClientId(ClientId),
88    WorkspaceID(WorkspaceId),
89}
90
91#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
92pub enum Direction {
93    Right,
94    Left,
95    Up,
96    Down,
97}