diff options
Diffstat (limited to 'src/sound.rs')
-rw-r--r-- | src/sound.rs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/sound.rs b/src/sound.rs deleted file mode 100644 index 6367cac..0000000 --- a/src/sound.rs +++ /dev/null @@ -1,25 +0,0 @@ -use crate::load_config::Settings; -use std::process::Command; - -// TODO: what a horrible solution to get the sound, i dont like it -// find another way you dumb fuck - -pub fn get_sound(setting: &Settings) -> String { - let cmd_content = Command::new("amixer") - .args(&["-D", "pulse", "get", "Master"]) - .output() - .expect("Make sure that you have alsa-utils installed on your system"); - - let vol: String = String::from_utf8_lossy(&cmd_content.stdout) - .lines() - .last() - .expect("failed to get sound volume") - .split('[') - .collect::<Vec<&str>>()[1] - .split(']') - .collect::<Vec<&str>>()[0] - .trim() - .to_string(); - - format!(" {} {} {}", setting.volume.icon, vol, setting.seperator) -} |