Mahesh Asolkar 66923c8f43 Added unit test for music module
Reorganized unit tests into unit_tests directory
2025-08-03 11:33:19 -07:00
2025-08-03 11:33:19 -07:00
2025-05-04 17:36:09 +00:00
2025-05-04 17:36:09 +00:00
2025-08-03 11:33:19 -07:00

Unibar

Simple bar written in Rust

Description

  • A tool that returns variety of components in a string suitable to use in a status bar
  • Currently implemented modules:
    • date
    • memory
    • music
    • network
    • power
    • time
    • weather
    • cpu

Usage

  • Use the --help option for usage information:
A tool that returns variety of components in a string
 suitable to use in a status bar

Usage: unibar [OPTIONS]

Options:
  -i, --interval <INTERVAL>
          Update interval in seconds

          [default: 5]

  -s, --weather-station <WEATHER_STATION>
          Name of the weather station

          [default: khio]

  -m, --weather-metric
          Use Metric units in weather data. Imperial units otherwise

  -p, --music-progress
          Show music progess

  -D, --debug
          Show verbose debug information during run

  -M, --debug-modules
          Show module debug information after all modules are evaluated but before output is printed

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Example output

  • Default
$ target/release/unibar
status ⏸ Dire Straits - Tunnel of Love 💾 24% 💻 2% 🔌 100% 📶 192.168.1.93 ☀️ 83°F 📅 2025 Jun 07 🕑 09:24PM -07:00
status ⏸ Dire Straits - Tunnel of Love 💾 24% 💻 2% 🔌 100% 📶 192.168.1.93 ☀️ 83°F 📅 2025 Jun 07 🕑 09:24PM -07:00
status ⏸ Dire Straits - Tunnel of Love 💾 24% 💻 2% 🔌 100% 📶 192.168.1.93 ☀️ 83°F 📅 2025 Jun 07 🕑 09:25PM -07:00
^C
  • With music progress
$ target/release/unibar --music-progress
status ⏸ Dire Straits - Tunnel of Love [6% 14:23] 💾 24% 💻 1% 🔌 100% 📶 192.168.1.93 ☀️ 83°F 📅 2025 Jun 07 🕑 09:25PM -07:00
status ⏸ Dire Straits - Tunnel of Love [6% 14:23] 💾 24% 💻 1% 🔌 100% 📶 192.168.1.93 ☀️ 83°F 📅 2025 Jun 07 🕑 09:25PM -07:00
^C

Unit testing

Use the following command to run unit tests:

$ cargo test --package unibar --bin unibar

To run a specific test, use the following:

$ cargo test --package unibar --bin unibar -- bar_modules::bar_module_weather::tests::test_get_unicode_symbol_default --exact --show-output
Description
A tool that returns variety of components in a string suitable to use in a status bar
Readme MIT 226 KiB
Languages
Rust 99.8%
Shell 0.2%