From 129583d572a259fb5ba3c7c24407b39a6dd2223d Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 29 Jan 2025 11:33:52 +0000 Subject: [PATCH] [bluetooth_info.pl]: Add more icons --- src/bluetooth_info.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bluetooth_info.pl b/src/bluetooth_info.pl index f5508a5..7052655 100755 --- a/src/bluetooth_info.pl +++ b/src/bluetooth_info.pl @@ -11,7 +11,9 @@ my $device_name = ($output =~ /Name:\s+(.*)/) ? "$1" : "unknown"; my $icon = ($output =~ /Icon:\s+(.*)/) ? "$1" : ""; my $battery_percentage = ($output =~ /Battery Percentage:\s+\S+\s\(([0-9]+)\)/) ? "$1" : "?"; -if ($icon eq "audio-headphones") { - printf(" "); -} -printf("$device_name $battery_percentage%%"); +my %icons = ( + "audio-headphones" => "", + "audio-headset" => "" +); + +printf("$icons{$icon} $device_name $battery_percentage%%");