mirror of
https://github.com/LukeHagar/omarchy.git
synced 2025-12-06 04:20:23 +00:00
19 lines
507 B
Bash
Executable File
19 lines
507 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Select a drive from a list with info that includes space and brand
|
|
|
|
if (($# == 0)); then
|
|
drives=$(lsblk -dpno NAME | grep -E '/dev/(sd|hd|vd|nvme|mmcblk|xv)')
|
|
else
|
|
drives="$@"
|
|
fi
|
|
|
|
drives_with_info=""
|
|
while IFS= read -r drive; do
|
|
[[ -n "$drive" ]] || continue
|
|
drives_with_info+="$(omarchy-drive-info "$drive")"$'\n'
|
|
done <<<"$drives"
|
|
|
|
selected_drive="$(printf "%s" "$drives_with_info" | gum choose --header "Select drive")" || exit 1
|
|
printf "%s\n" "$selected_drive" | awk '{print $1}'
|