Exit if no device selected in bluetooth_connect.pl
Also use 'printf' instead of 'echo' to interpret avoid extra newlines
This commit is contained in:
@ -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}`;
|
||||
|
Reference in New Issue
Block a user