Skip to content

Commit

Permalink
Move Icons to the start of the line (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
M4rti21 authored May 9, 2024
1 parent e457baa commit 12c2336
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/bluetooth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ pub struct Device {
impl Device {
pub fn get_icon(name: &str) -> String {
match name {
"audio-card" => String::from("󰦢 "),
"audio-card" => String::from("󰓃"),
"audio-input-microphone" => String::from(""),
"audio-headphones" => String::from("󰥰"),
"battery" => String::from("󰥆"),
"audio-headphones" => String::from("󰋋"),
"battery" => String::from("󰂀"),
"camera-photo" => String::from("󰻛"),
"computer" => String::from(""),
"input-keyboard" => String::from("󰌌"),
"input-mouse" => String::from("󰦋"),
"phone" => String::from("󰏳"),
_ => String::new(),
"input-mouse" => String::from("󰍽"),
"phone" => String::from("󰏲"),
_ => String::from(" "),
}
}
}
Expand Down Expand Up @@ -103,7 +103,7 @@ impl Controller {

let device = Device {
addr,
alias: format!("{} {}", alias, icon),
alias: format!("{} {}", icon, alias),
is_paired,
is_trusted,
is_connected,
Expand All @@ -116,6 +116,7 @@ impl Controller {
new_devices.push(device);
}
}

paired_devices.sort_by_key(|i| i.addr);
new_devices.sort_by_key(|i| i.addr);
Ok((paired_devices, new_devices))
Expand Down

0 comments on commit 12c2336

Please sign in to comment.