feat(config): add separator and icon configuration
Swadhin Biswas committed 7 months ago
83eef77
1 parent c5294b9
commit 83eef77
1 file changed
+70 -0
Showing 1 changed file+70-0
▼src/config/mod.rs
+70-0
| @@ -488,3 +488,73 @@ show_de = true | ||
488 | 488 | show_wm = true |
489 | 489 | show_wm_theme = true |
490 | 490 | show_theme = true |
491 | +show_icons = true | |
492 | +show_terminal = true | |
493 | +show_term_font = true | |
494 | +show_cpu = true | |
495 | +show_gpu = true | |
496 | +show_memory = true | |
497 | +show_disk = false | |
498 | +show_battery = false | |
499 | +show_local_ip = false | |
500 | +show_public_ip = false | |
501 | +show_locale = false | |
502 | +show_song = false | |
503 | +show_users = false | |
504 | +show_colors = true | |
505 | + | |
506 | + | |
507 | +# ─── Progress Bars ────────────────────────────────────────────────────────── | |
508 | +# Show progress bars alongside memory/disk usage | |
509 | + | |
510 | +# Show a progress bar next to memory info | |
511 | +# memory_bar = false | |
512 | + | |
513 | +# Show a progress bar next to disk info | |
514 | +# disk_bar = false | |
515 | + | |
516 | +# Width of progress bars (in characters) | |
517 | +# bar_width = 15 | |
518 | + | |
519 | + | |
520 | +# ─── Color Blocks ─────────────────────────────────────────────────────────── | |
521 | + | |
522 | +# Range of colors to display in color blocks | |
523 | +# Default shows all 16 standard terminal colors (0-15) | |
524 | +# block_range = [0, 15] | |
525 | + | |
526 | +# Width of each color block (in spaces) | |
527 | +# block_width = 3 | |
528 | + | |
529 | +# Height of color blocks (in lines) | |
530 | +# block_height = 1 | |
531 | + | |
532 | + | |
533 | +# ─── Underline ─────────────────────────────────────────────────────────────── | |
534 | + | |
535 | +# Character used for the title underline | |
536 | +# underline_char = "-" | |
537 | + | |
538 | + | |
539 | +# ─── Misc ──────────────────────────────────────────────────────────────────── | |
540 | + | |
541 | +# Stdout mode: disable colors and image (useful for piping) | |
542 | +# stdout = false | |
543 | +"##; | |
544 | + | |
545 | +#[cfg(test)] | |
546 | +mod tests { | |
547 | + use super::*; | |
548 | + | |
549 | + #[test] | |
550 | + fn test_default_config() { | |
551 | + let config = Config::default(); | |
552 | + assert_eq!(config.separator, ": "); | |
553 | + assert!(!config.no_color); | |
554 | + assert!(config.bold); | |
555 | + assert!(config.show_title); | |
556 | + assert!(config.show_os); | |
557 | + assert!(config.show_cpu); | |
558 | + assert!(config.show_memory); | |
559 | + assert!(!config.show_disk); | |
560 | + assert!(!config.show_battery); | |
491 | 561 | |