| 1 | use crate::bar::{BlockCommand, BlockConfig}; |
| 2 | use crate::keyboard::handlers::Key; |
| 3 | use crate::keyboard::{Arg, KeyAction, keycodes}; |
| 4 | use x11rb::protocol::xproto::KeyButMask; |
| 5 | |
| 6 | // ======================================== |
| 7 | // APPEARANCE |
| 8 | // ======================================== |
| 9 | pub const BORDER_WIDTH: u32 = 2; |
| 10 | pub const BORDER_FOCUSED: u32 = 0x6dade3; |
| 11 | pub const BORDER_UNFOCUSED: u32 = 0xbbbbbb; |
| 12 | pub const FONT: &str = "IosevkaNerdFont:style=Bold:size=10"; |
| 13 | |
| 14 | // ======================================== |
| 15 | // GAPS (Vanity Gaps) |
| 16 | // ======================================== |
| 17 | pub const GAPS_ENABLED: bool = false; |
| 18 | pub const GAP_INNER_HORIZONTAL: u32 = 3; |
| 19 | pub const GAP_INNER_VERTICAL: u32 = 3; |
| 20 | pub const GAP_OUTER_HORIZONTAL: u32 = 3; |
| 21 | pub const GAP_OUTER_VERTICAL: u32 = 3; |
| 22 | // |
| 23 | // ======================================== |
| 24 | // DEFAULTS |
| 25 | // ======================================== |
| 26 | pub const TERMINAL: &str = "st"; |
| 27 | pub const XCLOCK: &str = "xclock"; |
| 28 | pub const MODKEY: KeyButMask = KeyButMask::MOD4; |
| 29 | |
| 30 | // ======================================== |
| 31 | // BAR COLORS |
| 32 | // ======================================== |
| 33 | |
| 34 | // Base colors |
| 35 | const GRAY_DARK: u32 = 0x1a1b26; |
| 36 | const GRAY_SEP: u32 = 0xa9b1d6; |
| 37 | const GRAY_MID: u32 = 0x444444; |
| 38 | const GRAY_LIGHT: u32 = 0xbbbbbb; |
| 39 | const CYAN: u32 = 0x0db9d7; |
| 40 | const MAGENTA: u32 = 0xad8ee6; |
| 41 | const RED: u32 = 0xf7768e; |
| 42 | const GREEN: u32 = 0x9ece6a; |
| 43 | const BLUE: u32 = 0x7aa2f7; |
| 44 | const YELLOW: u32 = 0xe0af68; |
| 45 | |
| 46 | pub struct ColorScheme { |
| 47 | pub foreground: u32, |
| 48 | pub background: u32, |
| 49 | pub underline: u32, |
| 50 | } |
| 51 | |
| 52 | pub const SCHEME_NORMAL: ColorScheme = ColorScheme { |
| 53 | foreground: GRAY_LIGHT, |
| 54 | background: GRAY_DARK, |
| 55 | underline: GRAY_MID, |
| 56 | }; |
| 57 | |
| 58 | pub const SCHEME_OCCUPIED: ColorScheme = ColorScheme { |
| 59 | foreground: CYAN, |
| 60 | background: GRAY_DARK, |
| 61 | underline: CYAN, |
| 62 | }; |
| 63 | |
| 64 | pub const SCHEME_SELECTED: ColorScheme = ColorScheme { |
| 65 | foreground: CYAN, |
| 66 | background: GRAY_DARK, |
| 67 | underline: MAGENTA, |
| 68 | }; |
| 69 | |
| 70 | // ======================================== |
| 71 | // Commands |
| 72 | // ======================================== |
| 73 | const SCREENSHOT_CMD: &[&str] = &[ |
| 74 | "sh", "-c","/home/xsoder/scripts/screeshot", |
| 75 | ]; |
| 76 | |
| 77 | const DMENU_CMD: &[&str] = &["sh", "-c", "dmenu_run"]; |
| 78 | const ZOOM_CMD: &[&str] = &["sh", "-c", "boomer"]; |
| 79 | const SCRIPT_CMD: &[&str] = &["sh", "-c", "/home/xsoder/scripts/master"]; |
| 80 | |
| 81 | // ======================================== |
| 82 | // TAGS |
| 83 | // ======================================== |
| 84 | pub const TAG_COUNT: usize = 9; |
| 85 | pub const TAGS: [&str; TAG_COUNT] = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]; |
| 86 | //pub const TAGS: [&str; TAG_COUNT] = ["", "", "", "", "", "", "", "", ""]; |
| 87 | // pub const TAGS: [&str; TAG_COUNT] = [ |
| 88 | // "DEV", "WWW", "SYS", "DOC", "VBOX", "CHAT", "MUS", "VID", "MISC", |
| 89 | // ]; |
| 90 | |
| 91 | // ======================================== |
| 92 | // KEYBINDINGS |
| 93 | // ======================================== |
| 94 | #[rustfmt::skip] |
| 95 | pub const KEYBINDINGS: &[Key] = &[ |
| 96 | Key::new(&[MODKEY], keycodes::RETURN, KeyAction::Spawn, Arg::Str(TERMINAL)), |
| 97 | Key::new(&[MODKEY], keycodes::F, KeyAction::Spawn, Arg::Str(XCLOCK)), |
| 98 | |
| 99 | Key::new(&[MODKEY], keycodes::D, KeyAction::Spawn, Arg::Array(DMENU_CMD)), |
| 100 | Key::new(&[MODKEY], keycodes::Z, KeyAction::Spawn, Arg::Array(ZOOM_CMD)), |
| 101 | Key::new(&[MODKEY, SHIFT], keycodes::S, KeyAction::Spawn, Arg::Array(SCREENSHOT_CMD)), |
| 102 | Key::new(&[MODKEY], keycodes::O, KeyAction::Spawn, Arg::Array(SCRIPT_CMD)), |
| 103 | Key::new(&[MODKEY], keycodes::Q, KeyAction::KillClient, Arg::None), |
| 104 | Key::new(&[MODKEY, SHIFT], keycodes::F, KeyAction::ToggleFullScreen, Arg::None), |
| 105 | Key::new(&[MODKEY], keycodes::A, KeyAction::ToggleGaps, Arg::None), |
| 106 | Key::new(&[MODKEY, SHIFT], keycodes::Q, KeyAction::Quit, Arg::None), |
| 107 | Key::new(&[MODKEY, SHIFT], keycodes::R, KeyAction::Restart, Arg::None), |
| 108 | Key::new(&[MODKEY], keycodes::J, KeyAction::FocusStack, Arg::Int(-1)), |
| 109 | Key::new(&[MODKEY], keycodes::K, KeyAction::FocusStack, Arg::Int(1)), |
| 110 | |
| 111 | Key::new(&[MODKEY], keycodes::KEY_1, KeyAction::ViewTag, Arg::Int(0)), |
| 112 | Key::new(&[MODKEY], keycodes::KEY_2, KeyAction::ViewTag, Arg::Int(1)), |
| 113 | Key::new(&[MODKEY], keycodes::KEY_3, KeyAction::ViewTag, Arg::Int(2)), |
| 114 | Key::new(&[MODKEY], keycodes::KEY_4, KeyAction::ViewTag, Arg::Int(3)), |
| 115 | Key::new(&[MODKEY], keycodes::KEY_5, KeyAction::ViewTag, Arg::Int(4)), |
| 116 | Key::new(&[MODKEY], keycodes::KEY_6, KeyAction::ViewTag, Arg::Int(5)), |
| 117 | Key::new(&[MODKEY], keycodes::KEY_7, KeyAction::ViewTag, Arg::Int(6)), |
| 118 | Key::new(&[MODKEY], keycodes::KEY_8, KeyAction::ViewTag, Arg::Int(7)), |
| 119 | Key::new(&[MODKEY], keycodes::KEY_9, KeyAction::ViewTag, Arg::Int(8)), |
| 120 | |
| 121 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_1, KeyAction::MoveToTag, Arg::Int(0)), |
| 122 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_2, KeyAction::MoveToTag, Arg::Int(1)), |
| 123 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_3, KeyAction::MoveToTag, Arg::Int(2)), |
| 124 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_4, KeyAction::MoveToTag, Arg::Int(3)), |
| 125 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_5, KeyAction::MoveToTag, Arg::Int(4)), |
| 126 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_6, KeyAction::MoveToTag, Arg::Int(5)), |
| 127 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_7, KeyAction::MoveToTag, Arg::Int(6)), |
| 128 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_8, KeyAction::MoveToTag, Arg::Int(7)), |
| 129 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_9, KeyAction::MoveToTag, Arg::Int(8)), |
| 130 | ]; |
| 131 | |
| 132 | // ======================================== |
| 133 | // STATUS BAR BLOCKS |
| 134 | // ======================================== |
| 135 | pub const STATUS_BLOCKS: &[BlockConfig] = &[ |
| 136 | BlockConfig { |
| 137 | format: "", |
| 138 | command: BlockCommand::Battery { |
| 139 | format_charging: " Bat: {}%", |
| 140 | format_discharging: " Bat:{}%", |
| 141 | format_full: " Bat: {}%", |
| 142 | }, |
| 143 | interval_secs: 30, |
| 144 | color: GREEN, |
| 145 | underline: true, |
| 146 | }, |
| 147 | BlockConfig { |
| 148 | format: " │ ", |
| 149 | command: BlockCommand::Static(""), |
| 150 | interval_secs: u64::MAX, |
| 151 | color: GRAY_SEP, |
| 152 | underline: false, |
| 153 | }, |
| 154 | BlockConfig { |
| 155 | format: " {used}/{total} GB", |
| 156 | command: BlockCommand::Ram, |
| 157 | interval_secs: 5, |
| 158 | color: BLUE, |
| 159 | underline: true, |
| 160 | }, |
| 161 | BlockConfig { |
| 162 | format: " │ ", |
| 163 | command: BlockCommand::Static(""), |
| 164 | interval_secs: u64::MAX, |
| 165 | color: GRAY_SEP, |
| 166 | underline: false, |
| 167 | }, |
| 168 | BlockConfig { |
| 169 | format: " {}", |
| 170 | command: BlockCommand::Shell("uname -r"), |
| 171 | interval_secs: u64::MAX, |
| 172 | color: RED, |
| 173 | underline: true, |
| 174 | }, |
| 175 | BlockConfig { |
| 176 | format: " │ ", |
| 177 | command: BlockCommand::Static(""), |
| 178 | interval_secs: u64::MAX, |
| 179 | color: GRAY_SEP, |
| 180 | underline: false, |
| 181 | }, |
| 182 | BlockConfig { |
| 183 | format: " {}", |
| 184 | command: BlockCommand::DateTime("%a, %b %d - %-I:%M %P"), |
| 185 | interval_secs: 1, |
| 186 | color: CYAN, |
| 187 | underline: true, |
| 188 | }, |
| 189 | ]; |
| 190 | |
| 191 | const SHIFT: KeyButMask = KeyButMask::SHIFT; |
| 192 | pub const WM_BINARY: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/target/release/oxwm"); |