| 1 | use crate::keyboard::handlers::Key; |
| 2 | use crate::keyboard::{Arg, KeyAction, keycodes}; |
| 3 | use x11rb::protocol::xproto::KeyButMask; |
| 4 | |
| 5 | // ======================================== |
| 6 | // APPEARANCE |
| 7 | // ======================================== |
| 8 | pub const BORDER_WIDTH: u32 = 1; |
| 9 | pub const BORDER_FOCUSED: u32 = 0x6dade3; |
| 10 | pub const BORDER_UNFOCUSED: u32 = 0xbbbbbb; |
| 11 | pub const FONT: &str = "JetBrainsMono Nerd Font:style=Bold:size=12"; |
| 12 | |
| 13 | // ======================================== |
| 14 | // DEFAULTS |
| 15 | // ======================================== |
| 16 | pub const TERMINAL: &str = "alacritty"; |
| 17 | pub const MODKEY: KeyButMask = KeyButMask::MOD1; |
| 18 | |
| 19 | // ======================================== |
| 20 | // BAR COLORS |
| 21 | // ======================================== |
| 22 | |
| 23 | // Base colors |
| 24 | const GRAY_DARK: u32 = 0x222222; |
| 25 | const GRAY_MID: u32 = 0x444444; |
| 26 | const GRAY_LIGHT: u32 = 0xbbbbbb; |
| 27 | const CYAN: u32 = 0x0db9d7; |
| 28 | const MAGENTA: u32 = 0xad8ee6; |
| 29 | const RED: u32 = 0xf7768e; |
| 30 | const GREEN: u32 = 0x9ece6a; |
| 31 | const BLUE: u32 = 0x7aa2f7; |
| 32 | const YELLOW: u32 = 0xe0af68; |
| 33 | |
| 34 | pub struct ColorScheme { |
| 35 | pub foreground: u32, |
| 36 | pub background: u32, |
| 37 | pub border: u32, |
| 38 | } |
| 39 | |
| 40 | pub const SCHEME_NORMAL: ColorScheme = ColorScheme { |
| 41 | foreground: GRAY_LIGHT, |
| 42 | background: GRAY_DARK, |
| 43 | border: GRAY_MID, |
| 44 | }; |
| 45 | |
| 46 | pub const SCHEME_OCCUPIED: ColorScheme = ColorScheme { |
| 47 | foreground: CYAN, |
| 48 | background: GRAY_DARK, |
| 49 | border: CYAN, |
| 50 | }; |
| 51 | |
| 52 | pub const SCHEME_SELECTED: ColorScheme = ColorScheme { |
| 53 | foreground: CYAN, |
| 54 | background: GRAY_DARK, |
| 55 | border: MAGENTA, |
| 56 | }; |
| 57 | |
| 58 | // ======================================== |
| 59 | // Commands |
| 60 | // ======================================== |
| 61 | const SCREENSHOT_CMD: &[&str] = &[ |
| 62 | "sh", |
| 63 | "-c", |
| 64 | "maim ~/screenshots/screenshot_$(date +%Y%m%d_%H%M%S).png", |
| 65 | ]; |
| 66 | |
| 67 | const DMENU_CMD: &[&str] = &["sh", "-c", "dmenu_run -l 10"]; |
| 68 | |
| 69 | // ======================================== |
| 70 | // TAGS |
| 71 | // ======================================== |
| 72 | pub const TAG_COUNT: usize = 9; |
| 73 | pub const TAGS: [&str; TAG_COUNT] = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]; |
| 74 | |
| 75 | // ======================================== |
| 76 | // KEYBINDINGS |
| 77 | // ======================================== |
| 78 | #[rustfmt::skip] |
| 79 | pub const KEYBINDINGS: &[Key] = &[ |
| 80 | Key::new(&[MODKEY], keycodes::RETURN, KeyAction::Spawn, Arg::Str(TERMINAL)), |
| 81 | |
| 82 | Key::new(&[MODKEY], keycodes::S, KeyAction::Spawn, Arg::Array(SCREENSHOT_CMD)), |
| 83 | Key::new(&[MODKEY], keycodes::D, KeyAction::Spawn, Arg::Array(DMENU_CMD)), |
| 84 | Key::new(&[MODKEY], keycodes::Q, KeyAction::KillClient, Arg::None), |
| 85 | Key::new(&[MODKEY, SHIFT], keycodes::Q, KeyAction::Quit, Arg::None), |
| 86 | Key::new(&[MODKEY], keycodes::J, KeyAction::FocusStack, Arg::Int(-1)), |
| 87 | Key::new(&[MODKEY], keycodes::K, KeyAction::FocusStack, Arg::Int(1)), |
| 88 | |
| 89 | Key::new(&[MODKEY], keycodes::KEY_1, KeyAction::ViewTag, Arg::Int(0)), |
| 90 | Key::new(&[MODKEY], keycodes::KEY_2, KeyAction::ViewTag, Arg::Int(1)), |
| 91 | Key::new(&[MODKEY], keycodes::KEY_3, KeyAction::ViewTag, Arg::Int(2)), |
| 92 | Key::new(&[MODKEY], keycodes::KEY_4, KeyAction::ViewTag, Arg::Int(3)), |
| 93 | Key::new(&[MODKEY], keycodes::KEY_5, KeyAction::ViewTag, Arg::Int(4)), |
| 94 | Key::new(&[MODKEY], keycodes::KEY_6, KeyAction::ViewTag, Arg::Int(5)), |
| 95 | Key::new(&[MODKEY], keycodes::KEY_7, KeyAction::ViewTag, Arg::Int(6)), |
| 96 | Key::new(&[MODKEY], keycodes::KEY_8, KeyAction::ViewTag, Arg::Int(7)), |
| 97 | Key::new(&[MODKEY], keycodes::KEY_9, KeyAction::ViewTag, Arg::Int(8)), |
| 98 | |
| 99 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_1, KeyAction::MoveToTag, Arg::Int(0)), |
| 100 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_2, KeyAction::MoveToTag, Arg::Int(1)), |
| 101 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_3, KeyAction::MoveToTag, Arg::Int(2)), |
| 102 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_4, KeyAction::MoveToTag, Arg::Int(3)), |
| 103 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_5, KeyAction::MoveToTag, Arg::Int(4)), |
| 104 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_6, KeyAction::MoveToTag, Arg::Int(5)), |
| 105 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_7, KeyAction::MoveToTag, Arg::Int(6)), |
| 106 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_8, KeyAction::MoveToTag, Arg::Int(7)), |
| 107 | Key::new(&[MODKEY, SHIFT], keycodes::KEY_9, KeyAction::MoveToTag, Arg::Int(8)), |
| 108 | ]; |
| 109 | |
| 110 | // ======================================== |
| 111 | // STATUS BAR BLOCKS |
| 112 | // ======================================== |
| 113 | pub const CLOCK_FORMAT: &str = " %a, %b %d - %-I:%M %P"; // "Fri, Oct 03 - 7:58 pm" |
| 114 | pub const SEPARATOR: &str = " | "; |
| 115 | pub const UNAME_COLOR: u32 = RED; |
| 116 | pub const UNAME_PREFIX: &str = " "; |
| 117 | pub const SEP_COLOR: u32 = GRAY_LIGHT; |
| 118 | pub const CLOCK_COLOR: u32 = CYAN; |
| 119 | |
| 120 | const SHIFT: KeyButMask = KeyButMask::SHIFT; |