aboutsummaryrefslogtreecommitdiff
path: root/src/sound.rs
diff options
context:
space:
mode:
authorMustafa Salih <37256744+MustafaSalih1993@users.noreply.github.com>2021-01-01 07:21:05 +0300
committerGitHub <noreply@github.com>2021-01-01 07:21:05 +0300
commit2a10378da4097477b66edac08b5a80c6cf1d2567 (patch)
tree04414b286321ddfc7d1e84a3accd551321aefeb0 /src/sound.rs
parent2bbf632baa73448f54a6292ab105e60a25cb587f (diff)
parent7f60ba8ea09969411906ca5dbb48b6357596218a (diff)
Merge pull request #10 from MustafaSalih1993/dev
Dev
Diffstat (limited to 'src/sound.rs')
-rw-r--r--src/sound.rs25
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)
-}