Test interface with command runner
parent
044265dc51
commit
e3ec07ca47
Binary file not shown.
|
Before Width: | Height: | Size: 131 B After Width: | Height: | Size: 257 KiB |
@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
pub struct SongMetadata
|
||||||
|
{
|
||||||
|
pub name: String,
|
||||||
|
pub artist: String,
|
||||||
|
pub album: String,
|
||||||
|
}
|
||||||
|
impl SongMetadata
|
||||||
|
{
|
||||||
|
fn new() -> SongMetadata
|
||||||
|
{
|
||||||
|
SongMetadata {
|
||||||
|
name: "NONE".to_string(),
|
||||||
|
artist: "NONE".to_string(),
|
||||||
|
album: "NONE".to_string(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
pub fn get_song_metadata() -> SongMetadata
|
||||||
|
{
|
||||||
|
const COM_START: String = "playerctl --player=strawberry ";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fn run_command(command: &str) -> String
|
||||||
|
{
|
||||||
|
let output = Command::new("sh")
|
||||||
|
.arg("-c")
|
||||||
|
.arg(command)
|
||||||
|
.output()
|
||||||
|
.expect("Failed to run the command");
|
||||||
|
str::from_utf8(&output.stdout).expect("Failed to convert command result to utf8 string").to_string()
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue