summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
authorRichard Halford <63303646+rsHalford@users.noreply.github.com>2021-09-03 17:15:52 +0100
committerGitHub <noreply@github.com>2021-09-03 17:15:52 +0100
commit965a1dcad234ebeca20641f625947d51c0c07625 (patch)
treedfade515b29b4a573b09d3b1ca39fe66b42c3ff1 /.local
parent9a2dc2618e4875b59a19709ec810402ce7d5df28 (diff)
downloadeibhear-965a1dcad234ebeca20641f625947d51c0c07625.tar.gz
eibhear-965a1dcad234ebeca20641f625947d51c0c07625.tar.zst
eibhear-965a1dcad234ebeca20641f625947d51c0c07625.zip
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.
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/dmenumount2
1 files changed, 1 insertions, 1 deletions
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