From 064b3561a5c190a01bb25e26ff664df34bf77b6b Mon Sep 17 00:00:00 2001 From: Andrew Date: Sat, 13 Jul 2024 22:33:46 +0100 Subject: [PATCH] Exit if no device selected in bluetooth_connect.pl Also use 'printf' instead of 'echo' to interpret avoid extra newlines --- bluetooth_connect.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bluetooth_connect.pl b/bluetooth_connect.pl index 43ad625..ab9261c 100755 --- a/bluetooth_connect.pl +++ b/bluetooth_connect.pl @@ -20,7 +20,7 @@ foreach my $name (sort(keys %devices)) { $device_list .= $name . "\n"; } -my $selection = `echo "$device_list" | dmenu`; +my $selection = `printf "$device_list" | dmenu` or die("No selection made"); chomp($selection); `notify-send "$script_name" "Attempting to connect to $selection"`; `bluetoothctl connect $devices{$selection}`;