tauri_winutils/
config.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
4pub struct Config {
5    pub window_gap: u32,
6    pub screen_width: u32,
7    pub screen_height: u32,
8    pub auto_arrange: bool,
9    pub focus_follows_mouse: bool,
10    pub border_width: u32,
11    pub border_color_active: String,
12    pub border_color_inactive: String,
13    pub keybindings: KeyBindings,
14}
15
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct KeyBindings {
18    pub switch_workspace_1: String,
19    pub switch_workspace_2: String,
20    pub switch_workspace_3: String,
21    pub switch_workspace_4: String,
22    pub close_window: String,
23    pub toggle_layout: String,
24    pub focus_next: String,
25    pub focus_prev: String,
26}
27
28impl Default for Config {
29    fn default() -> Self {
30        Self {
31            window_gap: 10,
32            screen_width: 1920,
33            screen_height: 1080,
34            auto_arrange: true,
35            focus_follows_mouse: false,
36            border_width: 2,
37            border_color_active: "#0066cc".to_string(),
38            border_color_inactive: "#666666".to_string(),
39            keybindings: KeyBindings::default(),
40        }
41    }
42}
43
44impl Default for KeyBindings {
45    fn default() -> Self {
46        Self {
47            switch_workspace_1: "Super+1".to_string(),
48            switch_workspace_2: "Super+2".to_string(),
49            switch_workspace_3: "Super+3".to_string(),
50            switch_workspace_4: "Super+4".to_string(),
51            close_window: "Super+q".to_string(),
52            toggle_layout: "Super+space".to_string(),
53            focus_next: "Super+j".to_string(),
54            focus_prev: "Super+k".to_string(),
55        }
56    }
57}