summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-08-03 00:08:08 -0400
committerJesse Luehrs <doy@tozt.net>2022-08-03 00:08:08 -0400
commit98eaa6b50e9313be58d05f2b42fa0637a2cf5978 (patch)
treef29a63143b2c1170b72152d638ee56f63d13d1ec /bin
parentff91a4edc6e3bb5051c4ba5033ae5a6d49fa1f0b (diff)
downloadconf-98eaa6b50e9313be58d05f2b42fa0637a2cf5978.tar.gz
conf-98eaa6b50e9313be58d05f2b42fa0637a2cf5978.zip
fix volume script for pipewire
Diffstat (limited to 'bin')
-rwxr-xr-xbin/hornet/volume20
1 files changed, 2 insertions, 18 deletions
diff --git a/bin/hornet/volume b/bin/hornet/volume
index e39c4b0..4a89d9b 100755
--- a/bin/hornet/volume
+++ b/bin/hornet/volume
@@ -3,26 +3,10 @@ use strict;
use warnings;
use 5.014;
-chomp(my $sink=`pacmd stat | grep 'Default sink name' | sed 's/^Default sink name: //'`);
+chomp(my $sink=`pactl get-default-sink`);
sub get {
- my $volume;
-
- for (split "\n", `pacmd list-sinks`) {
- chomp;
- next unless /name: <\Q$sink\E>/../^$/;
- if (/^\s+volume: .* ([0-9]+)% /) {
- if (!defined($volume)) {
- $volume = $1;
- }
- }
- elsif (/^\s+muted: yes/) {
- $volume = 'mute';
- last;
- }
- }
-
- $volume
+ (`pactl get-sink-volume $sink` =~ /(\d+)%/)[0]
}
if ($ARGV[0] eq 'get') {