summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorRichard Halford <63303646+rsHalford@users.noreply.github.com>2021-09-23 16:48:58 +0100
committerGitHub <noreply@github.com>2021-09-23 11:48:58 -0400
commit93a9e978dadf0a855dd78b3e4b88c4c9640d39ee (patch)
treebc8d0c355b6a40aa8366550db0cb82cb495d0701 /.local/bin
parentc172efd5157c16748801fc32a96cb70638eec4e1 (diff)
downloadeibhear-93a9e978dadf0a855dd78b3e4b88c4c9640d39ee.tar.gz
eibhear-93a9e978dadf0a855dd78b3e4b88c4c9640d39ee.tar.zst
eibhear-93a9e978dadf0a855dd78b3e4b88c4c9640d39ee.zip
Add partition label to dmenuumount script (#999)
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/bin')
-rwxr-xr-x.local/bin/dmenuumount2
1 files changed, 1 insertions, 1 deletions
diff --git a/.local/bin/dmenuumount b/.local/bin/dmenuumount
index 52dd7ff..f7d0747 100755
--- a/.local/bin/dmenuumount
+++ b/.local/bin/dmenuumount
@@ -26,7 +26,7 @@ asktype() { \
esac
}
-drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}')
+drives=$(lsblk -nrpo "name,type,size,mountpoint,label" | sed 's/ /:/g' | awk -F':' '$4!~/\/boot|\/efi|\/home$|SWAP/&&length($4)>1{printf "%s (%s) %s\n",$4,$3,$5}')
if ! grep simple-mtpfs /etc/mtab; then
[ -z "$drives" ] && echo "No drives to unmount." && exit