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 submap_name: String,
24    pub hide_filtered: bool,
25    pub filter_current_workspace: bool,
26    pub filter_current_monitor: bool,
27    pub filter_same_class: bool,
28    pub workspaces_per_row: u8,
29    pub direction: Direction,
30}
31
32#[derive(Debug, Serialize, Deserialize)]
33pub struct OpenOverview {
34    pub submap_name: String,
35    pub hide_filtered: bool,
36    pub filter_current_workspace: bool,
37    pub filter_current_monitor: bool,
38    pub filter_same_class: bool,
39    pub workspaces_per_row: u8,
40}
41
42#[derive(Debug, Serialize, Deserialize)]
43pub struct SwitchConfig {
44    pub direction: Direction,
45    pub workspace: bool,
46}
47
48#[derive(Debug, Serialize, Deserialize)]
49pub enum CloseConfig {
50    Launcher(char),
51    Windows(WindowsOverride),
52    None,
53}
54#[derive(Debug, Serialize, Deserialize)]
55pub enum WindowsOverride {
56    ClientId(ClientId),
57    WorkspaceID(WorkspaceId),
58}
59
60#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
61pub enum Direction {
62    Right,
63    Left,
64    Up,
65    Down,
66}