hyprshell_core_lib/
transfer.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 or switch
11    Switch(SwitchConfig),
12    /// send by pressing enter / ctrl + <n> / or from the gui itself to close the overview / switch
13    Close(CloseConfig),
14    /// send from the gui itself when typing the launcher
15    Type(String),
16    /// send from pressing ESC
17    Exit,
18    /// send from the app itself when new monitor / config changes detected
19    Restart,
20}
21#[derive(Debug, Serialize, Deserialize)]
22pub struct OpenSwitch {
23    pub hide_filtered: bool,
24    pub filter_current_workspace: bool,
25    pub filter_current_monitor: bool,
26    pub filter_same_class: bool,
27    pub workspaces_per_row: u8,
28    pub direction: Direction,
29}
30
31#[derive(Debug, Serialize, Deserialize)]
32pub struct OpenOverview {
33    pub hide_filtered: bool,
34    pub filter_current_workspace: bool,
35    pub filter_current_monitor: bool,
36    pub filter_same_class: bool,
37    pub workspaces_per_row: u8,
38}
39
40#[derive(Debug, Serialize, Deserialize)]
41pub struct SwitchConfig {
42    pub direction: Direction,
43    pub workspace: bool,
44}
45
46#[derive(Debug, Serialize, Deserialize)]
47pub enum CloseConfig {
48    LauncherClick(Identifier),
49    LauncherPress(char),
50    Windows(WindowsOverride),
51    None,
52}
53
54#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
55pub enum PluginNames {
56    Applications,
57    Shell,
58    Terminal,
59    WebSearch,
60    Calc,
61}
62
63#[derive(Debug, Clone, Serialize, Deserialize)]
64pub struct Identifier {
65    pub plugin: PluginNames,
66    pub identifier: Option<Box<str>>,
67}
68
69#[derive(Debug, Serialize, Deserialize)]
70pub enum WindowsOverride {
71    ClientId(ClientId),
72    WorkspaceID(WorkspaceId),
73}
74
75#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
76pub enum Direction {
77    Right,
78    Left,
79    Up,
80    Down,
81}