Merge pull request #7 from MustafaSalih1993/dev
fixed the volume to run on arch based
This commit is contained in:
commit
0356280b0a
11
src/sound.rs
11
src/sound.rs
@ -11,14 +11,15 @@ pub fn get_sound(setting: &Settings) -> String {
|
|||||||
.output()
|
.output()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let vol: String = String::from_utf8_lossy(&cmd_content.stdout)
|
let mut vol: String = String::from_utf8_lossy(&cmd_content.stdout)
|
||||||
.split('\n')
|
.lines()
|
||||||
.collect::<Vec<&str>>()[4]
|
.last()
|
||||||
|
.expect("failed to get sound volume")
|
||||||
.split('[')
|
.split('[')
|
||||||
.collect::<Vec<&str>>()[1]
|
.collect::<Vec<&str>>()[1]
|
||||||
.split(']')
|
.trim()
|
||||||
.collect::<Vec<&str>>()[0]
|
|
||||||
.to_string();
|
.to_string();
|
||||||
|
vol.remove(vol.len() - 1);
|
||||||
|
|
||||||
format!(" {} {} {}", setting.volume.icon, vol, setting.seperator)
|
format!(" {} {} {}", setting.volume.icon, vol, setting.seperator)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user