From 965a1dcad234ebeca20641f625947d51c0c07625 Mon Sep 17 00:00:00 2001 From: Richard Halford <63303646+rsHalford@users.noreply.github.com> Date: Fri, 3 Sep 2021 17:15:52 +0100 Subject: [PATCH] Add partition labelling to dmenumount If a partition doesn't have a label, it results in a double space that awk ignores. Which is why the changes include a pipe into sed. --- .local/bin/dmenumount | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/dmenumount b/.local/bin/dmenumount index 3cb1f81..cb0601e 100755 --- a/.local/bin/dmenumount +++ b/.local/bin/dmenumount @@ -50,7 +50,7 @@ asktype() { \ } anddrives=$(simple-mtpfs -l 2>/dev/null) -usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | grep 'part\|rom' | awk '$4==""{printf "%s (%s)\n",$1,$3}')" +usbdrives="$(lsblk -rpo "name,type,size,label,mountpoint" | grep 'part\|rom' | sed 's/ /:/g' | awk -F':' '$5==""{printf "%s (%s) %s\n",$1,$3,$4}')" if [ -z "$usbdrives" ]; then [ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit