updated readme and tui
This commit is contained in:
@@ -32,7 +32,7 @@ Use the `--tag` option if you want to install a specific tag instead of the late
|
|||||||
|
|
||||||
## TUI Extension
|
## TUI Extension
|
||||||
|
|
||||||
A TUI wrapper `pbpctui` is provided in the `tui` directory. It uses `ratatui` to provide a visual interface for monitoring status and changing settings.
|
A TUI program `pbpctui` is provided in the `tui` directory. It uses `ratatui` to provide a visual interface for monitoring status and changing settings.
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
@@ -44,7 +44,6 @@ cargo install pbpctui --git https://github.com/qzed/pbpctrl/
|
|||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
Ensure `pbpctrl` is installed and available in your PATH (or in the current directory).
|
|
||||||
Run:
|
Run:
|
||||||
```sh
|
```sh
|
||||||
pbpctui
|
pbpctui
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ pub async fn find_maestro_device(adapter: &Adapter) -> Result<Device> {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !dev.is_connected().await.unwrap_or(false) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let uuids = dev.uuids().await?.unwrap_or_default();
|
let uuids = dev.uuids().await?.unwrap_or_default();
|
||||||
if !uuids.contains(&maestro::UUID) {
|
if !uuids.contains(&maestro::UUID) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use std::{io, time::Duration};
|
use std::{fs::File, io, sync::Mutex, time::Duration};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use crossterm::{
|
use crossterm::{
|
||||||
event::{self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode},
|
event::{self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode},
|
||||||
@@ -18,9 +18,11 @@ use maestro_client::{ClientCommand, ClientEvent};
|
|||||||
|
|
||||||
#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
|
let log_file = File::create("pbpctui.log")?;
|
||||||
tracing_subscriber::fmt()
|
tracing_subscriber::fmt()
|
||||||
.with_max_level(tracing::Level::INFO)
|
.with_max_level(tracing::Level::INFO)
|
||||||
.with_writer(std::io::stderr)
|
.with_writer(Mutex::new(log_file))
|
||||||
|
.with_ansi(false)
|
||||||
.init();
|
.init();
|
||||||
|
|
||||||
// Setup terminal
|
// Setup terminal
|
||||||
|
|||||||
Reference in New Issue
Block a user